Apache-2.0 Python · Go · TS open source · on PyPI

Boundary enforcement for AI coding agents.

Declare each module's interface and dependencies in plain YAML. anma sync compiles that into the CLAUDE.md, hooks, and CI checks that keep an agent inside your architecture — author once, enforce everywhere.

View on GitHub See the benchmark
payments-boundary · claude-haiku-4-5 · n=20 measured
Plain repo (control)
~68%
violated the boundary — 13 of 19 scored runs (1 of 20 excluded, incomplete)
with
ANMA
With ANMA
0/20
disallowed cross-module imports
Fisher's exact p<0.0001 turn cost 11.5 vs 10.3 scored by an independent counter
The honest finding

ANMA's value depends on the model. We publish both halves.

A frontier model respects a documented architecture on its own. A cheaper or faster model doesn't — and that's exactly where ANMA earns its place.

Frontier · Claude Opus 4.8

Already inside the lines

0 violations — with or without ANMA

Across the scenarios tested, Opus 4.8 never crossed the boundary on its own, and the ANMA arm used more turns. We don't claim ANMA makes a frontier model smarter, because the data says it doesn't.

Cheaper · Claude Haiku 4.5

Routinely steps over

~68% → 0 of 20

On payments-boundary, Haiku violated the boundary in 13 of 19 control runs and 0 of 20 with ANMA. orders-inventory pointed the same way (2/5 → 0/5).

ANMA is insurance for running cheaper, faster agents — plus a CI/governance guarantee that holds no matter which model or human wrote the diff.
How it works

Contracts are the source of truth. Everything else is generated.

You maintain small YAML contracts. anma sync compiles them so the architecture the agent reads can never drift from the rules CI enforces.

anma.yaml # project config src/domains/billing/ anma.yaml # the module contract CLAUDE.md (gen) loads in billing/ CLAUDE.md (gen) architecture map .claude/rules/boundaries.md (gen) .claude/hooks/anma_pretooluse.py (gen) tach.toml (gen) engine config .github/workflows/anma.yml (gen) CI DECISIONS.md why each boundary exists

GUIDANCE in-session steering

The generated root and per-module CLAUDE.md put your architecture in the agent's context. This drove the 68% → 0 result — the model was steered to the right design and never attempted a bad edit.

ENFORCEMENT the hard backstop

A PreToolUse hook judges the proposed edit and blocks any new disallowed import before it lands. The same check runs at pre-commit and in CI.

$ forbidden edit → ANMA: module 'accounts' may not import [billing] · exit 2
Measured, not claimed

The same task, with and without ANMA.

An independent scorer counts disallowed cross-module imports in the agent's final code against each scenario's declared graph. Incomplete runs are flagged and excluded, so a blocked run can't read as a clean pass.

Scenario · model Arm Trials Violations Mean Hook blocks
payments-boundary · Haiku 4.5 control 20 (19 scored) 13 0.68
payments-boundary · Haiku 4.5 anma 20 0 0.00 0
payments-boundary · Opus 4.8 control 0 0.00
payments-boundary · Opus 4.8 anma 0 0.00 0

Why hook blocks read 0: guidance prevented the violations before the hook was needed. The enforcement hook is verified separately to fire (a forbidden edit returns exit 2). Both layers work — guidance does the work in practice, enforcement is the backstop. Limits: n=20 on one scenario, one model family, three hand-built scenarios. The raw per-trial data is committed in the repo.

Who it's for

Best where the agent isn't perfect.

01 / COST

Cheaper agent fleets

Cost-sensitive pipelines, bulk tasks, non-frontier or non-Claude models that don't reliably respect an architecture on their own. This is where ANMA's steering is decisive.

02 / GUARANTEE

An enforced architecture

A guarantee in CI and pre-commit that module boundaries hold — regardless of which model, agent, or human authored the change.

03 / GOVERNANCE

Architecture as data

Declared interfaces, ownership compiled to CODEOWNERS, and docs that can't silently drift from the rules they describe.

Three languages

One contract. Python, Go, and TypeScript.

The contract graph — names, dependencies, ownership — is language-neutral. Only the part that resolves imports and runs the check is per-language, behind a swappable adapter. Adding a language is an adapter, not a rewrite: the neutral layers stayed byte-for-byte identical when Go and TypeScript landed.

Language External backend Zero-dep fallback Enforces
Python tach ast scanner depends_on + interface
Go go-arch-lint import scanner depends_on (module→module)
TypeScript dependency-cruiser import scanner depends_on (module→module)

What's measured: the gauge above is Python (~68%→0). For Go and TypeScript we pre-registered a harder, neutral-prompt benchmark — with a fixed efficacy floor — before collecting data. TypeScript: where the bare model crosses the boundary 18 of 20 times, ANMA produces 0 of 20 violations — Fisher's exact p<0.00001. A measured second-language result, not extrapolated from Python. Go: directional and significant (10/30→0/30, p=0.0004), but the control rate (33%) fell below our pre-registered 0.40 floor — so we report Go as suggestive, not yet efficacy. The same task drew 90% violations in TypeScript but 33% in Go: explicit imports make a language more boundary-respecting on its own, and ANMA helps most where they don't. Interface-level (public:) enforcement is Python-only today; one language per project.

Sixty seconds

Install. Declare. Enforce.

pip install anma[tach]   # tach backend recommended; works without it too
anma init                 # python (default) · or --language go|typescript
anma sync                 # generates CLAUDE.md, hooks, tach.toml, CI
anma check                 ✓ boundaries respected
~800 lines · readable in an afternoon one small dependency (PyYAML) Trusted Publishing · provenance · SBOM
FAQ

Honest answers.

Will the CLI stay free?
Yes — always, under Apache-2.0. If we add hosted features for teams, they'll be additive; the open-source CLI never becomes paywalled.
Can I self-host everything?
The CLI and every artifact it generates are yours to run anywhere. Any future hosted layer would be an optional service on top, not a replacement.
Do you support agents other than Claude Code?
Enforcement (hooks + CI) is agent-agnostic today. Guidance (CLAUDE.md) is Claude Code-native. Adapters for other agents are on the roadmap — tell us which agent you use below.
What's next

The CLI is free. Hosted features are coming.

ANMA is open source and stays that way. We're exploring a hosted layer for teams — CI boundary checks on private repos, PR reports, a cross-repo dashboard, and adapters for other agents. We're listening before we build: if a hosted layer would help your team, tell us what you'd actually use.

No spam, no payment. We'll email you when early access opens — the CLI stays free.