<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shubhbhangoo</title>
    <description>The latest articles on DEV Community by Shubhbhangoo (@shubhbhangoo).</description>
    <link>https://dev.to/shubhbhangoo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4090151%2F2c664733-9570-48c8-b76e-736d943266c4.png</url>
      <title>DEV Community: Shubhbhangoo</title>
      <link>https://dev.to/shubhbhangoo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shubhbhangoo"/>
    <language>en</language>
    <item>
      <title>I Built a Capability-Based Security Layer for AI Agents — Here's Why It Matters</title>
      <dc:creator>Shubhbhangoo</dc:creator>
      <pubDate>Sat, 22 Aug 2026 20:48:47 +0000</pubDate>
      <link>https://dev.to/shubhbhangoo/i-built-a-capability-based-security-layer-for-ai-agents-heres-why-it-matters-4kfc</link>
      <guid>https://dev.to/shubhbhangoo/i-built-a-capability-based-security-layer-for-ai-agents-heres-why-it-matters-4kfc</guid>
      <description>&lt;p&gt;I Built a Capability-Based Security Layer for AI Agents — Here's Why It Matters&lt;/p&gt;

&lt;p&gt;The Problem Nobody's Talking About&lt;/p&gt;

&lt;p&gt;AI agents are everywhere now. They book flights, send emails, process payments, and access your codebase. But here's the question nobody asks:&lt;/p&gt;

&lt;p&gt;Who authorizes which agent can do what?&lt;/p&gt;

&lt;p&gt;Most people use API keys. An API key is binary — you have it or you don't. If your finance agent's key leaks, someone can drain your account. If your code-review agent gets compromised, it can push malicious commits. There's no middle ground.&lt;/p&gt;

&lt;p&gt;I kept hitting this wall while building agent prototypes. So I built something to fix it.&lt;/p&gt;

&lt;p&gt;What I Built&lt;/p&gt;

&lt;p&gt;Agent Firewall is a capability-based security layer for AI agents. It gives you fine-grained, cryptographically signed permissions with full lifecycle tracking.&lt;/p&gt;

&lt;p&gt;Instead of giving an agent a key that unlocks everything, you give it a capability:&lt;/p&gt;

&lt;p&gt;from agent_firewall import FirewallSDK&lt;/p&gt;

&lt;p&gt;sdk = FirewallSDK(&lt;br&gt;
revocation_store_path="revocations.db",&lt;br&gt;
lifecycle_store_path="lifecycle.db",&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;capability = sdk.issue(&lt;br&gt;
private_key=private_key,&lt;br&gt;
agent="finance-agent",&lt;br&gt;
capability="payments.send",&lt;br&gt;
constraints={&lt;br&gt;
"amount_max": 100,&lt;br&gt;
"expires_at": "2026-08-30T00:00:00Z"&lt;br&gt;
},&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;That agent can now send payments — but only under 100, and only until August 30th. If you revoke the capability, it's dead immediately. If someone replays an old request, it's rejected.&lt;/p&gt;

&lt;p&gt;Why Capabilities Beat API Keys&lt;/p&gt;

&lt;p&gt;API Keys vs Capabilities:&lt;/p&gt;

&lt;p&gt;API Keys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary access&lt;/li&gt;
&lt;li&gt;No expiration built-in&lt;/li&gt;
&lt;li&gt;Can't be narrowed&lt;/li&gt;
&lt;li&gt;No audit trail&lt;/li&gt;
&lt;li&gt;Leaked = game over&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Granular permissions&lt;/li&gt;
&lt;li&gt;Time-bound by default&lt;/li&gt;
&lt;li&gt;Can be attenuated (narrowed without increasing authority)&lt;/li&gt;
&lt;li&gt;Full lifecycle: ISSUED → USED → REVOKED → EXPIRED&lt;/li&gt;
&lt;li&gt;Revocable individually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Capability Lifecycle&lt;/p&gt;

&lt;p&gt;Every capability in Agent Firewall has an explicit lifecycle:&lt;/p&gt;

&lt;p&gt;ISSUED&lt;br&gt;
↓&lt;br&gt;
DELEGATED&lt;br&gt;
↓&lt;br&gt;
ATTENUATED&lt;br&gt;
↓&lt;br&gt;
USED&lt;br&gt;
↓&lt;br&gt;
REPLAYED&lt;br&gt;
↓&lt;br&gt;
REVOKED&lt;br&gt;
↓&lt;br&gt;
DENIED&lt;br&gt;
↓&lt;br&gt;
EXPIRED&lt;/p&gt;

&lt;p&gt;This isn't just logging — it's security state. You can query whether a capability was used, replayed, or revoked. You can delegate a capability to another agent with reduced authority (your finance agent delegates payments.send with amount_max=50 to a sub-agent). You can attenuate it yourself.&lt;/p&gt;

&lt;p&gt;And in v0.8, all of this persists to SQLite. Restart your service, and the revocation registry and lifecycle history survive.&lt;/p&gt;

&lt;p&gt;Real-World Boundaries&lt;/p&gt;

&lt;p&gt;Agent Firewall isn't just a library — it's a boundary layer.&lt;/p&gt;

&lt;p&gt;HTTP boundary: Maps incoming requests to capability namespaces.&lt;/p&gt;

&lt;p&gt;POST /payments/refund&lt;br&gt;
↓&lt;br&gt;
http.POST.payments.refund&lt;/p&gt;

&lt;p&gt;MCP boundary: Authorizes Model Context Protocol tool calls before execution.&lt;/p&gt;

&lt;p&gt;Both boundaries verify the capability, bind it to the agent identity, check constraints, and apply replay protection before allowing execution.&lt;/p&gt;

&lt;p&gt;The Story Behind It&lt;/p&gt;

&lt;p&gt;Six months ago, I was building COVID detection models for college assignments. Standard undergrad ML stuff.&lt;/p&gt;

&lt;p&gt;Then I started playing with AI agents — LangChain, CrewAI, AutoGen — and kept running into the same problem: these agents have way too much power by default. An API key doesn't care which agent is calling, what it's doing, or when it should stop working.&lt;/p&gt;

&lt;p&gt;So I went deep on capability-based security — a model from operating systems research where permissions are unforgeable tokens that can be delegated and attenuated. I built Agent Firewall to bring that model to the agent era.&lt;/p&gt;

&lt;p&gt;It now has 1,438 passing tests, including adversarial regression coverage. It has architecture docs and a threat model. And yesterday, I shipped v0.8 with SQLite-backed lifecycle persistence.&lt;/p&gt;

&lt;p&gt;Where It's Going&lt;/p&gt;

&lt;p&gt;v1.0 is the next milestone. I'm freezing the API, shipping full documentation, and making this production-ready. The goal is simple:&lt;/p&gt;

&lt;p&gt;Every AI agent that calls a tool should have an authorization layer that understands who, what, and when.&lt;/p&gt;

&lt;p&gt;Check out the repo: github.com/Shubhbhangoo/agent-firewall/tree/v0.8&lt;/p&gt;

&lt;p&gt;If you're building agents that call tools — payments, APIs, databases, anything — I'd love your feedback. Drop an issue, open a PR, or just tell me what your authorization setup looks like today.&lt;/p&gt;

&lt;p&gt;I'm Shubh, a fresh CS grad building security infrastructure for the agent era. Follow along as I ship v1.0 and beyond.&lt;/p&gt;




</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
