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]
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.
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.
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 systemSource → attack → impact → control.
| Source | Attack | Impact | Control |
|---|---|---|---|
| Prompt / context | Goal hijacking or instruction manipulation | Wrong plan or unauthorised tool request | Treat model output as a proposal; re-authorise before execution |
| Web, email, files, RAG | Indirect prompt injection | Attacker-controlled text influences later actions | Trust labelling, provenance, scoped tools and runtime policy |
| Memory | Persistent context poisoning | Influence survives into future tasks | Memory write policy, provenance, TTL and review |
| Tool output | Tool-data poisoning | Agent treats returned data as a new command | Schema validation and an independent decision for the next call |
| Credentials | Privilege abuse | A reasoning failure becomes real system access | Short-lived workload identity and narrow scopes |
| Generated code | Unsafe code execution | Secret access, filesystem impact or arbitrary network calls | Sandboxing, resource limits and default-deny egress |
| Outbound network | Exfiltration | Sensitive information leaves the trust boundary | Destination allowlists, DLP and data-to-destination policy |
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.
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.
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]
| Layer | Control | Purpose |
|---|---|---|
| Identity | Unique workload identity per agent and environment | Makes actions attributable and supports per-agent policy |
| Least privilege | Expose only the tools, resources and operations needed | Reduces blast radius after manipulation or failure |
| Runtime authorisation | Evaluate each sensitive action using agent, action, resource and context | Separates model reasoning from permission to execute |
| Scoped credentials | Use short-lived tokens that match the approved operation | Limits replay, lateral movement and over-broad connector access |
| Sandboxing | Isolate generated code and risky tools | Contains host, filesystem and process impact |
| Egress controls | Default-deny outbound destinations | Limits data exfiltration and attacker callbacks |
| Human approval | Pause defined high-impact actions | Adds accountable judgement at consequential boundaries |
| Audit | Record request, policy inputs, decision, approver and outcome | Supports investigation, evidence and policy tuning |
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]
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]
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]
Attack success
Did a prohibited action or information flow occur?
Benign task success
Can normal tasks still complete after controls are enabled?
False blocks
How often are legitimate actions denied?
Approval quality
Are the right actions escalated, with enough context for a reviewer?
Latency
How much delay does policy evaluation add?
Audit coverage
Can every attempted side effect be reconstructed?
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]
Before an agent receives production authority.
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.
Primary research and standards.
Square-bracket references in the article map to the source list below.