Runtime policy, approval and audit for AI agents.Early access →

AI agent security:
securing systems that can act.

AI agent security is the discipline of constraining, authorising, observing and testing AI systems that can choose tools and cause effects in other systems.

The security boundary is wider than the model. A production agent can combine a model with retrieved content, memory, tool definitions, credentials, code execution, network access and business APIs. NIST treats AI risk management as a lifecycle activity, while OWASP and MITRE increasingly model agent-specific attack surfaces around tools, context, identity and execution. [1][3][5]

01 / EXECUTIVE SUMMARY

The useful mental model: bounded authority.

A chatbot mainly produces text. An agent can hold credentials, choose tools, read private data and change external systems. That changes the core question from “is the model behaving well?” to “what can this decision actually cause?” Model safety is still important, but it is no longer a sufficient security boundary once the model can trigger side effects. [3][4]

The safest architecture assumes that model reasoning can be wrong, manipulated or incomplete. The agent may propose an operation, but an independent control layer decides whether that operation is allowed, requires review or must be blocked. This is a standard security idea applied to a new execution model: separate decision-making from authority, and grant the minimum capability needed for the task. [6][7]

Core principleInfluence should not equal authority.

Untrusted text may influence what the agent wants to do. It should not be able to silently expand what the agent is permitted to do.

02 / THREAT MODEL

Threat-model the whole execution path.

The model is only one component in a chain of trust. Attackers can target user input, retrieved pages, documents, emails, tool output, memory, connector metadata, credentials, code execution and outbound network access. MITRE ATLAS now documents agent-relevant techniques involving tool invocation, context poisoning, tool-data poisoning, credential harvesting and exfiltration through tool use. [5]

A practical threat model separates two questions: what can influence the agent's decision? and what authority can the resulting decision exercise? If an attacker can influence reasoning but still cannot gain new privileges, reach a prohibited resource or send sensitive data to an unapproved destination, the blast radius is materially smaller.

Trust-boundary modelArchitecture
UNTRUSTED / PARTIALLY TRUSTED
user · web · email · files · RAG · tool output · memory
                         │
                         ▼
                 ┌───────────────┐
                 │   AI agent    │
                 │ reason / plan │
                 └───────┬───────┘
                         │ proposed action
                         ▼
TRUST BOUNDARY   ┌────────────────────────┐
                 │ identity + policy      │
                 │ resource + context     │
                 │ limits + approval      │
                 └───────┬────────────────┘
                     ALLOW│REVIEW│BLOCK
                         ▼
                 scoped credential
                         ▼
                 sandbox / egress
                         ▼
PROTECTED        API · database · SaaS · cloud · payment system
03 / ATTACK SURFACE

Source → attack → impact → control.

SourceAttackImpactControl
Prompt / contextGoal hijacking or instruction manipulationWrong plan or unauthorised tool requestTreat model output as a proposal; re-authorise before execution
Web, email, files, RAGIndirect prompt injectionAttacker-controlled text influences later actionsTrust labelling, provenance, scoped tools and runtime policy
MemoryPersistent context poisoningInfluence survives into future tasksMemory write policy, provenance, TTL and review
Tool outputTool-data poisoningAgent treats returned data as a new commandSchema validation and an independent decision for the next call
CredentialsPrivilege abuseA reasoning failure becomes real system accessShort-lived workload identity and narrow scopes
Generated codeUnsafe code executionSecret access, filesystem impact or arbitrary network callsSandboxing, resource limits and default-deny egress
Outbound networkExfiltrationSensitive information leaves the trust boundaryDestination allowlists, DLP and data-to-destination policy
04 / ATTACK CHAIN

How a normal task can become a privileged action.

Imagine a support agent that reads inbound email, checks customer records and can issue refunds. A customer email contains attacker-controlled instructions telling the agent to ignore the support task and issue a large refund. The attack begins as content, but becomes dangerous only because the agent has a path from text to a payment tool.

01Legitimate taskUser asks the agent to resolve a support email.
02Untrusted contentEmail contains an adversarial instruction.
03Privileged proposalAgent proposes a refund tool call.

A strong system does not need to prove that the model will never be influenced. It can interrupt the chain at capability boundaries: the support agent may be unable to issue refunds above a fixed threshold; high-value refunds may require human review; the payment credential may be minted only after an allow decision; and every attempted action can be recorded for investigation.

05 / DEFENCE IN DEPTH

No single control covers the whole agent.

Prompt hardening, model alignment and injection detection can reduce risk, but high-impact systems need independent controls across identity, capability, execution and monitoring. Google's published agentic-browser security architecture is a useful production example: it layers model-based checks with origin isolation, deterministic checks, user confirmations, injection detection and red teaming instead of relying on one classifier or system prompt. [11]

LayerControlPurpose
IdentityUnique workload identity per agent and environmentMakes actions attributable and supports per-agent policy
Least privilegeExpose only the tools, resources and operations neededReduces blast radius after manipulation or failure
Runtime authorisationEvaluate each sensitive action using agent, action, resource and contextSeparates model reasoning from permission to execute
Scoped credentialsUse short-lived tokens that match the approved operationLimits replay, lateral movement and over-broad connector access
SandboxingIsolate generated code and risky toolsContains host, filesystem and process impact
Egress controlsDefault-deny outbound destinationsLimits data exfiltration and attacker callbacks
Human approvalPause defined high-impact actionsAdds accountable judgement at consequential boundaries
AuditRecord request, policy inputs, decision, approver and outcomeSupports investigation, evidence and policy tuning
06 / IMPLEMENTATION

Put the enforcement point before the side effect.

NIST's ABAC model is a useful way to think about runtime agent authorisation: evaluate attributes of the subject, resource, requested action and environment. For an agent, that can mean agent identity, operation, target resource, environment, transaction value, data classification and destination. [7]

TypeScriptIllustrative policy gate
const decision = await policy.evaluate({
  subject: { id: "finance-agent-prod" },
  action: "issue_refund",
  resource: "payments.refunds",
  context: {
    environment: "production",
    amountGBP: 7500,
    customerRisk: "normal"
  }
});

if (decision.effect === "BLOCK") {
  throw new Error("Action blocked by policy");
}

if (decision.effect === "REVIEW") {
  return approvals.create({
    action: "issue_refund",
    amountGBP: 7500,
    reason: decision.reason
  });
}

const credential = await credentials.issue({
  operation: "issue_refund",
  ttlSeconds: 60
});

return payments.issueRefund(credential);

The same principle applies to code execution. If an agent can generate or run code, the runtime should be disposable or read-only, should not inherit host secrets, should enforce CPU/memory/time limits, and should deny arbitrary network egress. Google's zero-trust agent example uses sandboxing and restricted egress as independent controls outside model context. [10]

07 / TESTING

Measure security and benign task utility together.

AgentDojo evaluates tool-using agents across realistic tasks and security cases, and highlights an important practical problem: agents can also fail normal tasks without an attack. Security testing should therefore measure both missed attacks and over-blocking. [8]

01

Attack success

Did a prohibited action or information flow occur?

02

Benign task success

Can normal tasks still complete after controls are enabled?

03

False blocks

How often are legitimate actions denied?

04

Approval quality

Are the right actions escalated, with enough context for a reviewer?

05

Latency

How much delay does policy evaluation add?

06

Audit coverage

Can every attempted side effect be reconstructed?

08 / LIMITATIONS

Good architecture reduces risk; it does not erase it.

Runtime policy can itself be wrong. A policy may omit a resource, use poor labels or contain an over-broad exception. Identity infrastructure can be compromised. Human reviewers can approve the wrong action. Sandboxing can contain host impact while still allowing a legitimate-but-harmful business operation. Security therefore depends on several independent layers and on continuously testing the deployed system.

Research such as CaMeL demonstrates that capability and information-flow separation can offer stronger guarantees than prompt filtering alone, but stronger restrictions can reduce task coverage. Its original work reported 67% AgentDojo task completion under the described security design, illustrating the security-versus-utility trade-off rather than a universal solution. [9]

More recent system-level work argues that highly dynamic agents may still require replanning, carefully scoped learned security decisions and human interaction, and warns against treating benchmark success as proof that a broader production threat model is solved. [12]

09 / DEPLOYMENT CHECKLIST

Before an agent receives production authority.

✓Give every production agent a stable identity and separate identity by environment.
✓Inventory every tool, operation, credential, protected resource and outbound destination.
✓Split read, write, destructive and administrative capabilities.
✓Treat retrieved external content and tool output as untrusted by default.
✓Authorise consequential actions outside the planning model.
✓Apply hard transaction, resource and destination limits to high-impact operations.
✓Prefer short-lived credentials released only after an allow decision.
✓Sandbox generated code and browser/computer-use surfaces with restricted egress.
✓Require explicit approval for a small, defined set of consequential actions.
✓Log proposed actions, decisions, approvals and final execution outcomes.
✓Test indirect prompt injection, tool-output poisoning, memory poisoning, exfiltration and repeated-action abuse.
✓Re-run security tests whenever the model, prompt, tool schema, connector or policy changes.
RELATED RESEARCH

Prompt injection is one path into the agent. Authority determines the damage.

Continue with the prompt-injection guide for direct and indirect attacks, benchmark evidence and injection-specific mitigations.

10 / SOURCES

Primary research and standards.

Square-bracket references in the article map to the source list below.