BuildNot yet confirmed elsewhere1 publisher3 min readPublished
API keys are not an authorisation model for an agent that can move money
A single developer's capability layer for AI agents is pre-1.0 and self-reviewed. The primitive it argues for is still the floor: scoped, signed, dated, revocable, recorded.
The Engineer · Build desk

What happened
- A developer published Agent Firewall, a capability layer that gives each AI agent cryptographically signed, narrow permissions instead of one key that opens everything.
- Its sample code issues a finance agent a payments.send capability bounded by a spend ceiling and a fixed expiry date.
- Each capability carries eight explicit states, including replayed and revoked, held as queryable security state rather than log lines.
- Version 0.8 moves the revocation registry and lifecycle history into SQLite so both survive a restart.
- Incoming HTTP requests and Model Context Protocol tool calls are mapped to capability namespaces and checked before the call executes.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint With an API key there is nothing to narrow and no date to shorten, so the only response to a suspected leak is rotating a credential every consumer shares.
- capability One agent's authority can be killed mid-incident, and its replayed requests refused, without disturbing the other agents on the same tool surface.
- decision Anyone who wants this in production picks between depending on a library whose API is not frozen until v1.0 and building the same properties into their own gateway.
- contradiction The design case is strong while the evidence for the code is entirely the author's own, which points to adopting the model now and the package later.
The arithmetic is left implicit in the post, so here it is. The example capability lets finance-agent send payments up to a ceiling of 100, valid until 30 August 2026 [5]. That agent can hand a sub-agent the same payments.send capability narrowed to 50 [9], which caps a compromised sub-agent at half the parent's per-payment authority [14]. Set that against the two failure cases the post opens on: a leaked finance key that drains the account, and a compromised code-review agent pushing malicious commits [c2b]. In both, the loss is bounded by the resource rather than by the token. Attenuation is the property that changes that number, and it is the one an API key has no syntax for [3].
The second thing worth reading closely is where the risk moves rather than disappears. The SDK's issue call takes a private_key argument, and the post says nothing about where that key lives or how it is rotated [6]. Every capability the system will ever honour is minted with it. The operating systems work the author draws on, where permissions are unforgeable tokens that can be delegated and attenuated [12], treats custody of the root as somebody else's chapter. In deployment it becomes an environment variable on whichever box does issuance, and at that point the signing key carries the blast radius the API key used to have. Better, because minting is now a recorded act, but not smaller.
Third, the expiry in the example is an absolute timestamp, not a lifetime [5]. A capability issued in a hurry and forgotten is good until that date. Time-bound by default only holds if callers pass short dates, and the sample code invites the opposite habit.
The implementation deserves cautious reading. The author reports 1,438 passing tests including adversarial regression coverage, plus architecture docs and a threat model [1], and describes himself as a recent CS graduate who was building coursework COVID detection models six months earlier [11]. A test count is evidence of care, not of correctness. The failure mode that would hurt here is not a signature bug but a revocation store that answers stale while a tool call is in flight, and nothing visible from outside the repo speaks to that.
None of this argues against the primitive. If an agent can move money or write to a repository, the object it presents should name the agent, the action, the ceiling and the deadline, and it should be killable on its own with a record of what it did. That is a short specification, and it is implementable against a gateway you already run if you would rather not take a pre-1.0 dependency at your authorisation boundary. The thing not to keep doing is handing an autonomous process the same static key you gave your CI job and calling the result access control [3].
What to watch
- Whether the v1.0 API freeze keeps delegation and attenuation intact, and whether its docs finally specify custody and rotation for the signing key.
- Any independent review of the threat model or the adversarial test suite, or a named production deployment putting real payment volume behind it.
- Whether MCP tool hosts add per-call authorisation checks natively, which would make a separate boundary layer redundant for that path.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence24
- Adoption7
- Hype gap+28
- Incentives74
- Confidence58
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
The author reports 1,438 passing tests including adversarial regression coverage, plus architecture docs and a threat model, and says he shipped v0.8 with SQLite-backed lifecycle persistence.
ReportedSupportedSource: Shubh Bhangoo, dev.to2 sources— create a free account to open themView cited source - [2]
A dev.to post by Shubh Bhangoo describes Agent Firewall, a capability-based security layer for AI agents that issues fine-grained, cryptographically signed permissions with full lifecycle tracking, instead of a key that unlocks everything.
- [3]
The post argues that most people authorise agents with API keys, and that an API key is binary access: no built-in expiration, cannot be narrowed, no audit trail, revocable only wholesale.
- [4]
The post's stated failure cases: if a finance agent's API key leaks, someone can drain the account; if a code-review agent is compromised, it can push malicious commits.
- [5]
The sample code issues a capability to agent "finance-agent" for "payments.send" with constraints amount_max of 100 and expires_at of 2026-08-30T00:00:00Z, an absolute timestamp rather than a relative lifetime.
- [6]
The SDK's issue() call takes a private_key argument used to sign capabilities, and the post does not describe how that signing key should be stored, protected or rotated.
- [7]
Every capability has an explicit lifecycle of eight states: ISSUED, DELEGATED, ATTENUATED, USED, REPLAYED, REVOKED, DENIED, EXPIRED, which the author describes as queryable security state rather than logging.
- [8]
In v0.8 the revocation registry and lifecycle history persist to SQLite and survive a service restart.
- [9]
The post's delegation example has a finance agent delegate payments.send to a sub-agent with amount_max reduced to 50.
- [10]
Agent Firewall exposes two boundaries: an HTTP boundary mapping requests such as POST /payments/refund to the namespace http.POST.payments.refund, and an MCP boundary that authorises Model Context Protocol tool calls before execution; both verify the capability, bind it to the agent identity, check constraints and apply replay protection.
- [11]
The author describes himself as a fresh CS graduate who six months earlier was building COVID detection models for college assignments, and who hit the authorisation problem while prototyping agents with LangChain, CrewAI and AutoGen.
- [12]
The design draws on capability-based security from operating systems research, where permissions are unforgeable tokens that can be delegated and attenuated.
- [13]
The post names no production deployments, adoption figures, or independent audit or third-party review of the code or threat model.
- [14]
A capability delegated at amount_max 50 from a parent capped at 100 leaves a compromised sub-agent with half the parent's per-payment authority.
- [15]
The post states that a revoked capability is dead immediately and that a replayed old request is rejected, with revocation applied to individual capabilities.
- [16]
v1.0 is the stated next milestone, at which the author intends to freeze the API, ship full documentation and make the project production-ready.
Sources
1 independent publisher whose own reporting we read for this story.
- dev.toI Built a Capability-Based Security Layer for AI Agents — Here's Why It Matters
1 article · August 22, 2026
Topics and entities
Follow any of these and your For You feed starts watching them — no settings page required.
Topics
- Secrets and Key ManagementFollow
- MCP Tool-Call SecurityFollow
- Pre-1.0 Open Source Security ToolingFollow
- Capability-Based SecurityFollow
- AI Agent AuthorizationFollow