Skip to content

How Anvil works

Anvil compiles API contracts into agent-facing tools.

The API contract gives Anvil transport facts: paths, methods, fields, schemas, and auth schemes. It usually does not tell Anvil whether a call moves money, can be retried, needs confirmation, or is approved for agent use.

You supply those missing facts in a reviewed manifest.

API contract + reviewed manifest -> AIR -> CLI / MCP / SDKs / skill / hooks

AIR is the Anvil Intermediate Representation. Every generated surface comes from it.

Take POST /refunds.

The API contract can prove the request and response shape. It cannot prove that retrying the call will not create a second refund.

Put that policy in the manifest:

operations:
createRefund:
side_effect: mutation
risk: financial
reversible: false
idempotency:
strategy: required_request_key
key_location: header
header: Idempotency-Key
confirmation:
required: true
reason: This operation moves money and cannot be reversed.

Anvil then:

  1. captures the exact source bytes;
  2. combines source facts and reviewed facts in AIR;
  3. validates effect, retry, confirmation, auth, and approval together;
  4. generates each surface from AIR; and
  5. checks the same policy again at runtime before network access.

The result is simple: the refund has the same name, schema, confirmation rule, and idempotency rule everywhere.

who is calling Human at a terminal engineers · CI pipelines · scripts Agent in a harness Antigravity · Claude Code · Codex Platform team enforcing policy across every agent runs reads calls installs CLI typed commands · --dry-run scriptable in CI Skill the operating manual capabilities → workflows MCP server one tool per approved op risk visible in annotations Harness hooks Antigravity · Claude Code · Codex deny pre-flight · escalate AIR one model — every tool agrees
fig 05 · pick any entry point — they all land on the same contract
SurfaceUsed byWhat it does
CLIDeveloper or CIInspects and invokes approved operations
MCP serverAgent runtimeExposes approved operations as MCP tools
Client SDKsApplication codeCalls the same operations from TypeScript, Python, Go, or Java
SkillAgentDescribes setup, capabilities, constraints, errors, and examples
Harness hooksCoding harnessRefuses or escalates earlier in the call path

These are generated views of one contract. They are not separate integrations.

Do not edit generated files. Change the source contract or manifest and compile again.

Classification says what an operation does. Approval says whether it may be called.

an operation's approval lifecycle after compile held for review a human decides the agent Generated state: generated risky · non-idempotent Review required held for review human approves Approved state: approved compiled MCP tool the agent can call it rejected Blocked never ships to an agent later Deprecated the spec dropped it only approved operations are compiled into a tool — everything else is invisible to the agent.
fig 07 · nothing reaches an agent until a human moves it to approved
StateMeaning
generatedThe operation exists in AIR
review_requiredA missing fact or decision blocks exposure
approvedThe operation may enter callable surfaces
blockedA known condition prevents approval
deprecatedThe operation remains recorded but is removed from normal use

Only approved operations are callable.

Names are not evidence. getTransferStatus may still mutate state. HTTP methods are not enough either. Review the operation before approving it.

IfThen
Effect is uncertainKeep the operation review_required
Mutation idempotency is unprovenDisable automatic retry
Required confirmation is absentReturn confirmation_required
Durable deduplication is required but unavailableFail the write closed
Host is outside the reviewed allowlistReturn policy_denied
A hook is unavailableEnforce the rule in the runtime

Hooks improve feedback. They are not the trust boundary. The runtime owns the final validation, auth, idempotency, retry, host, and execution checks.

anvil compile writes three kinds of artifact:

  1. Contract: AIR, source identity, evidence, catalogs, and policy.
  2. Generated surfaces: CLI, MCP, SDKs, skill, hooks, mocks, evaluations, target kits, and deployment inputs.
  3. Assurance: certification, self-test, conformance, simulation, and publication records tied to the bundle hash.

Run anvil status <bundle> when you return to a bundle. It reports the first action still required.

CommandQuestion
anvil certifyDo generated artifacts agree with AIR?
anvil selftestDoes the generated MCP surface work over local transport?
anvil conformanceDo the generated CLI, MCP server, and skill agree?
anvil simulateDo controls hold across the generated safety matrix?

Each record names the bundle hash it tested. Change the bundle and the record is stale.

anvil publish requires current evidence and creates an operator plan. It does not deploy.

API contracts use compile or agentify.

Gateway exports use the estate workflow. Gateway identity, policy, coordinates, and provenance need to survive import.

Application-server, .NET, and broker configuration use the legacy workflow. That workflow records offline evidence and reviewed bindings. It does not create a runnable deployment-local bridge in the current release.

Existing MCP servers use anvil adopt. A tool without a clear read-only signal stays a mutation until someone reviews it.

Anvil parses OpenAPI, Swagger, GraphQL SDL, proto3, WSDL, Google Discovery, OData metadata, and Postman collections. Parser support does not imply native wire support. See source format support.

Anvil does not:

  • invent business meaning;
  • approve uncertain mutations;
  • store production credentials;
  • replace upstream authorization;
  • fetch remote references during local source capture;
  • turn inventory into execution authority; or
  • deploy when publish runs.

See the product boundary for the full ownership model.