Guardrails
Every agent carries its checks on the points of its life where it works, so nothing is presented as done until the toolchain says so. One instrument per kind of work, forty-two of them, and a host check before the daemon starts.
Three agents, one guardrail
A check that runs only at the end tells the agent what was wrong one attempt late, and pays a judge to read what a compiler would have rejected in a second. In Benzene the deterministic checks ride the agent's hooks. Amber is a check; green is work that counts.
A model agentworks in a session with Benzene's own tools
The verdict on each file rides back on the write, so the agent fixes it before it answers.
A coder agentClaude Code, OpenCode or Codex running the session
The compiler, the linter and the tests run on the files the CLI wrote before anything else is judged; while one fails, its output is the correction.
A workflow agenta graph of reads, models, writes and publishes
A guardrail node stands on every way to the end: the report has its sections, the numbers are on the record. A failing node fails the run where it stands, or takes its fail edge.
Every agent, when the work is donethe guardrail itself
A verdict a hook already gave is recorded, not run twice. A failed check caps the score; partial credit says how close it came, never enough to pass.
Built bound. Founding binds the office's bars, the scout binds the checks it proved, a colony binds a genome's deterministic verifiers at seed. benzene doctor says whether every living agent is bound; the Hooks tab of each agent shows what rides each point.
Forty-two instruments
In physics every quantity has its instrument: a ruler for distance, a thermometer for heat. Every kind of work an agent delivers has one too. A program is measured by its compiler, linter and tests; an article by its reading grade, spelling and links; a post by its channel's limit; an export by its rows; a deck by its slides; an image by its pixels. Every one but the last is a script that decides the same way every time, which is what lets it ride a hook.
| Type | What it measures | Office |
|---|---|---|
| tsc | the TypeScript compiler passes in the project | CTO |
| node | every JS file written parses, and its imports resolve under Node's ESM and CJS rules | CTO |
| auto | tsc where there is a tsconfig, node otherwise | CTO |
| command | any command exits 0: the test suite, a build, a script of the project's own | any |
| lint | the linter of each written file's kind passes: ruff, eslint, shellcheck, hadolint, yamllint, markdownlint, actionlint, sqlfluff, terraform validate, kubeconform and thirty more | CTO |
| format | each written file is formatted canonically: prettier, ruff format or black, gofmt, rustfmt, shfmt, clang-format | CTO |
| build | the project builds: its compiler or build script exits 0 (compileall, go build, cargo check, npm run build, dotnet build, mvn compile) | CTO |
| tests | the test suite passes (pytest, npm test, go test, cargo test, dotnet test, mvn test), with partial credit from its summary | CTO |
| coverage | the coverage report (coverage.xml, lcov.info, coverage.json, clover.xml, jacoco.xml) is at least a percentage | CTO |
| audit | no known vulnerability or security finding: pip-audit, bandit, npm audit, cargo audit, govulncheck, semgrep, trivy, checkov | CTO |
| secrets | no secret or private key in the written files: the built-in patterns always, gitleaks or detect-secrets when present | any |
| diff | the change stays within bounds: at most so many files and lines, every written file under the allowed paths | CTO |
| notebook | a Jupyter notebook holds no error output and, with jupyter, executes end to end | CTO |
| sql | every SQL statement parses and, with a sqlite database, runs on a copy of it and returns rows within bounds | CTO |
| measure | a number a command prints (a benchmark, an evaluation score) is at least, at most or equal to the target, within the time | CTO |
| Type | What it measures | Office |
|---|---|---|
| sections | a document carries the required headings with a body, the front-matter fields, a pattern per section | CMO, CXO, COO |
| claims | every number, currency amount and record id in a document exists in its sources; labelled estimates are exempt | CMO, CXO, CIO |
| finance | a yaml block prices every active office, keeps ceilings under a budget, states an ROI that matches the ledger | CFO |
| file_pattern | a file matches a pattern and not a forbidden one | any |
| size | every file matching a glob stays under a byte budget, gzipped if asked, with partial credit by how far over | CTO, CMO |
| prose | words within bounds, sentences no longer than allowed, a reading grade at most, none of the forbidden phrases, no paragraph repeated | CMO, CXO, COO |
| spelling | no misspelt word (codespell; cspell, hunspell or aspell when chosen) | CMO, CXO, CTO |
| links | every link resolves: a relative one to a file, an http(s) one answering under 400 | CMO, CTO |
| language | the text is in the language expected and a translation's length stays in proportion to its source | CMO, CXO |
| message | each file is one post, subject line or reply that fits its channel: the character limit, the patterns required, no placeholder | CMO, CXO |
| citations | every [n] in the text has a reference and every reference is cited; every URL and DOI resolves | CXO, CIO, CMO |
| document | a PDF or office file as its reader opens it: the format, pages or slides within bounds, the text required, no formula error in a sheet | CFO, CIO, COO |
| provenance | the words a task adds hold up: every file it cites exists, no word of a line it kept is corrupted, no cited source is dropped, every path it writes is clean | CMO, CXO, COO |
| Type | What it measures | Office |
|---|---|---|
| parse | every written file of a known format is well-formed: json, yaml, toml, xml, svg, csv, ini, py, ipynb, html | any |
| schema | a JSON or YAML file validates against a JSON Schema; an OpenAPI document against the specification | CTO, COO |
| data | a table's shape: rows within bounds, the columns required, unique and not-null columns holding (csv, tsv, jsonl; xlsx, parquet) | CFO, CXO, COO |
| json_path | values inside a JSON or YAML file: each path equals, matches or stays within bounds | any |
| arithmetic | the numbers add up: every table's total row, percentages summing to 100, expressions over a yaml block's names | CFO, CIO |
| identifiers | every identifier of a kind is valid by its checksum or format: iban, isbn, ean, email, phone, uuid, date, url, currency, country, timezone | CFO, COO, CXO |
| Type | What it measures | Office |
|---|---|---|
| ui | a Playwright audit of the built site against WCAG 2.2 AA, Core Web Vitals and tap targets, with partial credit per rule | CTO, CXO |
| html | a page is complete: one title and a description within length, a lang, alt on every image, one h1, headings in order, the tags or meta required | CTO, CMO |
| http | an endpoint answers with the status expected, within the time, the body matching the patterns, the JSON holding the values | CTO |
| image | an image's facts: the format, width and height within bounds, the aspect ratio, the byte size | CMO, CTO |
| media | a video or audio file through ffprobe: the container, the duration within bounds, the resolution | CMO |
| Type | What it measures | Office |
|---|---|---|
| hygiene | written text files are clean: UTF-8, one line ending, a final newline, no trailing whitespace, no conflict marker, no placeholder | any |
| layout | the deliverable's files exist: each required glob matches a file, each forbidden glob matches none | any |
| Type | What it measures | Office |
|---|---|---|
| image_judge | a vision model scores every image the task wrote as a reader sees it, against a design rubric; the one verifier that is a model, so it judges the work when it is done and never rides a hook | CMO |
The cheap ones (a file's linter, its format, a parse, a reading grade, a channel limit, an image's pixels) ride every write too. A standard's bar, a ticket's acceptance and the scout may use any of them.
Before the daemon starts
A check is only as good as the tool behind it. The preliminary system check runs on the host that will run the daemon: which instruments it can use now, which it can install, which cannot run there. What flutter doctor does for one toolchain, it does for the toolchain of every kind of work the organisation will measure.
benzene instruments . judges each instrument for the kinds of file and project the workspace holds, so a Python project is never told to install shellcheck.--for benzene-standards.yaml judges only the checks the standard and the genomes name, and fails while one lacks its tool.--install prints the commands for this host's package managers and runs nothing. A bar nothing on the host can measure keeps no check: a human judges it.$ benzene instruments .
benzene instruments · vps-1 · Linux 5.15 x86_64 · Python 3.10.12
managers: pip, npm, apt · network: yes · browser: chromium-1243
workspace lightcss: css, md, js, html, node-project, yaml, image
code
✓ tsc with tsc 5.6 (node_modules/.bin)
~ lint with js: eslint 9.12 · missing md: markdownlint-cli2, css: stylelint
↓ spelling missing codespell · install: python -m pip install codespell
✗ media missing ffprobe (no route on this host)
– image_judge needs OPENROUTER_API_KEY (not set)
...
34 of 42 instruments ready on this host; 3 ready for some kinds;
4 can be installed (--install prints the commands); 1 cannot run here
Also in the guardrail
Onboarding starts with research: one subagent per office documents what the competitors of the purpose do, and the standard turns it into bars with a statement, a target, the measured values, the sources and, wherever an instrument can tell, a check. A bar nothing can measure is judged by a person, and the report says so.
A daughter cell inherits its parent's guardrail; the scout names the narrower checks its own job needs from the workspace's inventory, and keeps only what passes the clean workspace and fails a spoiled copy: a syntax error appended, headings removed, numbers changed. What it proves rides the skill's hooks from the next task.
Each step of a plan names its check: one of the office's verifiers, a check written on the ticket, a metric on the record, or a judge line for what nothing else can tell. A plan whose criteria nothing can check heals before dispatch; the criteria run in the workspace when the office finishes.
The product's own verifiers score the workspace before and after every task: progress is kept, worse is rolled back from a snapshot, the same failing fix is tried three cycles and then escalated. Whether a loop improves is tested with a holdout, a trend and a blind-spot check when the guardrail is satisfied while an instrument is not.
A hook is one line: the event and the check it carries, by the name the guardrail gives it or written in place. The colony writes these by default; a genome writes them to say what the agent is held to.
The reference: every type, its fields, the scoring and the host check
hooks:
- {event: post_write, verifier: "verify:cli"}
- {event: post_session, verifier: "verify:cli"}
- {event: pre_session, check: {type: tests, name: "verify:tests", cwd: "."}}
guardrail:
verifiers:
- {type: node, name: "verify:cli"}
- {type: prose, name: "verify:post", files: ["posts/*.md"], max_grade: 9}
workflow:
nodes:
- {id: pulse, type: write, params: {path: marketing/pulse.md, content: "..."}}
- {id: checked, type: guardrail, params: {verifier: "verify:post"}}