How it works

How AI agent code verification works in Cotterpin

AI agent code verification means checking what an agent actually built, not what it says it built. Keep prompting the way you do now: Cotterpin hooks into your agent, and every time it says “done” Cotterpin runs a real build, the real tests your change reaches, and an adversary that tries to break the fix. Only work that survives lands.

Keep prompting the way you do now. Cotterpin checks every “done”.

It runs quietly in the background while you work with your agent — or on demand when you want a second opinion, a whole task handled, or an old codebase made trustworthy. Checking your work happens right on your branch; new work gets its own branch, worktree and pull request.

$ cotterpin initSets up this repo. Asks before it looks.
$ cotterpin connectFinds your agent CLIs. Stores no secret.
$ cotterpin doctorChecks your machine, with the exact fix.
$ cotterpin auditYour first report, in minutes.

Read the quickstart →

The same check in every stack

Each language pack knows the shortcuts its agents take and the defects they leave. Pick yours and watch a real task: the pack's guards refuse each shortcut with the reason and the fix, and at the commit its code gates find the defect the tests missed — often the real cause of the bug. Every refusal quotes the pack's own rule. Each session runs on the agent you already use (Claude Code, Codex or Grok), and Cotterpin's live header shows the task, the model and effort running it and each step, with today's summary on the line below.

Illustration, Java: asked to fix invoices that drop a repeated SKU, the agent first runs the whole test suite and is refused under java-unscoped-test; it then builds one Maven module with -pl but not -am and is refused under java-pl-without-am; with -am and one selected test it reproduces the bug. Its fix uses Collectors.toMap, and the commit is refused because the TOMAP-1 gate finds that toMap throws on the very duplicate SKU the fix is for. The agent adds a merge function, proves the test fails without the fix and passes with it, and the commit lands.
~/billing-service · Java pack
Illustration · example session

Only where you set it up

You install Cotterpin's adapter once for your machine, and your agent's hooks then run in every repository you open. Cotterpin answers only in a repository you set up with cotterpin init; everywhere else it says nothing and records nothing. Once a session has worked in a Cotterpin repository, its guards stay on even if the agent steps out of it.

Illustration: in a side project without Cotterpin, the agent's git commit with --no-verify goes through and Cotterpin says nothing. In a repository set up with Cotterpin, the same command is refused under git-hook-bypass. When the same session changes to /tmp and tries again on that repository, it is still refused.
one agent session · two repositories
Illustration · example session

Built to catch what other checks wave through

A verdict is only worth trusting if the thing giving it can't be talked round. These are the parts that make Cotterpin's verdicts hold.

Gates that can say no

Mechanical checks that block a change — not suggestions an agent can talk its way past. 157 for Java and 51 for any language, each born from a real failure. Only gates with a zero-false-positive record block from install; the rest advise until they earn it.

An adversarial refuter

A second agent whose only job is to break the fix: races, retries, edge cases. If it can, the work goes back.

Receipts bound to their inputs

Every verdict is backed by a receipt bound to the exact inputs it checked. Change an input and the proof is re-run — never reused.

Every agent action, risk-tiered

Each tool call is read, low-risk write, sensitive or destructive. Destructive ones — git reset --hard, --no-verify, an agent editing its own settings — wait for your approval, confirmed with your account password — or Touch ID, on a Mac where Touch ID is enabled for sudo. Every decision lands in an action audit log.

Credentials never reach the agent

An agent can't read .env, cloud credentials or the environment into its context — judged by effect, not by a list of programs — and everything Cotterpin prints passes through one redactor.

Memory that's enforced

cotterpin memory keeps facts per user, repository and task, with provenance. A fact moves to a wider scope only with a person's signed approval, and every rule memory names the hook or gate that enforces it — memory audit checks it's really wired.

Delta-only, and fast

Only the tests your change can reach are re-run. The agent hook, cotterpin --version and the commit tier are held to measured speed budgets — no more than 10% over baseline on any measured path, or the release doesn't ship.

Local-first

Cotterpin never receives your source, diffs or prompts. Only your chosen model provider sees your code, under your own account.

One harness, any agent

Adapters for Antigravity,Claude, Codex and Grok: cotterpin adapters install antigravity|claude|codex|grok, once per machine, in the tool's own folder — nothing is added to your repositories. Same guard rules for all four, so you can switch agents without rewriting your rules.

A gate earns the right to block

A check that cries wolf gets switched off, so Cotterpin is careful about what it blocks.

Illustration: a commit labelled as a fix is refused because no test proves it; the refusal names the check, why it exists, the fix and the exact command; the developer records the red and green proof and the commit then passes its checks in seconds.
~/payments-service
Illustration · example output

Watch your agent work, live

Above your prompt, Cotterpin shows what your agent is doing right now: the task, how many steps it has taken, the tool it is using and the model and effort running it. When it runs several things at once, each tool or sub-agent gets its own row with its model, how long it has run and a bar against how long that tool usually takes on your machine. You can see at a glance whether it is thinking, testing or stuck.

Illustration: the run band above the prompt. The top line reads IMPLEMENT, the step count, the tool in use and its model, and the elapsed time. While a test run and a sub-agent on a smaller model run at once, two rows appear under it, each with its model, its time and a progress bar; when they finish the line goes back to thinking.
Claude Code · above the prompt
Illustration · example session

Every week, a report of what Cotterpin caught and saved.

Good protection is invisible — the bug that never shipped looks exactly like a quiet day. So Cotterpin shows its work. At the end of every agent turn it tells the session what it caught, and every week it adds it up: the runs that landed, what it refused, and what model routing saved, in tokens on your plan and in dollars at API prices. cotterpin report measures the whole system — Antigravity,Claude, Codex and Grok alike. On Pro, that's everything it stopped. On the free Watch plan, it's everything that slipped through while it was only watching.

  • Measured, not guessed. Every number comes from the trajectory: one redacted line per decision Cotterpin made, kept inside your repository's git folder.
  • Prices are never guessed. Cost per landed change uses the prices you set; token counts are read from your agents' logs only if you say yes.
  • Computed on your machine. The report is local; nothing is uploaded or sent to us.
every Monday · example
Cotterpin · your week · 29 Sep – 5 Oct  Runs       64  58 landed  6 waited for you
  Agent time 15h 20m
  Time Cotterpin added 2m 41s (0.3% of agent time)
  Cotterpin fired 1,412×  ✗ 87 refused, 5 destructive

  Cost       $117.80  baseline $195.24
  Saved      $77.44 this week  ▲ $9.10  at API prices
  Tokens     +66% extra tokens on your plan (≈ $132 of a $200 plan)
  On track   ≈ $335 / month · ≈ $4,000 / year
  Pro ($100/year) would pay for itself in under 2 days

  You        ◆ Scout Bug Hunter grade 1 of 7
  Plan       Watch  free (reports what Pro would enforce)
  Bugs       4 reported  3 verified  1 pending
  Rewards    14 points  1 free month earned

  Details    cotterpin report weekly

Coming in the next release The weekly card from Time and money saved.

Always getting stronger, on your terms

Every gate exists because a real agent failure slipped past everything else. When we find a new one, we ship a gate for it — and whole new language packs as they land. You decide when each one reaches your code.

  • Nothing installs itself. cotterpin update --fetch downloads the newest signed release your licence covers — after asking — and nothing is uploaded.
  • Your repository moves only when you say so — with cotterpin upgrade, which shows the plan first and writes nothing until you add --apply.
  • Never mid-run. An update refuses while a Cotterpin run is in progress in the repository.
  • Pro gets new packs first — the day they ship. Watch follows 60 days later.
  • Signed and verified on your machine before anything runs — and cotterpin update --rollback undoes the last update.
Example: Cotterpin asks before contacting the licence service, downloads a newer signed release, verifies its signature and every file, and keeps it in the local release cache without changing any repository. The repository moves to it only when the developer runs cotterpin upgrade.
~/payments-service

Questions people ask

How does Cotterpin check that an AI agent's work is done?

It runs the repository's own build and the tests the change reaches, and its gates, before the commit lands, and keeps a receipt bound to the exact inputs it checked. A second agent then tries to break the fix; if it can, the work goes back.

What happens when Cotterpin refuses an agent's action?

The action does not run. The agent is told which rule refused it and how to fix the cause, and a destructive action waits for you to allow it, which the agent cannot do for itself.

Can I see what my agent is doing while it works?

Yes. Above the prompt Cotterpin shows the task, the tool and model in use and the elapsed time, and a row with a progress bar for each tool or sub-agent running at the same time.

See it in action.

Free, with no time limit. No credit card required.