Quickstart: seal your first capsule
From install to a witnessed, verified record in a few minutes — using seal(), the canonical one-call API.
1. Install
pip install capsule-emit
seal() is signed and witnessed by default, async and non-blocking — no signup, no key. If you want to try locally first with zero network egress, set CAPSULE_WITNESS=off (or pass witness=False): you get a signed, structured record and a local ledger file you can verify offline. One config change turns witnessing back on when you’re ready. See the adoption ladder.2. Seal an action
Call seal() once at each consequential action — the payload is the first positional argument, never a keyword. action, operator, developer, and agent_output are what you'll always pass; model, verdict, and effect are optional (adapters fill in what they can — the MCP adapter, for example, sees the tool boundary, not the LLM, so pass model explicitly there if you want it sealed).
from capsule_emit import seal
result = place("Frobozz Supply", "4210.00", "PO-0047") # your tool logic
cap = seal(
{"vendor": "Frobozz Supply", "total": "4210.00"}, # payload — first arg; monetary values are strings, not floats
action="submit_order",
operator="acme-co", # accountable tenant
developer="po-agent@v1", # agent identity + version
agent_output=result,
model={"provider": "example-provider", "model_id": "example-model"},
verdict="executed", # a verdict_class: executed | blocked | denied | …
effect={"type": "submit_order", "status": "dispatched"},
)
print(cap.capsule_id, cap.signature) # sealed, signed, and witnessed by default
3. Where it's witnessed
By default, every seal() folds the capsule into your ledger's checkpoint/witness stream: roughly every 100 entries (or 15 minutes), a signed checkpoint of the whole ledger — never capsule content — is registered with the public witness, a SCITT Transparency Service, at witness.agentactioncapsule.org, no signup, no key. Set CAPSULE_WITNESS=off (or pass witness=False) to seal fully offline; set CAPSULE_WITNESS_URL or pass witness_url=… to point at your own Transparency Service. The older per-capsule anchor channel (cap.anchored, anchor=True / CAPSULE_ANCHOR=legacy-on) is a legacy, explicit opt-in kept only as a rollback path — it has not been the default egress path since 0.5.0. See the adoption ladder for the full rung-by-rung path.
4. Verify
Each seal() also appends the sealed capsule to a local ledger.jsonl by default — that’s the file you verify, offline:
# verify a ledger of sealed capsules, offline — no keys or network needed
capsule-emit verify --store ledger.jsonl
VALID
1/1 VALID
agent-action-capsule verify (the spec package's own CLI, bundled as a capsule-emit dependency) checks structural/digest conformance only. capsule-emit verify runs that same check plus the producer-envelope check: a capsule with an altered signature but an otherwise-untouched digest still reads ok under agent-action-capsule verify and fails INVALID under capsule-emit verify. Use capsule-emit verify --store for the full check.Adapters: seal from your framework
You don’t have to call seal() by hand. Thin adapters seal one capsule per tool call across the framework you already use — MCP / any callable (a decorator), LangChain / LangGraph (a callback), CrewAI (a tool wrap), and Goose (companion MCP server or @emitter.tool() decorator, verified against Goose v1.39.0). A gateway integration (agentgateway) seals at the chokepoint every consequential action flows through — one policy point instead of N integrations (via the gateway's mcpGuardrails ExtMcp hook). Any custom loop works via one call at the tool boundary. Per-framework guides: docs/adapters/ — including the Goose extension and the agentgateway adapter.
capsule-emit: Tutorial: your first capsule ↗ · Confirming & chaining ↗