Repository navigation
Releases
Herd 0.18.0
Version 0.18.0 is the v0.15.0 plugin plus the 0.16.1 and 0.16.2 guard fixes.
Why, as given in issue #221: v0.15.0 scored 9 of 9 fully correct runs (48.0 of 48 stores, 6 of 6 bad inputs, $0.50), and every later version scored lower in quality. The published table in examples/supermarket-route/BENCHMARK.md covers 6 runs of v0.15.0 ($0.48 per run) and no later version.
Removed
Herd 0.17.0
Limits the designer adds to a valid input now have a place in task.toml, and every one shows in the report under "Limits the design adds", with its quote when it has one (issue #216).
- Added: a top-level
narrowingslist in task.toml. Each entry is a table withlimitand an optionalquote, which must be a literal substring of the stored request.narrowings = []says there are none. A quote that is not in the request, a missing key, a bad shape or an unknown key failsherd check, which names the entry. The quick route needs no list, but a present one is checked. - Added:
herd verifyrecords the same problems as warnings, and every narrowing asassumptions: the limit, then its quote, marked as in the request or as not in your request.evidence.mdand the PR description show a "Limits the design adds" section above the results when there are any, listing every narrowing, quoted or not. - Changed: the designer brief and the criteria skill ask for the
narrowingslist. - Added:
evidence.mdand the PR description show a "Hand-solved cases" section right after the limits: every case's name, input and expected output in code blocks, each cut to its first 40 lines with a line saying how many were left out. In a benchmark run the frozen case had one line per pick while the request asks for a step-by-step simulation, and nothing showed it to the human. - Changed: that section replaces the single "Hand case" (20 lines) near the end of both texts; the list of case names and hashes stays.
- Known limits: Herd cannot tell whether the list is complete: a designer can still leave a limit out.
herd donedoes not refuse a missing key; onlyherd checkfails, andherd verifywarns. A quote must match the request byte for byte. The quote check only proves the quote text is in the request, not that it allows the limit, so the human judges every limit in the section. Long single lines are not cut, and many large cases could exceed GitHub's PR body limit.
Herd 0.16.2
An interactive terminal omits run_in_background on an Agent call, so the guard denied every Herd designer and builder spawn (issue #213).
- Fixed: the guard allows a Herd subagent spawn that omits
run_in_background, except in headless (CLAUDE_CODE_ENTRYPOINT=sdk-cli) sessions, which offer the parameter.falseis allowed andtrueis denied everywhere. Spike S7 (Claude Code 2.1.332,docs/spikes/s7-interactive-spawn.md) showed that the interactive default runs the spawn in the background, and thatCLAUDE_CODE_FORK_SUBAGENT=0runs it in the foreground. Afalsesent when the tool does not offer the parameter does not change that. - Changed: the Stop gate allows the stop and writes nothing while a Herd subagent is
runningin the Stop input'sbackground_tasks, with or without a task, so the session waits for it. - Changed: the run skill's spawn lines and the agent descriptions say to pass
run_in_background: false. When the Agent tool offers no such parameter, they say to spawn, end the turn and wait for the completion notification. - Changed: the run skill's word budget rose from 1060 to 1080 for this rule.
- Known limits: observed on Claude Code 2.1.332 only. While a Herd subagent runs in the background, every stop of that session is allowed. A session that is not
sdk-cliand offers the parameter but omits it is allowed in the background.
Herd 0.16.1
A first run showed a guard denial for Herd's own designer or builder spawn, because the run skill said "in the foreground" without naming the parameter, and an omitted run_in_background means background (issue #199).
- Fixed: the run skill's two spawn lines and the designer and builder agent descriptions say to call the Agent tool with
run_in_background: false. The guard still denies an omitted value andtrue, because omitted means background. - Fixed: a denied Herd agent call that the session retries in the foreground is noted as
Agent: recovered background <kind>, one per allowed retry. The final report lists it asrecovered, for exampleGuard: 1 recovered (background herd:herd-designer x1), and a denial that was not retried staysdenied. The raw guard notes keep both. - Known limits: Herd cannot force the model to pass the value; the text asks for it.
recoveredmeans the retry was allowed, not that it succeeded. The guard still denies an omitted value because omitted means background. - Measured: one headless run on 2026-11-29 (Claude Code 2.1.332, Haiku, 0.16.1 loaded with
--plugin-dir, the README's example request on a three-row fixture): the one designer call passedrun_in_background: false,permission_denialswas empty, no guard note; $0.15, 99 s. One run, and the builder was not spawned (the session model matchedbuild).
Herd 0.16.0
A pull request was opt-in, so a finished GitHub task usually ended with no PR. herd pr now opens the evidence PR by default (issue #202).
- Changed:
herd propens the PR unlessherd.tomlhas[pr] open = false. With no GitHuborigin, or noghon PATH, it prints one line (no pull request: ... (set [pr] open = false to silence this)), exits 0 and pushes nothing.herd donenames the same reason in itsProven:line and inevidence.md. - Changed:
herd doneand the Stop gate ask for a commit only where a PR is on and can open, so a local-only repository finishes uncommitted as before.[pr] open = trueand--yesstill fail as before when there is no remote or nogh. - Changed: a broken
herd.toml, a non-booleanopenor a non-tableprcounts as off, andherd prwithout--yesrefuses it, namingherd.toml, since a push cannot be undone. A missing file is the default. - Changed: the README Quickstart states the requirements on their own line: Claude Code, Python 3.11+ as
python3, a git repository, and for the pull request a GitHub remote andgh. - Changed:
herd initoutside a git repository refuses with one line, exit 1, and creates nothing. It used to create the task. - Changed: the README first screen and Quickstart say the pull request is the default;
[pr] open = falseturns it off. - Known limits: GitHub means
origin's host is exactlygithub.comorssh.github.com(https, http, ssh or git URL, or scp form; any letter case;insteadOfexpanded). GitHub Enterprise hosts and SSH host aliases skip by default:[pr] open = truepushes to them. Onlyorigin's fetch URL is read.ghthat is present but not logged in still fails atherd pr. Tested with a fakeghand a bare repository, not against real GitHub. This repository's ownherd.tomlstill has a comment that saysherd pris off by default; a human edits it.
Herd 0.15.0
The designer's hand-solved cases bind the builder: herd verify runs the program on each case and compares the whole output, so a coarser or narrower reading fails a check the builder cannot rewrite (issue #190).
- Added:
owned/casesin the task folder:<name>.inand<name>.outpairs, written by the designer before any code.herd note --tried --attack other-reading --example "prog {in}" --cases <folder>runs the program once per case, by name, and compares the whole stdout line by line (trailing blank lines and line ends aside). The first failing case is the fault, with its input and both outputs. - Added: the owned folder and the other-reading note are frozen at the first
herd verify(owned.json). A change fails the attack, the guard denies writes to the folder, and a line added since the start that names the owned cases fails verify.herd note --owned-changed "<reason>"re-freezes at the next full verify, and the report shows the reason first under "Changed after red". At high risk the human's own message must state the reason beforeherd donepasses. - Changed: on the standard route, tasks at medium and high risk need
--casesfor the other-reading attack;--expectstays for low risk and for tasks started before this version.--casesand--expectcannot be logged together. - Changed: the skills (adversarial, run, designer) say to write the cases before any code. No
TestBudgetsword budget changed. - Known limits: the reach check reads text lines only (not
.md,.rst,.txt, or binary files), so an encoded path is not seen. The guard sees only the writes it detects. Generated cases from a reference (issue #191) are not built. The hand answers are the designer's claim, shown in the report. At high risk the confirmation is read from the session logsherd initandherd reopenrecorded: an agent that reopens the task from its ownclaude -psession could state the reason itself. Not tried in a live session.
Also in this release: 0.14.14 (never released on its own)
A check, attack command, --refuses or --example that was only printf ... counted as evidence, while the same command with echo was refused as running no project code (issue #173).
- Fixed:
printfis vacuous likeechoforherd check,herd verify,herd noteandherd done. As withecho, a--refusesor--examplecommand that pipes into a program (printf 'milk\n' | python3 prog.py) still counts. - Changed: the test fixtures that used
printfas a passing attack command now runexprandls. - Fixed: a check made of
echoorprintffollowed by real code (printf x && python3 -m unittest,echo start; pytest,echo a || make test) counted as running no project code, because the shape list matched everything afterecho. Now every command of a chain (split on&&,||,;,|,&and newlines outside quotes) must betrue,:,exit N, echo, printf ortest -f/-e PATH, and a$(...)or backtick outside single quotes always runs a command.exit Njoinsexit 0soecho no >&2; exit 1stays vacuous. The--refuses/--examplepipe exception is unchanged. - Known limits: the rule is a short list of command shapes:
sh -c 'printf ok'orcat fileruns no project code and is not refused. Not tried in a live session. - Known limits: an escaped
\$(is still read as a substitution;sh -c '...'and scripts are not looked into. Not tried in a live session.
The attack lines in herd verify and evidence.md joined an attack's check and its --refuses or --example command into one string, python3 -m unittest t.BadInput --refuses python3 -m textutil, so a reader could not copy either command on its own (issue #142).
- Changed: each part of an attack is a labelled field.
herd verifyprintsattack bad-input failing: check python3 -m unittest t.BadInput; refuses python3 -m textutil: exit 0, needs 1 to 125, with why a part failed after that part.evidence.mdand the PR body printbad-input passing (check `python3 -m unittest t.BadInput`, refuses `python3 -m textutil`), each command in its own backticks.--exampleand--expectshow asexampleandexpectfields the same way. - Changed: a
--covered-byattack showscovered by C1, plain text, since a criterion id is not a command. A collision--refuses "n/a: <reason>"shows its reason without backticks. - Known limits: output format only; no benchmark leg was run. The wiki page Example.md still shows the old format: refreshing it needs a new paid run.
Red first, the herd verify before any code, exited 1 when it went as planned: every check failing is the expected result, but the agent and the demo GIF (#116) saw "Error: Exit code 1" (issue #118).
- Added:
herd verify --redexits 0 and prints "N of N criteria failing, as expected before the build" when every criterion with a check fails. It exits 1 with "red first not met: C1 already passes" (or "C1 ran zero tests", or "no criterion has a check") otherwise. Attack results do not change its exit code: attacks may fail before the code too. Without--red,herd verifyexits as before. - Changed: the run skill (step 4), the quick route and
herd-designerrunherd verify --redand drop the "checks must fail, tighten it" text, which the exit code now enforces. - Fixed:
herd verify --redexited 0 with "N of N criteria failing, as expected before the build" even when code existed before the first verify. It now exits 1 with "red first not met: code already existed before the first verify: ". - Fixed:
herd verify --only <id> --redignored--red, andherd verify --red --only <id>took--redas the slug. Both orders are now refused with one line and exit 1. - Known limits: for a failing check, "ran zero tests" is read from the stored output tail only. Not tried in a live session.
The guard allowed (cd sub); git push, x=$(date); git push --force, x="$(echo ")"; git push)", git clean --f, git clean --fo and chmod -w .herd/active during a task. Mutation testing found it (issue #178, part of #157).
- Fixed: an operator glued to a parenthesis (
);,)&&,)|) splits the command, as;alone did:shlexreturns it as one token.<(and>((process substitution) start a new command too. - Fixed: the body of a
$(...)is found by a scan that skips quotes and nested parentheses, so a quoted)no longer ends it. An unclosed$(is checked to the end of the line. - Fixed: a long flag of 3 or more characters counts as a prefix, so
--fand--fomatch--force, as git takes them. An ambiguous prefix is denied too; git refuses it anyway. - Fixed: chmod's mode is the first word after chmod's own options (
-R,-f,-v, ...), so a mode such as-wora-wno longer hides the path. With--reference=FILEevery other word is a path. - Known limits: the guard still reads command text only:
bash -c,eval, scripts and aliases pass (a Non-Goal of the guardrails design). A$(...)inside single quotes is checked as if it ran, so it can over-deny. Acasepattern's unmatched)inside$(...)ends the body early. Not tried in a live session.
After herd cancel, herd init recorded the cancelled task's unpushed branch as the PR base, and trusted a base that no longer existed (issue #184).
- Fixed:
herd initafterherd cancelrecorded the cancelled task's unpushed branchherd/<slug>as the PR base, soherd prfailed with "Base ref must be a branch" (issue #184). A task cut from an unpushedherd/<slug>branch now takes the base that task recorded (main, or the upstream name of the #148 case); a pushedherd/<slug>branch stays the base. - Fixed:
herd inittrusted the base a cancelled task recorded even when that branch no longer existed, and crashed on an unreadablebasefile. A base that is neither a local nor a remote-tracking branch, or that cannot be read, is ignored and the upstream rule decides.
A /herd:run handed to a subagent: a report said the guard denied a foreground herd:herd-designer call (issue #181).
- Fixed: a
/herd:runhanded to a subagent is now recorded and its denial says what it received. Spike S6 (Claude Code 2.1.332,docs/spikes/s6-subagent-agent-call.md) recorded the PreToolUse input of a foregroundherd:herd-designercall from a subagent: it carriesrun_in_background: falseplusagent_idandagent_type, and the guard allows it. The denial reported in #181 did not reproduce, so the guard's decision is unchanged. A denial now says what it received (received \run_in_background: true`orreceived no `run_in_background`), and the run skill anddocs/how-it-works.mdname the proven route for an orchestrating agent: a headlessclaude -p "/herd:run ..."session in the project. Not proven: a nested/herd:runending in a passingherd done`.
Mutation testing of the rule-enforcing code (issue #157). A green suite shows the tests pass, not that they would fail on a bug.
- Added:
tests/mutate.py GROUP(gate, guard, done, verify, triage) runs mutmut 3.9.0 throughuvx, so nothing is added to the project and the standard-library rule holds. It mutates one group's functions in a copy of the repository and prints each surviving mutant at its source line. Not in CI: a group takes 1 to 30 minutes, and verify takes longer, so it is sampled. How to run it and the scope:docs/how-it-works.md, "Mutation testing". - Added: tests for the survivors in gate (
tests/test_gate_mutants.py), guard (tests/test_guard_mutants.py), done (tests/test_done_mutants.py) and triage (tests/test_herd_triage.py). Before, no test covered the guard's session-log rule, and most of the Stop gate's andherd done's messages were not checked word for word. - Found: the guard allows
(cd sub); git push,x=$(date); git push --force, agit pushinside a...
Latest Stable
What's Changed
- herd init records the upstream of an unpushed start branch as the PR base by @tonialmagro-tomtom in #148
Full Changelog: v0.14.12...0.14.13
What's Changed
- herd init records the upstream of an unpushed start branch as the PR base by @tonialmagro-tomtom in #148
Full Changelog: v0.14.12...v0.14.13
Herd 0.14.12
A new /herd:run session that continued a task finished in an earlier session (to merge the base branch or fix review comments on its PR) was blocked at 3 stops with "no Herd task was started": start.json named only the session that ran herd init, and there was no way to take the task up again (issue #145).
- Changed:
herd reopen <slug>makes a finished task in this checkout active again.start.jsonkeeps thesessionthat ranherd initand adds the session the pre-init hook last saw run a herd command here to asessionslist. The block counters (gate_blocks,done_blocks) are reset. - Changed: the Stop gate (with or without an active task) and the design hook count a session in
sessionsas the task's, like theinitsession. - Changed: a reopened task must pass
herd doneagain. The evidence is tied to the work by its content id, so an edit after the reopen makes it stale untilherd verifyruns. Sincestart.jsonchanged, the nextherd verifyruns every check instead of skipping an unchanged tree. - Changed:
herd reopenrefuses a cancelled task, a task that does not exist, a task whosestart.jsonis missing or unreadable, and any reopen while another task is active in the checkout. - Changed: the run skill tells an agent continuing a finished task to run
herd reopen <slug>instead ofherd init. - Known limits: without the pre-init hook (such as in a terminal) no session is recorded, and the task is active but its gate may not block the new session. A session that continues a finished task without
herd reopenis still blocked as before. Not tried in a live session.
Herd 0.14.11
The 0.14.10 Stop gate blocked a finished task. In the 0.14.10 benchmark, 1 of 3 Haiku runs ran herd init as H=.../herd.py; python3 "$H" init ... and passed herd done, and the gate then blocked 3 stops with "no Herd task was started": the command check only knows a literal herd.py init.
- Fixed: with no active task, the gate also reads
.herd/tasks/*/start.json. A task whose recorded session is this session's log counts as an init, however the command was written. The command check stays for a task folder that is gone.
Herd 0.14.10
A session started with /herd:run could skip Herd entirely: with no active task the Stop gate allowed every stop. In field use, 1 of 36 sessions (Haiku, a docs-only request) ran herd status, edited 3 files and opened a pull request with no .herd/tasks folder; the rerun on Sonnet cost $0.43 instead of $0.01 (issue #124, part of #121).
- Changed: with no active task,
herd gatereads the hook'stranscript_path. It blocks the stop when the log has a/herd:runmessage with arguments (the parserherd initalready uses), an Edit, Write, MultiEdit or NotebookEdit call (also in subagent logs), and no Bash command that ranherd.py init(in the session's log or its subagents' logs, since the designer subagent runs it). The reason says to runherd init <slug> "<goal>". - Changed: the same
MAX_BLOCKS(3) circuit breaker applies, per session log. The count and the release are recorded inherd-noinit.jsonin the checkout's git dir, never in the work tree. - Changed: sessions without a
/herd:runmessage, without an edit, or that ranherd init(a task done or cancelled since) stop freely, as before. A missing or unreadable log allows the stop. - Fixed: a non-object item in a log message's content (a string, a number or null) no longer crashes the preinit hook or the Stop gate while they look for edits.
- Known limits: edits made through Bash (
sed,cat >) are not seen, so a session that edits only that way still stops freely. A failedherd initcommand counts as run.herd cancelneeds a task, so a session whose human dropped the request is released only after 3 blocks. Not tried in a live session.