Tagline
A local consent-and-budget ledger that makes every autonomous agent tool call inspectable, replayable and tamper-evident.
Inspiration
Autonomous agents are gaining the ability to browse, write files, call APIs and spend money, but most agent frameworks treat permission as a prompt instruction or a hidden framework check. When something goes wrong, there is often no durable evidence of what the agent was allowed to do, what it attempted, or which rule stopped it.
AgentBill started from a simple question. What if every agent tool call produced the equivalent of a receipt that a human, another agent or an auditor could independently replay?
What it does
AgentBill is an offline, zero-dependency consent-and-budget ledger for autonomous agent tool calls.
- Consent grants define agent id, tool scopes, a whole-cent spend ceiling, an expiry and a revocation id.
- Every grant, tool call and revocation becomes a deterministic JSON event.
- Calls are rejected when the grant is missing, belongs to another agent, is revoked, is expired, fails positive or negative scope matching, or would exceed the spend ceiling.
- Every rejection cites the exact rule and the grant line that authorized or refused the call.
- Rejected calls remain in the ledger because attempted actions are evidence.
- A sha-256 hash chain links each event to the previous event.
- Canonical JSON and JSONL exports make the ledger easy to diff, paste and archive.
- A printable agent invoice summarizes spend by agent, rejected calls, revocations and hash evidence.
- A replay verifier rebuilds the ledger event by event and reports the first structural, semantic or hash-chain divergence.
The browser demo loads a deterministic evidence pack with accepted calls, negative-scope rejection, expiry at the exact boundary, revocation, wrong-agent rejection, one cent over the ceiling and spend exactly at the ceiling. One click changes a single byte in the export and replay identifies the resulting hash divergence.
Open Agentic Web integration
AgentBill is also a static Open Agentic Web bundle. The site publishes:
agent-manifest.json- a resolved two-agent Neuro SAN JSON network,
agentbill.network.json links.json.well-knowndiscovery files- a self-contained browser runtime
- page-local actions for reading, previewing, granting, calling, revoking, exporting and verifying
- a read-only action bridge that shares the public deterministic evidence ledger with other agentic websites
The assistant is optional and bring-your-own-key. The ledger, invoice and replay verifier work without network access or a model. When the assistant is used, irreversible actions pass through a browser confirmation dialog before they are appended.
How we built it
The core ledger is plain JavaScript for Node 22 or newer. It has no dependencies. Canonical JSON serialization and a local sha-256 implementation keep exports deterministic. The CLI, browser workbench, invoice renderer, replay verifier and evidence pack all use the same library.
The Open Agentic Web runtime in runtime/ is copied from Cognizant's Apache 2.0 reference runtime. AgentBill adds the ledger-specific network, actions, bridge, interface, tests and evidence model around it.
The test suite uses node:test and contains 31 deterministic tests with 175 assertion call sites. It covers exact, prefix, wildcard and negative scope matching, exactly-at-limit ceiling math, one-cent-over rejection, expiry boundaries, revocation ids, sha-256 known vectors, single-byte tampering, malformed ledgers, structural mistakes, semantic replay divergence, invoice totals and CLI workflows.
Challenges
The hardest design decision was treating rejection as first-class evidence rather than as a missing event. A ledger that only records successes hides the most important part of agent governance. AgentBill therefore records both accepted and rejected calls, while making sure rejected calls never spend budget.
A second challenge was keeping replay honest. Recomputing hashes is not enough, because an attacker can rewrite the whole chain. The verifier also re-executes the semantics of every event on a shadow ledger and compares status, rejection rule, spend before, spend after and revocation line data.
Finally, the browser demo needed to be a real agentic web surface rather than a marketing page. The same operations used by the manual controls are exposed as page-local actions, and the public evidence pack is available through a constrained read-only bridge.
Accomplishments
- A deterministic zero-dependency ledger library and CLI.
- A printable human-readable invoice generated from canonical machine evidence.
- A replay mode that reports the first divergence instead of returning only pass or fail.
- A deterministic demo ledger whose head hash is stable across machines.
- 31 passing tests with broad boundary and tamper coverage.
- A static Open Agentic Web bundle with a validated two-agent network and action bridge.
- A real browser workbench, three headless Chrome screenshots and a narrated demo video.
What we learned
Small deterministic rules are powerful when they produce evidence people can inspect. The important infrastructure primitive is not only whether an agent was stopped. It is whether a third party can reconstruct why.
The agentic web also changes the role of a demo page. A static site can be both a human interface and a machine-readable network endpoint, but that only works when actions are explicit, scoped and honest about what they change.
Honest limits
AgentBill uses declared costs, not measured provider costs. It is a local ledger, not a billing system, payment rail, identity system or legal consent product. The hash chain is tamper-evident, not a digital signature. Anyone who controls a file can rewrite the whole chain, but they cannot alter one event in a valid export without replay detecting it.
What's next
- Signed export envelopes and optional key-based receipts.
- append-only storage adapters for local-first agent frameworks.
- measured cost connectors that reconcile declared and provider-reported spend.
- multi-party transparency logs for shared agent infrastructure.
- richer Open Agentic Web links between consent ledgers, agent registries and tool marketplaces.
AI disclosure
AI coding tools assisted with the implementation, tests, documentation, interface, narration and demo assets. The project was verified locally with deterministic tests, headless browser screenshots, the Open Agentic Web network build and a narrated screen recording. The core ledger does not depend on a model at runtime.
Built With
- agents