Repository navigation
v2.7.0: real payloads, a working agy breaker, Codex 6.x pins
After updating, do this. On Codex, run python3 scripts/setup-codex.py, because the models live in the role files: without it, children stay on the old models and doctor warns. Then open Codex once, accept the hook review, and run python3 scripts/mitosis-doctor.py. On Claude Code, start a new session.
Behaviour changes
- Codex default pins changed: worker
gpt-5.6-terratogpt-6.1-terra, scoutgpt-5.6-lunatogpt-6-luna. No comparison was made, so no quality or cost claim is made. To go back, runCODEX_MITOSIS_WORKER_MODEL=gpt-5.6-terra CODEX_MITOSIS_SCOUT_MODEL=gpt-5.6-luna python3 scripts/setup-codex.pyand keep both variables exported for Codex. - agy: the circuit breaker now works, and advises by default. It counts across the user turn and adds one note per turn.
*_MITOSIS_CIRCUIT_BREAKER_MODE=enforcedenies after 2 failures in a row until the next turn, andoffdisables it.*_MITOSIS_CIRCUIT_BREAKER=0still means off. The variable with the current platform's prefix applies, soCLAUDE_MITOSIS_CIRCUIT_BREAKER_MODEhas no effect on agy. *_MITOSIS_CIRCUIT_BREAKER=0and modeenforceon Claude Code and Codex: nothing changes in practice. The breaker has never counted a real failure on these two platforms, because their payloads carry no field it reads. Earlier documents implied otherwise.CODEX_MITOSIS_AUTO_ALLOW=1: a command whose working directory is outside the directory the turn started in is now denied. A false denial is gone: from a subfolder,cat ../README.mdinside the repo no longer counts as an escape.*_MITOSIS_AUTO_ALLOW=1on Claude Code and agy asks in more cases: a directory change combined with.., acdwith no target,cd -, a target with$or a backtick,popd,chdirand-C ... It may ask needlessly. On Codex these give no verdict rather than a denial.- Codex
pin_verifiedalso compares effort, so it can now say that a child looks inherited, and it stays unset when the primary already matches the pin exactly and the two cannot be told apart. A primary on another model gets no new mismatch. - The Claude hooks file is now
hooks/claude-hooks.json, declared in.claude-plugin/plugin.json.
Added
- Real hook payloads as test fixtures, in
tests/fixtures/payloads/, sanitized byscripts/sanitize-payloads.pyand replayed through the handlers on real counters.tests/test_fixture_privacy.pyscans them.scripts/payload-shape.py diffshows added, removed and retyped keys between two CLI versions.CONTRIBUTING.mdhas the steps. Reason: 2.6 found two edit budgets whose fake-payload tests passed while the real count was 0. MITOSIS_CAPTURE_PAYLOADS=<absolute dir>, off by default, records raw hook payloads for that flow. The file holds your prompts and paths: seeSECURITY.md.- Doctor rows
codex.worker_same_as_primary(info) andcodex.pinned_models(a warning when Codex's own model list does not contain a pinned model). When a CLI is newer than the verified one, the info row names the fixtures to compare with, and the exit code stays as it was. - Heartbeat counter
breaker: advised, denied, neutral. evals/builtin-pin/: a sealed experiment onCLAUDE_MITOSIS_PIN_BUILTINS(see below).
Fixed
- agy: the breaker could never fire. It was reset at every model call, and agy 1.5.0 sends
error: ""and no result for a command that exits non-zero, so it never saw a failed command at all. The exit code is now read from the transcript at the next model call, which is when the step is written. A read-only command that exits 0 or 1, acd x && grepwith no match and predicates such astest -fneither count nor clear the streak, and neither does a subagent call. Hooks do not run inside agy subagents, so a worker's own test loop is not counted. - Codex: the hook's
cwdis the command's working directory, not the turn's. Aworkdir=/etccounted as inside the workspace, and a/worktrees/workdir made the primary look like a subagent and skip its checks. Roots and the primary check now use the turn's directory fromUserPromptSubmit. agy plugin validate --strictpasses. It warned thathooks/hooks.jsonis never loaded.- Doctor: a relative
--rootfailed every offline probe; a malformed model cache or an oversized manifest value could crash it. - Corrected a code comment that claimed
permissionOverridessatisfy agy's headless permission check (see below).
Found, not fixable here
- agy 1.5.0 print mode ignores a hook's
permissionOverrides. Awrite_filein a home folder is denied with the exact rule sent, under decisionallowand underask, while the same rule in--settingsworks.**,*and a barewrite_filedo not match.--mode accept-editsworks everywhere tested. A real path under/tmpwrites without either;/var/tmpand/dev/shmdo not. 14 runs plus 1. Interactive mode was not tested. *_MITOSIS_AUTO_ALLOWis a convenience that reads command text, not a security boundary. Shell syntax such ascat ../"../x", brace expansion, globs and symlinks can still get past it.
Measured: pinning the built-in Explore agent
CLAUDE_MITOSIS_PIN_BUILTINS=1(Explore on haiku at low effort) against Explore inheriting opus at medium, on 36 sealed lookup runs: 90 of 90 correct in both arms, median 0.2162 against 0.4213 USD per run, 51.3%, cheaper in 18 of 18 pairs, none invalid. Outcome under the sealed rule: SUPPORTED.- Read the limits in
evals/builtin-pin/RESULTS.md. Both arms hit the ceiling, so the questions could not show a quality difference. The prompt forces one Explore call in every run, so a real session saves less. The default stays off, as fixed before the runs.
Not changed
routing.pyis unchanged, so no new routing holdout was written.- agy's
lastUserInput,terminationBehavior,errorMessageand Codex'sSubagentStart,PreCompact,PostCompact,PermissionRequestare not used: none of them fixes a real problem here.
Verification
- See the release notes for live runs on each CLI. Breaker on real agy 1.5.0: advice once, denial on the third step in enforce, no count for
grepexit 1, no clearing by a subagent, reset on a new turn. New Claude hooks file on Claude Code 2.1.318: each event fired once, withCLAUDE_PLUGIN_ROOTset. - White-box review with reproduced probes before release. The oracle and census were not rerun locally, and
guards.pyscout rules did not change.
Live runs on the release commit
Run on 754624d after accepting the hook review. Doctor showed codex.trust.bundle as OK before these runs.
| CLI | What ran | Result |
|---|---|---|
Codex 0.166.0, primary gpt-6.1-terra high |
Worker and explorer spawned | Child's own turn_context: (gpt-6.1-terra, medium) and (gpt-6-luna, low). Both pin_verified: true and report_ok: true. The worker wrote its file |
Codex 0.166.0, CODEX_MITOSIS_AUTO_ALLOW=1 |
Workdir /etc, then sub with cat ../README.md, then sub with cat ../../outside.txt |
Denied, no verdict, denied |
| Codex 0.166.0 | Explorer told to run touch |
Denied at the child's PreToolUse, and no file was created |
| agy 1.5.0 | Breaker: advise, enforce, grep and cd sub && grep exit 1 three times, failure then subagent then failure |
Counter 2 with one note; third step denied; counter 0 twice; counter 2, so the subagent did not clear it |
| Claude Code 2.1.318 | Marketplace install with the renamed hooks file | One session-start, pre-tool-use and post-tool-use for a single Bash call |
Not run: an account without 6.x access, so that path has only the doctor row and the rollback text. Whether a gpt-6-luna scout can spawn further agents was not tested. pin_verified stays unset when the primary already equals the pin at the same effort, which was not run live. Strict rules under a real Codex session with pwsh were not run. Oracle and PowerShell harnesses ran on GitHub runners only.