Guides
Field manuals for
agent governance.
Original, in-depth guides on AI agent cost control and authorization policies — how we think about spend caps, approval queues, policy simulation, forecasting, and lockdowns. No filler, no recycled takes.
How to Set AI Agent Spend Caps That Actually Stop Runaway Bills
9 MIN READPer-agent daily and monthly spend caps: the first defense against runaway AI bills. How to size them, hard blocks vs alerts, and failure modes teams miss.
The Human-in-the-Loop Approval Queue Playbook for Risky Agent Actions
8 MIN READNot every risky agent action can be denied outright. Routing rules, SLAs, mobile-friendly decisions and audit trails for human-in-the-loop approval queues.
Allowlists vs. Denylists: Writing Agent Action Policies That Hold Up in Production
10 MIN READAllowlists vs denylists for agent tool access: which default-deny posture holds up in production, and how to write action policies that survive real agents.
Forecasting AI Agent Spend: Predicting Your Monthly API Bill Before It Lands
9 MIN READPredict your monthly AI API bill before it lands. Burn-rate forecasting from live logs: sizing caps, spotting runaways early, and auto-throttle.
Step-Up Lockdown: Freezing a Misbehaving Agent Like a Bank Freezes a Card
8 MIN READFreeze a misbehaving agent the way a bank freezes a card: anomaly-triggered lockdowns where every action needs a human until the incident is released.
The Runaway Accounting Agent: About $50K in Under an Hour
5 MIN READMandiant documented a runaway accounting agent: over 15,000 paid API calls in under an hour, about $50,000. Missing: a spend ceiling and a kill switch.
How to Stop an AI Agent Runaway Loop
8 MIN READA LangChain multi-agent pipeline looped for about 264 hours and burned $47,000 in API costs. Dashboards and logs watched; nothing could refuse the next call.
AI Agent Budget Caps: Provider Caps vs Per-Agent Refusal
7 MIN READProvider spend caps and per-agent refusal both promise to stop runaway AI bills. They act at different points, on different clocks, with different blind spots.
What Is an Agent Kill Switch (and Where It Must Sit)?
6 MIN READAn agent kill switch blocks all future mediated actions for an agent, instantly. Where it must sit in the architecture, and how it differs from a pause button.
MCP Health Probe: Is Your MCP Server Reachable and Safe?
6 MIN READAn MCP health probe checks reachability, transport, auth posture, the tool inventory exposed, and whether its verdict is enforced. What each result means.
How to Set Spend Limits for a CrewAI Crew
7 MIN READCrewAI crews delegate, retry and re-plan in loops that multiply model spend. Per-agent caps, step budgets and a kill switch sized for multi-agent crews.
How to Control Spend in AutoGen Multi-Agent Chats
7 MIN READAutoGen conversations can talk themselves into thousands of turns. Turn budgets, per-speaker caps and termination controls that actually bound the bill.
How to Add Spend Guardrails to the OpenAI Agents SDK
7 MIN READAgents SDK runs chain tools and hand off between agents. Where run-level budgets, per-agent caps and approval gates sit when guardrails only validate.
How to Give Every AI Agent Its Own API Key
7 MIN READOne shared key means no attribution, no scoped stop and a fleet-wide rebuild on any leak. Issuing, scoping, storing and rotating per-agent keys, step by step.
Scoped Tokens for AI Agents: Least Privilege in Practice
7 MIN READShort-lived, narrowly scoped tokens beat standing god-keys for agents. How to scope by action, resource, amount and time — and how scopes fail when too wide.
How to Rate Limit an AI Agent (Calls, Tokens and Concurrency)
7 MIN READRate limits shape an agent's speed; spend caps shape its total. Setting calls-per-minute, token and concurrency limits that stop loops early.
What an Audit Log for AI Agent Actions Must Record
7 MIN READWhen an agent acts, the log is the difference between an answer and an argument. The fields every agent action log needs, retention, and tamper-evidence.
Multi-Agent Spend Attribution: Finding Which Agent Spent What
7 MIN READShared keys and pooled invoices hide which agent, run or customer drove the bill. Attribution by identity, run and delegation chain — and what to do with it.
How to Sandbox an AI Agent's Tool Calls
7 MIN READA sandbox limits where an agent's actions can land: filesystem, network, data and spend boundaries. Designing sandboxes that contain failures.
Human-in-the-Loop Patterns for AI Agents, Compared
7 MIN READApprove-everything burns out reviewers; approve-nothing burns down budgets. HITL patterns — pre-approval, sampling, escalation — and when each fits.
How to Allocate AI Agent Costs to Teams and Customers
7 MIN READAgent spend pooled at the account level cannot be priced, budgeted or argued with. Allocation by agent, run and customer — from logs to finance-ready numbers.
An Incident Response Runbook for AI Agents: The First Hour
7 MIN READWhen an agent misbehaves, improvisation is expensive. A first-hour runbook: stop, preserve, attribute, decide, release — with the evidence each step needs.
Budget Tripwires: The Warning Layer Between Normal and Capped
7 MIN READCaps stop spend; tripwires start conversations. Designing burn-rate, percentage and novelty tripwires that warn early enough to matter — and do not cry wolf.
Retry Storms: How Agent Tool Retries Multiply a Bill
7 MIN READA timeout is not a failure to an agent — it is an invitation to try again, at scale. Retry budgets, backoff and idempotency rules that end retry storms.
When Prompt Injection Spends Money: Bounding a Fooled Agent
7 MIN READInjected instructions cannot be reliably detected, but their spend can be bounded. Amount caps, destination allowlists and scoped tokens as containment.
MCP Authorization: Controlling Which Tools an Agent May Call
7 MIN READConnecting an MCP server gives every agent its whole tool catalogue. Per-agent MCP authorization: tool-level allowlists, argument limits and spend rules.
MCP Tool Poisoning: Defending Against Malicious Tool Descriptions
7 MIN READTool descriptions and results are content an agent reads — and may obey. Tool poisoning: what it looks like, and the inventory, pinning and policy defences.
Why AI Agents Need Their Own Identity, Not Yours
7 MIN READAgents acting under a human's credentials inherit that human's whole authority and leave that human holding the blame. Separate agent identities: what changes.
How to Rotate AI Agent Credentials Without Downtime
7 MIN READCredential rotation fails when it is improvised. The overlap procedure — issue, deploy, verify, revoke — plus the registry and rehearsal that make it routine.
Approval Fatigue: Why Your Reviewers Stopped Reading, and Fixes
7 MIN READWhen everything needs approval, nothing gets reviewed. Measuring approver fatigue, narrowing queues, batching safely and restoring real human judgement.
Designing Agent Spend Alerts That People Actually Act On
7 MIN READMost spend alerts are either silent until too late or noisy until muted. Alert design: baselines, thresholds, wording and escalation that survive 2 a.m.
Postmortem: The Agent That Ran All Weekend
7 MIN READFriday-evening deployments, empty offices and Monday invoices: the weekend runaway is a failure class of its own. Its timeline, causes and controls.
When Retrieval Eats the Budget: Controlling RAG and Embedding Costs
7 MIN READEmbedding and retrieval costs hide below the model bill until a re-index or a chatty retriever multiplies them. Controls for the quiet half of agent spend.
Model Routing as Cost Control for AI Agents
7 MIN READRouting every step to the biggest model is a pricing decision made by default. Tiered routing with quality sampling, escalation rules and per-tier caps.
Step Budgets and Iteration Limits for AI Agents
7 MIN READDollars lag; steps lead. Setting per-run step and iteration budgets from real run data, and what an agent should do when the budget ends mid-task.
Fail Closed or Fail Open? Defaults for Agent Authorization
7 MIN READWhen the policy layer cannot decide, the default decides. Which agent actions must fail closed, which may fail open, and how to choose per action class.
How to Dry-Run an Agent Policy Change Before It Ships
7 MIN READPolicy changes break agents quietly: a tightened rule can deny real work for a week unnoticed. Replay recorded decisions against a new policy first.
Delegating Authority to Sub-Agents Without Handing Over the Keys
7 MIN READSub-agents that inherit the orchestrator's full authority turn delegation into privilege escalation. Attenuated delegation: narrower scope, smaller budgets.
The Unit Economics of Agent Spend, Per Customer
7 MIN READAn AI feature that costs more to serve than it earns is a slow leak with good engagement metrics. Computing cost per customer, per task and per retained dollar.
Designing a Tool Allowlist an Agent Can Actually Live With
7 MIN READAllowlists fail two ways: too tight and the agent routes around them, too loose and they are decoration. Patterns for drawing, testing and evolving them.
Kill Switch Drills: Testing Your Agent's Stop Button
7 MIN READA kill switch that has never been pressed is a hope, not a control. Running stop drills and game days: who presses, how fast, what breaks, and what to record.
The Month-End Finance Review for AI Agent Spend
7 MIN READReconciling agent spend monthly: gateway totals vs provider invoices, cap breaches, approval exceptions and the questions finance should ask every agent owner.
Egress Controls for AI Agents: Where Your Data Is Allowed to Go
7 MIN READAgents exfiltrate through ordinary tools — a send here, a webhook there. Destination allowlists, payload inspection points and novelty rules for agent egress.
Secrets Your AI Agent Should Never See
7 MIN READAnything in an agent's context can be repeated, logged or extracted. Which secrets must stay outside the prompt — and the brokered-credential pattern.
Session Limits for Long-Running and Always-On Agents
7 MIN READAlways-on agents accumulate context, cost and quiet drift. Session budgets, context checkpoints, restarts and handovers that keep long-running work bounded.
Playbook: What to Do in the First Hour After an Agent Key Leaks
7 MIN READA leaked agent key is a timed event. Revoke, attribute, rotate, hunt the path: the ordered first-hour playbook, and the preparation that makes each step fast.
Agent Governance for Small Teams: The Minimum Viable Setup
7 MIN READFive people cannot run an enterprise governance programme, and do not need one. The five controls that give a small team real agent governance.
The Pre-Launch Authorization Checklist for a New AI Agent
7 MIN READTwenty checks before a new agent touches production: identity, caps, allowlists, approvals, logging, drills and the owner who answers for all of it.
Put the theory to work
Every technique in these guides — caps, queues, simulation, forecasting, lockdowns — is a feature in the gateway, not just advice.
How the guides fit together
Read in order, the library is one argument. The spend-caps guide comes first because a cap is the control that works while you sleep: it refuses the charge, not the report about the charge. The approval-queue playbook covers the actions a cap cannot judge, the ones that are legitimate at $40 and reckless at $4,000, and it is honest about queue fatigue, because a queue humans rubber-stamp is decoration. Allowlists versus denylists is the policy-writing guide, and it takes a side: allowlists fail closed and age better, denylists fail open and read better in a demo.
The second half is about seeing trouble early. The forecasting guide predicts the monthly API bill from run history before the invoice lands. The lockdown guide borrows the bank card freeze: step-up lockdown stops a misbehaving agent mid-run without killing the sessions that are behaving. The runaway accounting agent post-mortem, about $50K in under an hour, is the incident the whole library exists to prevent, and the kill-switch guide explains where that switch has to sit in the call path to matter at all. The MCP health probe closes the set with the reachability and safety checks a tool server should pass before an agent is allowed near it.
Frequently asked questions
Where should I start with the Agent Auth Gateway guides?
Start with the spend-caps guide. A cap that refuses an over-budget call is the one control that protects you at 3 a.m. without a human awake. Move to the approval-queue playbook once caps are in place, because the queue handles the judgement calls a number cannot.
Do the guides assume I already run the gateway?
No. Each guide teaches the technique on its own terms: the policy shapes, the thresholds, the failure modes. The gateway implements the same techniques as features, and the closing panel on this page links the docs if you want the product version after the manual one.
What is the runaway accounting agent guide about?
It is a post-mortem of an accounting agent that spent about $50K in under an hour through a retry loop nobody had capped. The guide reconstructs the loop, names the three points where a cap, a queue, or a kill switch would have stopped it, and prices each control against the loss.
How long are the guides?
Each guide page shows its own read time in minutes next to the title in the list above, and its publication date beside it. They are written to be finished in one sitting and used as references afterwards.