Back to Blog
MCPL402MacaroonsAgent Economy

Beyond Connection: The Case for Economic Governance in MCP

Your AI agent just connected to 12 tools. Who's watching the bill?

February 12, 202612 min read

The Model Context Protocol (MCP) is the most important thing happening in the agent ecosystem right now. Anthropic's open standard gives AI agents the ability to move beyond chat — connecting them to GitHub, Slack, databases, cloud APIs, and anything else with a JSON-RPC interface.

MCP turns chatbots into operators. That's the promise, and it's real.

But there's a problem nobody's talking about.

Every Tool Call Has a Price Tag

When an agent calls a tool, something happens on the other end. A database query runs. An API request fires. Tokens get consumed. Compute spins up. Every one of those actions costs money.

The current MCP specification is excellent at answering two questions:

  1. Transport: How does the agent talk to the tool?
  2. Schema: What does the tool do and what parameters does it accept?

But it's silent on a third question that matters more than either of those in production:

How much can this agent spend, and what happens when it hits the limit?

There is no native mechanism in MCP to say: "This agent can use the Google Search tool, but stop it if it spends more than $2.00 this hour."

The $500 Hallucination

We all know agents hallucinate text. That's annoying but survivable.

In an MCP-enabled world, agents can hallucinate actions. A coding agent stuck in a loop doesn't just waste tokens — it fires real API calls, creates real cloud resources, runs real database queries. Each one costs real money.

Here's a scenario that's already happening in the wild:

  1. You give an agent access to a Cloud Resource Manager MCP tool
  2. You ask it to "optimize our staging environment"
  3. The agent tries an approach, it doesn't work, so it tries another
  4. And another. And another.
  5. 200 API calls later, you get a bill for $200

The agent wasn't malicious. It was doing exactly what you asked — trying to solve the problem. It just didn't have a budget.

This isn't a hypothetical. Teams running autonomous agents against cloud APIs are discovering this the hard way. The gap isn't in the agent's intelligence. It's in the infrastructure's ability to say "stop."

The Missing Layer: Economic Policy

Consider what we already enforce at the infrastructure level for human users:

  • Authentication: Who are you?
  • Authorization: What can you access?
  • Rate limiting: How fast can you go?

For AI agents, we need a fourth layer:

  • Economic policy: How much can you spend?

This isn't rate limiting. Rate limits are blunt instruments — they cap requests per second regardless of cost. A single request to GPT-4 costs 100x more than a request to an embeddings API. You need cost-aware enforcement, not just velocity caps.

┌─────────┐         ┌──────────────────┐         ┌────────────┐
│  Agent   │────────▶│  Economic Proxy  │────────▶│ MCP Server │
│          │◀────────│  (SatGate)       │◀────────│  (Tools)   │
└─────────┘         └──────────────────┘         └────────────┘
                           │
                    ┌──────┴──────┐
                    │  Per-Tool   │
                    │  Cost       │
                    │  Attribution│
                    │  + Budget   │
                    │  Enforcement│
                    └─────────────┘

SatGate is an economic proxy — it sits between the agent and the MCP server, intercepts every tool call, attributes its cost, and enforces budget policy in real time.

How It Works: Intercepting MCP at the Wire Level

MCP uses JSON-RPC 2.0 over stdio or HTTP. Every tool invocation is a tools/call method with the tool name in the params:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "search_database",
    "arguments": {
      "query": "SELECT * FROM orders WHERE status = 'pending'"
    }
  },
  "id": 42
}

SatGate's MCP middleware parses this at the proxy layer — no agent modification required. It extracts the method and tool name, matches them against cost profiles, and makes an enforce/allow decision before the request ever reaches the upstream:

# SatGate route config — per-tool cost profiles
routes:
  - name: mcp-tools
    match:
      pathPrefix: /v1/mcp
    policy:
      kind: fiat402
    mcp:
      costs:
        "search_database": 50      # 50 credits per call
        "create_resource": 500     # 500 credits — expensive!
        "read_file": 5             # cheap
        "execute_code": 200        # moderate
        "cloud_*": 300             # wildcard: any cloud tool

The parser handles JSON-RPC batches, nested tool calls, and streaming responses. It runs at the proxy layer with 96% test coverage — this isn't a proof of concept.

Why API Keys Fail: "Hope-Based Governance"

Most teams try to control agent spend with traditional API keys. This is like giving a teenager your credit card and asking them to "be careful." Once the key is out, you have no way to limit what they buy or how fast they spend — until you manually revoke the key, usually after the damage is done.

API keys are static. They can't express "spend up to $5 on search tools this hour." JWTs are better but still server-dependent — every authorization check hits a database. At agent scale, with thousands of tool calls per minute, that latency adds up.

SatGate replaces this hope-based governance with L402 and macaroons.

L402: The Economic Handshake

L402 (formerly LSAT) combines Lightning Network payments with macaroons. When an agent makes a request through SatGate, we don't just check if they have a "key." We initiate an economic handshake:

  1. Challenge: SatGate intercepts the tool call and returns 402 Payment Required with a Lightning invoice and a macaroon
  2. Proof: The agent's wallet pays the invoice (microsatoshis — fractions of a cent) and receives a preimage — a cryptographic receipt
  3. Access: The agent retries with the preimage. SatGate verifies it cryptographically and unlocks the tool

No accounts. No signup. No OAuth dance. Just cryptographic proof that you paid for what you're about to use. This is how machine-to-machine commerce should work.

For enterprises not ready for Lightning, Fiat402 provides the same enforcement model using credit-based budgets — same hard caps, same delegation, familiar accounting.

Macaroons: The Smart Contract in Your Header

If L402 is the handshake, macaroons are the rules of the conversation. Originally designed by Google, adopted by the Lightning Network, and purpose-built for delegated authorization.

Unlike static API keys, macaroons support caveats — logic-based restrictions baked directly into the token. SatGate can issue a token to an agent that says:

  • "This token is only valid for the next 60 minutes"
  • "This token can only call the GitHub_PR_Review tool"
  • "This token is capped at a total spend of $5.00"

And here's the critical property: macaroons are self-verifying. Using a root key and HMAC chain, SatGate validates a token in microseconds without hitting a database. At agent scale — thousands of tool calls per minute — this is the difference between a governance layer you can deploy and one that becomes a bottleneck.

A macaroon is a permission slip that can be narrowed but never widened:

Root Token (Acme Corp)
  └─ budget = 30,000 credits
  └─ expires = 2027-02-11
  │
  ├─ Division Token (Acme Digital)
  │   └─ budget = 8,000 credits  (narrowed from 30,000)
  │   └─ routes = /v1/chat/*
  │   │
  │   └─ Agent Token (CS Bot)
  │       └─ budget = 7,000 credits  (narrowed from 8,000)
  │       └─ routes = /v1/chat/completions
  │
  └─ Division Token (Acme Creative)
      └─ budget = 3,500 credits
      │
      └─ Agent Token (Design Generator)
          └─ budget = 2,500 credits
          └─ routes = /v1/images/*

Each level can only attenuate — add restrictions, reduce budgets, narrow scope. A division token can't grant more than its parent allocated. An agent token can't exceed its division's budget. This is enforced cryptographically, not by policy checks in a database.

When an agent hits its budget ceiling, SatGate returns a 402 Payment Required:

HTTP/1.1 402 Payment Required
Content-Type: application/json
X-SatGate-Budget-Remaining: 0
X-SatGate-Budget-Limit: 2500

{
  "error": "budget_exceeded",
  "message": "Agent 'acme-design-gen' has exhausted its budget",
  "spent": 2500,
  "limit": 2500
}

The agent stops. Gracefully. No runaway spend. No surprise bill.

What This Looks Like in Practice

We run a demo environment modeled on a real enterprise structure — a technology company with four divisions, each running multiple AI agents:

AgentDivisionMonthly SpendBudgetRole
CS BotAcme Digital$3,712$7,000Customer service (GPT-4o)
Design GeneratorAcme Creative$1,064$2,500Image generation (DALL-E 3)
Script AssistantAcme Media$571$1,800Script writing (Claude)
Safety ReviewAcme Creative$138$800Compliance checks (Claude)
Subtitle GenAcme Media$83$300Transcription (Whisper)
EmbeddingsCorporate$83$400Shared search (OpenAI)

The Design Generator spikes every Tuesday — batch jobs for weekly design reviews. Without per-tool attribution, that spike is invisible in aggregate API spend. With SatGate, the CFO sees exactly which agent, which division, which tool, and which day.

The revoked intern bot? Someone's experimental agent tried to escalate its own delegation permissions. SatGate caught the attempt, blocked it, and revoked the token. That's the security story: not just cost control, but agent governance.

The Three Modes: Observe → Control → Charge

Not every organization is ready to hard-block their agents on day one. SatGate supports a progressive rollout:

👁 Observe (Free)

Deploy as a transparent proxy. See what your agents are doing and what they're spending. No blocking, no enforcement. This is your "holy shit" moment when you see the actual numbers.

🎛 Control ($99/mo)

Turn on budget enforcement. Hard caps, per-tool cost attribution, cascade delegation. Agents that exceed their budget get a 402, not a surprise invoice.

💲 Charge (Custom)

Monetize your APIs with L402 micropayments over Lightning. Agents pay per-call with cryptographic proof of payment. Your MCP tools become revenue generators, not cost centers.

Most teams start with Observe. They come for visibility. They stay for control.

The Uncomfortable Truth

The MCP ecosystem is growing fast. Anthropic, OpenAI, and every agent framework is building tool-use capabilities. The number of agent-to-API interactions is about to explode.

Right now, the economic layer is an afterthought. Teams are discovering cost problems after deployment, after the bill arrives, after an agent loops 200 times against a paid API.

That's backwards. Economic policy should be as fundamental as authentication. You wouldn't deploy an API without auth. Why would you deploy agents without budgets?

Get Started

Open Source: The MCP parser and proxy middleware are open source. Deploy it, see what your agents are actually spending, and decide if you need enforcement.

# Install the CLI
clawhub install satgate

# Or via Claude Code
claude plugin marketplace add SatGate-io/satgate-cli

# Check your agent spend
satgate tokens
satgate spend

SatGate Cloud: Full per-tool cost attribution, delegation hierarchies, and budget enforcement. Sign up for the beta or talk to us about a design partnership.

Don't wait for the bill to learn how your agents behave.