The pain
“Done” stopped meaning done
Code nothing calls. Tests that only agree with themselves. Fixes that break under a retry. All green, all reported finished.
Why AI-generated code fails →Your agent ran the suite, saw green, and told you it was finished. It wasn't. Cotterpin is guardrails for AI coding agents: it checks every “done” on your machine, before the commit, so AI slop never reaches your code base — or your users.
$ pipx install cotterpinfrom 0.3.0
No credit card required Runs on your machine
A developer asks Cotterpin to fix customers being charged twice when the payment provider retries a webhook. Cotterpin analyses the code, writes a test that reproduces the bug, lets the agent fix it, validates the build and tests, then sends an adversary to break the fix. The adversary finds a race condition, the agent fixes it again, the fix survives, a receipt is signed, and the branch is pushed with a pull request opened for review.
Shift left
Agentic coding is a new way of working. CI and code review sit after the commit, once a problem has left the developer's machine. Cotterpin moves quality and security as close to the developer as they can go — into the agent session itself — so only checked work enters your code base. Why it matters.
The pain
Code nothing calls. Tests that only agree with themselves. Fixes that break under a retry. All green, all reported finished.
Why AI-generated code fails →Trust
Real builds, the real tests your change reaches, an adversary that attacks the fix, and receipts bound to the exact inputs they checked.
How it works →Time and money
Review a verdict with evidence, not every diff. Delta-only checks, a light hook, and a plain price — measured on your own code.
Time and money saved →Security
No Cotterpin cloud sees your source. Destructive agent actions wait for your approval, signed by a key only root can read.
Security →Speed
Only the tests your change reaches run, a test already proven on the same inputs is reused, and every stage has a time budget it is held to. A commit's checks take seconds.
Cost
A model and effort matrix gives each task the model it needs, not the strongest one: a search runs on a fast model, a hard fix on the strongest. On a monthly plan the same limit holds more work.
Tuning
Every request's planned model is recorded against what actually ran, and every route run gets a speed review, so the balance between cost and quality is tuned on measurements, never guesses.
Resilience
When a run stops, Cotterpin matches the failure against a shared pool of healing skills and applies the fix within safe bounds. Every new failure becomes a skill, so the same stop never happens twice.
Memory
What your agents learn about the codebase is kept as a knowledge bundle in the repository itself: plain files your team reviews and commits. Every session starts from it, so nobody pastes the same context twice.
Parallel
Cotterpin measures your machine's cores and memory and runs as much work side by side as it can hold, each task in its own isolated worktree, and backs off when memory runs short, so your laptop stays usable.
cotterpin --uninstall removes it.Cotterpin is guardrails for AI coding agents. It checks every “done” your agent claims, on your machine and before the commit, with real builds, tests and gates, so unverified AI-generated code never lands in your code base.
No. It works inside the agent you already use (Antigravity, Claude, Codex and Grok) through the agent's own hooks, and you keep prompting the way you do now.
No. Cotterpin runs on your machine and never receives your source, diffs or prompts. Only your own model provider sees your code, under your own account.
Yes, to start. Watch is free with no time limit: it reports what every gate would catch and never blocks. Pro and Team enforce the gates; prices are on the pricing page.
Free, with no time limit. No credit card required.
$ pipx install cotterpinfrom 0.3.0