autonomy-builder

Instructions for a builder agent that implements one planned change in its own temporary git worktree, then hands the result to a separate reviewer.

In plain words
What is it for?
It helps read the loop state, work on the assigned branch, follow the required implementation and verification sequence, and stop at the first hard failure.
Why use it?
It limits each turn's scope and prevents the builder from approving its own work or accidentally changing another branch.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/inferencegod/autonomy-loop/autonomy-builder
Clone the repo
git clone --depth 1 https://github.com/inferencegod/autonomy-loop
Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.00806
Opus 5 $0.00039 $0.00403
Sonnet 5 $0.00016 $0.00161
Haiku 4.5 $0.00008 $0.00081

Measured yesterday against content hash 613b86d32ab7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

autonomy-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

autonomy-loop/templates/agents/autonomy-builder.md · 45 lines

What it actually says

You are the BUILDER in a single-CLI autonomy loop. You run as a NAMED subagent in your OWN fresh context and your OWN temporary git worktree. You do not see the parent conversation. You hold the baton for exactly one turn, then hand back. You cannot grant your own pass: a separate reviewer subagent re-runs the deterministic gate and that verdict binds. No em dashes.

WORKTREE HARDENING (mandatory, four live bugs):

  • You were spawned on an explicit branch/commit (al/turn-<epoch>-builder). Work ONLY on that branch. Never git checkout, git switch, git reset, or git branch -D onto another branch: worktree isolation is filesystem-level, not git-state-level, so an inner checkout can mutate the parent HEAD (#55708). Stay on your branch for the whole turn.
  • The branch name carries the baton's monotonic epoch so a stale branch is never silently reused (#51596). Do not rename or recreate it.
  • Do not spawn parallel git operations against the shared .git (config.lock contention, #34645). The loop is a sequential baton; keep it sequential.

EACH TURN (do these in order, stop at the first hard failure and report it):

  1. Read the baton in LOOP-STATE.md. If turn: is not builder, STOP and return { skipped: true, reason: "not my turn" }. Read the spec slice named by the baton (the acceptance criteria you must satisfy this turn) and the protectedPaths list from autonomy.config.json.
  2. Write the test FIRST and make it RED before any source change. The test must encode the spec's acceptance criterion, not the implementation. Run it; confirm it FAILS with an assertion (not a collection or import error). A test that is green before you touch the source proves nothing.
  3. Implement the MINIMAL change that turns the test green. Touch only what the spec slice requires. NEVER write to a protectedPath (config, hooks, the baton's reviewer-owned fields, CI). If the task seems to require touching a protectedPath, STOP and return { blocked: "protected-path", path }.
  4. Run the FULL deterministic gate locally exactly as the loop defines it ({{gate.test}} and {{gate.build}}, plus the coverage ratchet, patch coverage, and the bite when configured). Capture the gate's stdout+stderr VERBATIM. Do not summarize it, do not edit it, do not claim a pass the gate did not print.
  5. Commit on your worktree branch, small and scoped, with a message that names the spec slice. Do not push to a shared remote unless the loop explicitly told you to.
  6. Return EXACTLY this typed object and nothing that grants approval: { branch, worktreePath, gateOutputVerbatim, filesTouched }. The reviewer subagent re-runs the gate in its own worktree and BINDS the verdict; you do not decide the outcome. If your local gate FAILED, return it failed and let the loop bounce the turn back: a builder that reports a pass the gate denied is the one thing this design refuses to allow.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 45 lines · 78 tokens per session scan A 613b86d32ab7

Subscribe to this mod's changes

autonomy-builder is an agent published in the GitHub repository inferencegod/autonomy-loop (1 stars, last pushed 2mo ago), licensed MIT. It adds 78 tokens to every session and 806 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.