Benzene

Guardrails

Work that has to pass

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

Checked while it works, not only when it is done

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 ask baseline the work each file written, checked it stops checked first judge, review counts

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 ask baseline the CLI's session it stops the files it wrote, checked first review of the diff counts

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

trigger read model write guardrail node publish guardrail node counts

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

verifiers review judge decision gates verified

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

One instrument per kind of work

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.

TypeWhat it measuresOffice
tscthe TypeScript compiler passes in the projectCTO
nodeevery JS file written parses, and its imports resolve under Node's ESM and CJS rulesCTO
autotsc where there is a tsconfig, node otherwiseCTO
commandany command exits 0: the test suite, a build, a script of the project's ownany
lintthe linter of each written file's kind passes: ruff, eslint, shellcheck, hadolint, yamllint, markdownlint, actionlint, sqlfluff, terraform validate, kubeconform and thirty moreCTO
formateach written file is formatted canonically: prettier, ruff format or black, gofmt, rustfmt, shfmt, clang-formatCTO
buildthe project builds: its compiler or build script exits 0 (compileall, go build, cargo check, npm run build, dotnet build, mvn compile)CTO
teststhe test suite passes (pytest, npm test, go test, cargo test, dotnet test, mvn test), with partial credit from its summaryCTO
coveragethe coverage report (coverage.xml, lcov.info, coverage.json, clover.xml, jacoco.xml) is at least a percentageCTO
auditno known vulnerability or security finding: pip-audit, bandit, npm audit, cargo audit, govulncheck, semgrep, trivy, checkovCTO
secretsno secret or private key in the written files: the built-in patterns always, gitleaks or detect-secrets when presentany
diffthe change stays within bounds: at most so many files and lines, every written file under the allowed pathsCTO
notebooka Jupyter notebook holds no error output and, with jupyter, executes end to endCTO
sqlevery SQL statement parses and, with a sqlite database, runs on a copy of it and returns rows within boundsCTO
measurea number a command prints (a benchmark, an evaluation score) is at least, at most or equal to the target, within the timeCTO
TypeWhat it measuresOffice
sectionsa document carries the required headings with a body, the front-matter fields, a pattern per sectionCMO, CXO, COO
claimsevery number, currency amount and record id in a document exists in its sources; labelled estimates are exemptCMO, CXO, CIO
financea yaml block prices every active office, keeps ceilings under a budget, states an ROI that matches the ledgerCFO
file_patterna file matches a pattern and not a forbidden oneany
sizeevery file matching a glob stays under a byte budget, gzipped if asked, with partial credit by how far overCTO, CMO
prosewords within bounds, sentences no longer than allowed, a reading grade at most, none of the forbidden phrases, no paragraph repeatedCMO, CXO, COO
spellingno misspelt word (codespell; cspell, hunspell or aspell when chosen)CMO, CXO, CTO
linksevery link resolves: a relative one to a file, an http(s) one answering under 400CMO, CTO
languagethe text is in the language expected and a translation's length stays in proportion to its sourceCMO, CXO
messageeach file is one post, subject line or reply that fits its channel: the character limit, the patterns required, no placeholderCMO, CXO
citationsevery [n] in the text has a reference and every reference is cited; every URL and DOI resolvesCXO, CIO, CMO
documenta PDF or office file as its reader opens it: the format, pages or slides within bounds, the text required, no formula error in a sheetCFO, CIO, COO
provenancethe 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 cleanCMO, CXO, COO
TypeWhat it measuresOffice
parseevery written file of a known format is well-formed: json, yaml, toml, xml, svg, csv, ini, py, ipynb, htmlany
schemaa JSON or YAML file validates against a JSON Schema; an OpenAPI document against the specificationCTO, COO
dataa table's shape: rows within bounds, the columns required, unique and not-null columns holding (csv, tsv, jsonl; xlsx, parquet)CFO, CXO, COO
json_pathvalues inside a JSON or YAML file: each path equals, matches or stays within boundsany
arithmeticthe numbers add up: every table's total row, percentages summing to 100, expressions over a yaml block's namesCFO, CIO
identifiersevery identifier of a kind is valid by its checksum or format: iban, isbn, ean, email, phone, uuid, date, url, currency, country, timezoneCFO, COO, CXO
TypeWhat it measuresOffice
uia Playwright audit of the built site against WCAG 2.2 AA, Core Web Vitals and tap targets, with partial credit per ruleCTO, CXO
htmla 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 requiredCTO, CMO
httpan endpoint answers with the status expected, within the time, the body matching the patterns, the JSON holding the valuesCTO
imagean image's facts: the format, width and height within bounds, the aspect ratio, the byte sizeCMO, CTO
mediaa video or audio file through ffprobe: the container, the duration within bounds, the resolutionCMO
TypeWhat it measuresOffice
hygienewritten text files are clean: UTF-8, one line ending, a final newline, no trailing whitespace, no conflict marker, no placeholderany
layoutthe deliverable's files exist: each required glob matches a file, each forbidden glob matches noneany
TypeWhat it measuresOffice
image_judgea 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 hookCMO

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

Checked on the host

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

Where the checks come from, and what holds the loop

the standard

Bars from the competition

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.

the scout

Checks proven on a spoiled copy

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.

acceptance on tickets

A ticket is done when its criteria pass

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 ratchet

Never worse than it found it

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.

In the genome

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"}}