Agentic API Security
The caller is no longer a person. The identity, task-scoping, reversibility gates, and observability an API estate needs once autonomous agents hold the credentials.
5 concepts 4 decision paths Diagrams
The threat model and the four controls
Yesterday's question
Not wrong, just no longer sufficient. Every control built on it — session logging, per-user rate limits, behavioural baselines — quietly assumes the authenticated party is also the deciding party. An agent is the first caller for which that stops being true.
Identity
The question most estates have already answered, and the reason this is easy to miss: an agent passes authentication perfectly, because it holds a credential somebody legitimately issued. Nothing about the handshake looks wrong. Authentication was never going to be the control that caught this.
Intent
A person's next request is roughly predictable from their last one. An agent's next request is whatever its planner decided gets it closer to the goal — which means "is this call normal for this caller?" needs a baseline built from agent runs, not from user sessions.
Scope
Not "what is this identity entitled to?" but "what does this task need, for as long as it runs?" The gap between those two questions is standing access, and standing access is the multiplier on every other risk on this page.
Blast radius
The question you answer in advance or during an incident, and it is a very different exercise on the day. Ask it as a single number: if one agent token leaked tonight, what is the worst it could do before anyone noticed?
Boxes marked with a open a note.
Yesterday's question
Not wrong, just no longer sufficient. Every control built on it — session logging, per-user rate limits, behavioural baselines — quietly assumes the authenticated party is also the deciding party. An agent is the first caller for which that stops being true.
Identity
The question most estates have already answered, and the reason this is easy to miss: an agent passes authentication perfectly, because it holds a credential somebody legitimately issued. Nothing about the handshake looks wrong. Authentication was never going to be the control that caught this.
Intent
A person's next request is roughly predictable from their last one. An agent's next request is whatever its planner decided gets it closer to the goal — which means "is this call normal for this caller?" needs a baseline built from agent runs, not from user sessions.
Scope
Not "what is this identity entitled to?" but "what does this task need, for as long as it runs?" The gap between those two questions is standing access, and standing access is the multiplier on every other risk on this page.
Blast radius
The question you answer in advance or during an incident, and it is a very different exercise on the day. Ask it as a single number: if one agent token leaked tonight, what is the worst it could do before anyone noticed?
Boxes marked with a open a note.
Agent, acting "as the user"
The default in most assistant integrations, because it is the path of least resistance: the agent already has the session, so it just uses it. Nothing is misconfigured. The design is the problem.
Full standing access
Two failures for the price of one. The agent inherits everything the person can reach rather than what the task needs — and the audit trail names the person, so the first thing an investigation does is question an employee about calls they never made.
Agent, with its own identity
Issued to the agent, not borrowed from a human, and revocable without disabling anybody's account. That independence is the whole point: containment should never require taking a person offline to stop a process.
Verify every call
Never trust by network position, verify every call, assume the credential eventually leaks — zero trust, written years before this caller existed and describing it exactly. The enforcement point is a place calls already pass through, so the policy lives somewhere it can actually be changed.
Short-lived, narrow, revocable
Three properties that compound: a short life caps how long a leaked token is worth stealing, a narrow scope caps what it reaches while it lives, and revocability caps the incident once you know. Any one alone leaves an obvious hole.
Boxes marked with a open a note.
Role scope
Built for humans, and defensible for them: a person's job is stable, so their access can be too. An agent's "job" changes with every task it picks up, so a role is always the union of everything it might ever need — permanently granted.
Task scope
The credential is minted for one job and expires with it. "Nothing else exists" is literal — the agent should not be able to enumerate the endpoints it was not given, because discovery is the first half of most incidents.
Per-agent quota
Set from what the task actually needs plus headroom, not from what the platform can survive. A ceiling tuned to infrastructure capacity is one a runaway agent will happily sit just underneath for hours.
The runaway curve
Rarely an attack. Far more often a retry loop, a mis-specified goal, or a pagination bug — an agent doing exactly what it was told, faster than anyone expected. That is why the ceiling has to be automatic: nobody is watching the graph at 3am.
Boxes marked with a open a note.
Reversible actions
The lane where autonomy pays for itself, and where most of the useful work lives. Reversible does not mean harmless — a wrongly flagged record still costs someone time — it means a mistake can be undone without an apology to a customer.
The reversibility line
Drawn on the axis of "can this be undone?", not "how much do we want to automate it?" — those two orderings disagree constantly, and the second one is how gates end up in front of the cheap actions and nowhere near the expensive ones.
Irreversible actions
The test is whether an apology is required to undo it. Payments, deletions, permission changes and anything that leaves the building all fail it — and so, quietly, does anything that triggers a downstream system you do not control.
The human gate
Cheap only if the agent does all the work first and the human is approving a finished, legible proposal. A gate that asks someone to reconstruct what the agent intended is a gate they will rubber-stamp within a fortnight.
Boxes marked with a open a note.
One task
The unit that matters, and the one most logging pipelines have no concept of. Without a task identifier stamped on every call, a run is only reconstructable by timestamp — which stops working the moment two agents are busy at once.
Many calls
Each one individually unremarkable: valid credential, permitted endpoint, sensible payload. The signal is in the sequence — the order, the rate, and the combination — none of which survives logging each request in isolation.
One coherent trace
Log at the granularity of the agent's decisions, not just the HTTP calls: what it asked for, what came back, what it did next. The decision is the part that explains the behaviour, and it is the part a request log never captures.
Boxes marked with a open a note.
Decision framework
Frequently asked questions
How does agentic AI change API security?
It breaks the assumption the whole edifice rests on: a known identity with predictable behaviour on the other end of the call. An agent authenticates perfectly — it holds a valid credential — but it is a goal-seeking system that will call your APIs in whatever sequence, at whatever volume, in whatever combination gets it closer to its objective. So the question shifts from "is this caller who they say they are?" to four: identity, intent, scope, and blast radius. Most estates have solved the first; the other three are where the work is now.
Should an AI agent act with its user's credentials?
No. An agent wearing a human's credentials is an autonomous system with the full standing access of that person — and an audit log that says the person did it. Agents need machine identities of their own: issued, scoped, and revocable independently of any human, with short-lived tokens and no standing access beyond the task in front of them. Treat an agent identity the way you would treat a microservice you don't fully trust, because zero-trust principles were written for exactly this caller.
What does scoping an agent's access actually look like?
Narrow, ephemeral, and task-bound rather than role-shaped. An agent processing refunds gets a credential that can read order history and issue refunds below a threshold — and that is the entire universe it can touch. It cannot read payroll, delete records, or reach endpoints that were never part of the job, and when the task ends the scope ends. Rate limits become a real control at the same time: per-agent quotas, per-endpoint limits, and circuit breakers catch a runaway agent before it empties a table or runs up a bill.
Which agent actions should require human approval?
Sort actions by reversibility. Reading data, drafting a message, flagging a record for review — reversible, low blast radius, let the agent run. Issuing a payment, deleting customer data, changing a permission, sending something that cannot be unsent — irreversible, so it routes through a human checkpoint: the agent does the work up to the gate, presents what it is about to do, and waits for a yes. The boundary has to live in the system rather than a policy document, and it starts tight — widen the autonomous lane only as measured performance earns it.
What should we log when agents call our APIs?
The agent's decisions, not just the HTTP requests. Which agent, which task, which credential, what it asked for, what it got back, what it did next — tied together so a single agent run reads as one coherent trace rather than scattered log lines reassembled mid-incident. This feeds detection, because anomalous agent behaviour looks nothing like anomalous human behaviour, and it decides the aftermath: the difference between a contained incident and a catastrophe is whether "what exactly did it touch?" takes minutes to answer or days.
Where should we start with an existing API estate?
With the irreversible actions — payments, deletions, anything that touches a customer. Put explicit gates and per-agent scopes around those first: they are the smallest surface and the highest stakes. Then give every agent its own identity, instrument the calls so you can see what they are doing, and tighten outward from there. The mindset shift is the whole thing — stop asking only whether the caller is authenticated, and start asking what it intends, what it is scoped to, and what it can break.
Diagrams
Embed these freely — each SVG is licensed CC BY (opens in a new tab) with attribution to this page baked in.