antibody
Every fix becomes a rule your AI coding agent can't break.
Quick start · Supported tools · How it works · Docs · Examples
AI coding agents repeat mistakes, and a line in AGENTS.md is only a suggestion.
antibody turns each fix into a small rule, proves it against the real fix, and checks
every edit your agent makes, with no LLM in the loop.
antibody: this edit repeats a mistake that was fixed before
app/invoices.py:5 [naive-datetime] This makes a timestamp with no timezone, which breaks
comparisons and shifts times across servers. Use datetime.now(timezone.utc).
learned from 95ffe5603abe "Use timezone-aware timestamps in billing"
Fix the code. Ask the user before suppressing a match with `# nosemgrep`.
What the agent sees right after it writes datetime.utcnow() again.
Why antibody
- Lessons that stick. Agents forget between sessions, and rules in prompt files are only suggestions. An antibody is a deterministic check that runs on every edit.
- Proven, not guessed. Your agent drafts a Semgrep-format rule from the fix.
antibody verifyonly accepts it if it fires on the old code and stays silent on the fix. - No noise. Only new matches count, so old code never blocks an edit or breaks a build.
- Any tool. It works with Claude Code, Codex, Gemini CLI, Cursor, GitHub Copilot, any agent that reads AGENTS.md, git hooks and CI.
Install
uv tool install "antibody[semgrep]" # or: pipx install "antibody[semgrep]"
The [semgrep] extra brings the rule engine. If you already use
Opengrep, plain antibody is enough.
Quick start
cd your-repo
antibody init # .antibodies/, AGENTS.md, the agent skill, and hooks for the agents it finds
Fix a bug as usual, then ask your agent to "make an antibody from that fix." It runs:
antibody learn # brief + skeleton from the fix (uncommitted changes, or HEAD)
antibody verify <id> # the proof: fires on the mistake, silent on the fix
antibody sweep <id> # every repeat in the code today
antibody baseline <id> # accept what's left, so only new matches fail
Supported tools
| Tool | How antibody plugs in | Catches a repeat |
|---|---|---|
| Claude Code ✓ | skill + PostToolUse hook |
right after the edit |
| OpenAI Codex | skill + PostToolUse hook |
right after the edit |
| Gemini CLI | skill + AfterTool hook |
right after the edit |
| Cursor | skill + stop hook |
before the agent ends its turn |
| GitHub Copilot (CLI and cloud agent) | skill + agentStop hook |
before the agent ends its turn |
| Windsurf, Cline, opencode, Amp, Zed, Aider, … | AGENTS.md + skill + pre-commit hook | at commit |
| Any CI | antibody check --since origin/main |
on every pull request |
antibody init sets up the tools it detects. Choose them yourself with
--agent claude,cursor or --agent all. ✓ means tested in a live session; the others are
tested against each tool's documented hook format. See docs/agents.md.
How it works
fix ─► antibody learn ─► agent writes the rule ─► antibody verify ─► checked on every edit,
fires on the bug, commit and pull request
silent on the fix
- Learn from a commit, from uncommitted changes, or, for a mistake that never reached git, from a fixture.
- Prove. The rule must fire near the change in the old code and never on lines the fix wrote.
- Enforce. Hooks, pre-commit and CI run the rules with Semgrep or Opengrep. That's about 0.5 s per edit, with no network and no tokens.
Antibodies are plain Semgrep rules in .antibodies/, so they work without antibody too.
Documentation
| Goal | Start here |
|---|---|
| Set up your coding agent | docs/agents.md |
| Write a good antibody | docs/writing-antibodies.md |
| Run it in CI or pre-commit | docs/ci.md |
| Look up a command | docs/commands.md |
| See real examples, including a CVE | docs/examples.md |
Contributing
Issues and pull requests are welcome.
git clone https://github.com/cipheraxat/antibody && cd antibody
uv sync && uv run pytest # runs against real git repos and the real engine
License
Metadata
Release files for antibody 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| antibody-0.3.0.tar.gz | 149.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| antibody-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 186.3 kB
Release files / antibody-0.3.0.tar.gz
| Download URL | antibody-0.3.0.tar.gz |
|---|---|
| Size | 149.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c0972b3f4f3b96c33c14141e697221f4a55fd3da5990c83c44e46bbe02b5e97
|
|
BLAKE2b-256 checksum How to use checksums |
716989da1ad367b00b78ded5a3fa15edfa3907b3dc54712f7316fbdbfd7e1d66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / antibody-0.3.0-py3-none-any.whl
| Download URL | antibody-0.3.0-py3-none-any.whl |
|---|---|
| Size | 36.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84eb5bfe76d648f2e8f008c4c2bcbdc7bad49ba102dde8a542352aa6a3114db2
|
|
BLAKE2b-256 checksum How to use checksums |
c3afe51d8bb057465cbee9d61561eef7fe12b87d62481b1c3e674d6c1a1a1bfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for antibody 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.