Benzene logo Benzene

Blog

Our agents broke our code twice on day one. Here's why that's the feature.

Most agent frameworks answer "what should the agent do?" Benzene starts from a different question: how would you know it did it right?

We pointed Benzene at its own repository with a single purpose—Be the Best AI Agent System for Business Automation—and started the Resonator. The system runs an organisation of six offices, each led by cells that propose changes and wait for verification. Work only counts when a real check passes. Anything else is noise.

The setup

Benzene does not rely on prompts alone to guarantee quality. It relies on a compiler, a test suite, and a ledger. The genome names its verifiers before the first task even runs, drawn from more than forty verifier types (VERIFIER_TYPES in benzene/manifest.py). These range from executing arbitrary shell commands to checking document structure, enforcing file patterns, reconciling a ledger, running Playwright UI audits, respecting size budgets, and choosing the TypeScript compiler or a Node import check by what the project contains.

When the CTO office receives a directive, it drafts changes against live files. Then the ratchet engages. If the combined health score drops, the cycle reverses. If it rises, the delta is kept. This binary decision removes ambiguity from autonomous development. There is no "sort of working" or "mostly fine" that makes the workspace worse: a change that lowers the score does not stay.

On day one, the first cycle exposed a critical gap in our safety net. The CTO found a failing test and attempted a repair using a free model. The repair introduced a syntax error directly into benzene/verifiers.py. Normally, this would crash immediately. But because the underlying test suite was already red, the verifier output looked identical before and after the change. The ratchet interpreted the neutral score as acceptable progress and committed the broken syntax. The guardrail missed it.

Cycle one: the guardrail missed it

Missing syntax errors inside the verification layer itself is a particularly dangerous failure mode. We could have chased a hyperparameter, adjusted the temperature, or added more instructional text to the prompt. Instead, we treated the failure as a design flaw and fixed the architecture. We added a compile check to the CTO's genome:

    - {type: command, name: "verify:compiles", command: [python, -m, compileall, -q, benzene, samples, tests]}

This small addition fundamentally changed how the system evaluates code. Now "the code compiles" stands as its own independent verdict, completely separate from "the tests pass." Syntax errors are caught the moment they are written, regardless of the surrounding test matrix state. The compiler does not care about your hypotheses; it cares about bytecodes and parse trees. By anchoring quality to hard boundaries, we eliminate the ambiguity that allowed the first bug to slip through.

Cycle two: caught

With the new compile verifier active, the same office made the same kind of mistake. On the second cycle, the agent wrote invalid Python again. This time, verify:compiles fired instantly. Health plummeted. The ratchet engaged, reverting all five touched files back to their pre-cycle state. The CEO's inbox received a single line: maintenance failed; the workspace was left as found; retried next cycle.

No damage persisted. No merge conflict required human intervention. The cycle closed cleanly.

Why this is the feature

An agent that never fails does not exist. What you can actually build is a system where a failure cannot stand. When verification comes first, work discovery shifts from hopeful guessing to empirical reality. Failure feeds back into the next attempt. Worse gets rolled back. And because the Resonator logs publicly, anyone can watch the mechanism operate without stepping inside the box. Trust stops being a marketing slide and becomes a daily operational fact.

Try it locally: curl -fsSL https://benzene-agent.org/install.sh | sh -s -- "your purpose" installs Benzene and hands setup to your coding CLI (benzene plugin start --for claude "your purpose" once it is installed), then benzene serve . --cycle-every 3600 --tunnel benzene and share the link. Watch the graph. See what happens when the code breaks.

Extending the guardrail

You can define custom verifiers for almost any language ecosystem. Rust projects ship with cargo test; Go projects use go vet; TypeScript applications rely on tsc --noEmit. The beauty of Benzene's approach is that these checks run offline, locally, and deterministically. You do not need an API key to verify that your code parses correctly. This lowers the barrier to entry for teams adopting agent-assisted workflows.

Static analysis is already in the list: the lint type runs the linter of each written file's kind (ruff, ESLint, ShellCheck and more) and the audit type runs security scanners such as Bandit and pip-audit, so you choose which rules count.

Conclusion

Autonomy without accountability is just chaos disguised as innovation. Benzene builds the accountability layer explicitly: compilers, test suites, and live graphs that refuse to lie. If you want agents you can trust with more over time, start by giving them a mirror that shows exactly what they've done wrong.

Real-World Implications

Beyond theory, this changes when a mistake is caught. A check runs before a change counts, not after it has merged. In Benzene's own organisation that is what cycle two showed: the compile check failed and the five files were restored before anyone had to look.

The cost side is plain too. A check costs one run of a compiler or a test suite on your own machine; a broken change that stands costs everything built on top of it.

What Competitors Miss

Other frameworks treat failures as inevitable friction. They optimise for speed, volume, or convenience. Benzene treats every failure as data. Each rollback teaches the system something new. Over weeks, the cell improves—not by getting luckier, but by accumulating evidence about what works and what does not.

That accumulated knowledge is unique. It lives in the genome, not in tribal memory. Any new team member inherits the full learning history of every cell that came before.

Getting Started Today

Whether you are a solo developer experimenting with AI assistance or a team lead managing ten engineers, the principle remains the same: verify before you trust. Install Benzene, point it at your repo, and watch the first cycle heal something you didn't even know was broken.

All posts