Runtime security for an AI agent means enforcing limits outside the model, at the moment each action is attempted. Policies, system prompts and pre-deployment reviews shape what an agent is meant to do. Only runtime controls constrain what it does when something goes wrong.
The distinction matters because an agent is not a fixed program. It reads context, chooses its next step, calls a tool, reads the result and chooses again. What it does depends on content it meets while running, and some of that content is written by people who do not work for you.
The model proposes; something else decides
OWASP’s guidance on Excessive Agency makes the central design point plainly: enforce authorization in the downstream systems instead of trusting the model’s judgment about what is allowed. Its guidance on sensitive information disclosure adds a warning that matters for anyone relying on prompt wording as a control. Instructions in a system prompt that restrict what the model returns may not always be honored and can be bypassed through prompt injection.
Together these set the rule for the rest of this article. A system prompt states intent. A control that can be talked out of its job is not a control. Anything that must hold has to be enforced by a component the model cannot persuade.
Seven runtime control points
The table maps the places where an agent’s behavior can be observed or limited while it runs. It is an architectural synthesis built on OWASP, NIST and Model Context Protocol guidance, not a certification checklist.
| CONTROL POINT | QUESTION IT ANSWERS | WHAT IT LOOKS LIKE IN PRACTICE | GROUNDING |
|---|---|---|---|
| Tool gateway | Is this call allowed for this agent, this user and this context, right now? | A policy decision point outside the model, deny by default, with parameters validated and policy that can change when the agent’s context or tool access changes. | OWASP Excessive Agency; NIST NCCoE concept paper |
| Credentials | What authority does the agent hold during this task? | Short-lived, narrowly scoped tokens bound to the service they are meant for, with privilege stepped up only when a sensitive operation needs it. | MCP security guidance on scope minimization and token audience |
| Execution isolation | Where does code or a tool run, and what can it touch? | Sandboxed execution with minimal default privileges and restricted file system and network access. | MCP guidance on local server compromise |
| Egress | Where can data go? | Outbound traffic through an egress proxy with destination allowlists, and blocks on private and link-local address ranges, including cloud metadata endpoints. | MCP guidance on request forgery |
| Human approval | Which actions need a person? | Approval triggered by consequence, such as irreversible or boundary-crossing actions, with the data and destination shown. | OWASP Excessive Agency |
| Observability | What did the agent see, decide and do? | A trace that links input content to tool call to effect, kept tamper-resistant and traceable to the authorizing human. | NIST NCCoE concept paper |
| Containment | How do we stop it, and how far has it gone? | The ability to revoke credentials, suspend sessions and quarantine agent memory quickly. | Derived from the controls above |
Two properties that make agent runtime different
Context is part of the attack surface
Agents carry state: retrieved documents, tool results, memory that persists across sessions. OWASP’s agentic list treats memory and context poisoning as a distinct risk because anything an attacker plants there can influence later actions, long after the original input has gone. Runtime security therefore has to cover what an agent remembers as well as what it does. That means provenance on memory entries, limits on what can be written to long-lived memory, and the ability to roll memory back during an investigation.
Autonomy compounds mistakes
A single bad step in a multi-step task becomes the input to the next step. OWASP’s agentic list also separates out cascading failures and rogue agents as their own categories. The implication for design is containment by default: limit how many steps an agent may take without a checkpoint, and limit how far one agent’s output is trusted by another.
Where runtime controls fall short
A gateway that checks each call cannot judge intent. A sequence of individually allowed calls can still add up to a leak, which is why policy has to reason about session history and not only the current request. Policy also sprawls. Every new tool needs rules, and a rule set nobody can read is a rule set nobody trusts.
Coverage has gaps too. The OpenID Foundation’s paper on identity for agentic AI points out that browser-based and computer-use agents can bypass API-based authorization entirely by working through the user interface. A tool gateway that governs API calls says nothing about an agent clicking through a web application as the user. Those agents need isolation and egress controls first, because the policy layer cannot see what they do.
The standards are also still forming. NIST’s National Cybersecurity Center of Excellence has published a concept paper and asked for industry input on agent identification, authorization, auditing and prompt-injection controls. That is a signal about maturity: plan for components you can replace as the guidance settles.
Sequencing the work
Not every agent justifies every control. A reasonable approach, offered as a recommendation, is to tier agents by two factors, how much autonomy they have and how bad their worst action could be, then apply controls in this order:
-
Enumerate every agent in use, including those teams built themselves, with its tools, data and owner.
-
Move enforcement out of the model for the highest-consequence tools first, with deny-by-default policy.
-
Shorten credential lifetimes and narrow scopes so a hijacked session expires and cannot reach far.
-
Control egress, since leaks need a way out.
-
Log enough to reconstruct an incident, including the content that preceded each action.
-
Rehearse containment. Practice revoking an agent’s access and clearing its memory before an incident forces the first attempt.
A five-question test
For any agent in production, a security team should be able to answer the following within an hour:
-
What can it reach right now?
-
What did it do overnight, and what had it read before it acted?
-
Who authorized it, and on whose behalf is it acting?
-
How would we stop it immediately?
-
What does it remember, and could someone have planted it?
Where the answer to any of these is “we would have to ask the team that built it”, the runtime layer is not yet there.
Where to start
| Take your highest-consequence agent and walk it through the seven control points above. The gaps you find, especially in enforcement outside the model and in containment, show where runtime security work should begin. |
Sources
-
OWASP GenAI Security Project: Top 10 for LLM Applications, Excessive Agency — OWASP
-
OWASP GenAI Security Project: Top 10 for LLM Applications, Sensitive Information Disclosure — OWASP genai.owasp.org
-
OWASP GenAI Security Project: Top 10 for Agentic Applications — OWASP genai.owasp.org
-
Model Context Protocol: Security Best Practices — Model Context Protocol project
-
Accelerating the Adoption of Software and AI Agent Identity and Authorization (concept paper) — NIST National Cybersecurity Center of Excellence
-
Identity Management for Agentic AI — OpenID Foundation, AI Identity Management Community Group openid.net
How we label evidence
Facts carry a source. Analysis and recommendations are marked as ours. Examples that are hypothetical are labeled as hypothetical.
Part of the solutionSecure AI & Emerging TechnologyAdopt AI and new platforms without opening new gaps.See how we work →Related service
Agentic AI Security
Use this to assess autonomous-agent security risk.