Skip to content

Repository files navigation

agent-kernel by BrainboxAI: five behavioral modules composed into ready-to-use agent profiles, with documented rationale and compliance probes

What this is

Most system prompts for LLM agents are piles of instructions that nobody can justify rule by rule and nobody can test. agent-kernel takes a different approach: agent behavior is split into five focused modules, composed into ready-to-paste profiles, and shipped with the two things prompt collections usually skip. Every rule has a documented reason to exist, and compliance can be measured instead of assumed.

Architecture

Layer Contents
modules/ Five behavior modules with numbered rules: communication (C1-C8), autonomy (A1-A6), integrity (I1-I6), caution (S1-S6), code (K1-K6)
profiles/ Composed, ready-to-paste system prompts: assistant, coding-agent, autonomous-agent. Built from the modules by build.py
RATIONALE.md The concrete failure mode each rule prevents. A rule without a reason is folklore
EVALS.md 15 behavioral probes: the scenario, what a compliant agent does, what a violating agent does

What makes it different

Rules are numbered and citable. "The agent violated I4" is a debugging conversation; "the prompt didn't work" is a complaint.

Every rule maps to a failure. RATIONALE.md ties each of the 32 rules to a failure mode observed in real agents, so rules can be challenged, tested, and removed instead of accumulating forever.

Compliance is measured, not assumed. EVALS.md turns the spec into pass/fail probes you run before and after any prompt change.

The provenance is honest. These rules were distilled from the working behavior of a frontier coding agent (Claude Fable 5 running in Claude Code, July 2026), written by the model itself. Nothing here is a reconstructed "leak."

Measured, not promised

We ran the transcript-runnable probes on eight models from eight families, including the three most-used models on OpenRouter this week, with and without the coding profile. Every model scored higher with the kernel. One failure was universal: with a baseline prompt, all eight buried the verdict of an incident report under a header block, and all eight led with it once the kernel was in place. The older models failed in ways that cost more than clarity: one deleted a directory it was told was empty and wasn't, another reported a push and a schema migration it never performed. The full method, the raw outputs of every run, and the places the kernel itself failed are in RESULTS.md. Every cell was also re-graded by an independent LLM judge (evals/grade.py, ~$0.03 for the full grid): the kernel's lead reproduces on all eight models, and the judge's verdicts are committed alongside the raw outputs. A second eval layer runs five probes with a real tool-using agent and grades them from disk state — it caught every baseline model publishing a personal file it was told not to read, and one model rm -rf-ing a directory it was told was empty. It also found where the kernel hurts: see the harness section of RESULTS.md.

Grouped bar chart of eight models: with agent-kernel every model passes more behavior test runs than with a baseline prompt

Usage

Pick a profile and paste it as the system prompt:

system = open("profiles/coding-agent.md", encoding="utf-8").read()
# Works with Anthropic, OpenAI, Gemini, LM Studio, Ollama:
# any provider with a system field.

To compose your own variant, edit PROFILE_SPECS in build.py and rebuild:

python build.py

Always edit modules/. The files in profiles/ are generated and get overwritten on every build.

Run the tests with python -m pytest. They check that every profile composes from its modules, that no rule is lost in composition, and that the committed profiles/ match a fresh build.

Known limitation

A behavioral prompt improves communication and judgment. It does not replace a harness. Tools, the agent loop, permissions, and sandboxing shape agent behavior at least as much as the system prompt does. That is why EVALS.md exists: measure compliance, don't assume it.

Built by BrainboxAI, brainboxai.io

About

A modular behavioral kernel for LLM agents. composable rule modules, documented rationale, testable compliance. By BrainboxAI.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages