To secure AI agent systems against misuse, start from what an attacker can make the agent do, not from what the model says. Misuse means the agent is made to act against its owner’s intent: a hostile user, a third party who planted instructions in content the agent reads, or a compromised tool or data source steers it toward an outcome nobody authorised. The defence is not a single filter or a cleverer prompt. It is a sequence of layers — separating untrusted content from instructions, scoping what the agent can reach, protecting the data and memory it holds, testing each misuse route, and watching the system in production — so that when one layer fails, the damage stays bounded. Every control below is judged by the same test: what can a misled agent still reach?
Secure AI agent systems: start with the misuse model
Begin by naming the misuse routes before choosing controls. Three properties of agent systems create the risk together: the agent acts on its own over several steps, it remembers things across sessions, and it can reach real tools and real data. A chatbot that only produces text has a different risk profile; an agent that can send mail, change records or run code turns a manipulated sentence into a real-world effect. The OWASP GenAI Security Project’s Top 10 for Agentic Applications 2026, published on 9 December 2025, is described in Cycode’s guide to the list as cataloguing ten risks for exactly this kind of system, numbered ASI01 to ASI10.
A useful test for spotting exfiltration exposure among those risks is the lethal trifecta named by Simon Willison in June 2025: access to private data, exposure to untrusted content, and the ability to communicate externally. An agent that combines all three can be tricked into reading private data and sending it to an attacker. As Willison puts it:
They will happily follow any instructions that make it to the model, whether or not they came from their operator or from some other source.
The underlying problem, in his account, is that language models cannot reliably tell how important an instruction is from where it came from: everything is glued together into one sequence of tokens. Use the trifecta to identify exfiltration exposure, then rank scenarios by the sensitivity of the data the agent can reach, the actions available to it, and the damage a misled session could do. Map who can write each piece of content the agent reads, what data the agent can reach in the same session, and every route by which information can leave — including image loads, links and tool calls, not only messages the agent sends.
Separate untrusted content from instructions

Prompt injection is the first route to close, and it has two distinct forms. In direct injection, the user of the application is the adversary and writes hostile input. In indirect injection, the user is trusted, but the agent processes third-party content — a web page, an email, a document, a support ticket, a tool result — that contains adversarial instructions. The second kind is a significant exposure for any agent that processes external content, because reading outside content is part of its job. OpenAI’s agent safety guidance defines prompt injection as untrusted text or data entering an AI system whose malicious contents attempt to override instructions to the AI, with goals that can include exfiltrating private data through downstream tool calls or taking misaligned actions.
The control is structural, not rhetorical. Treat everything the agent reads from outside its own instructions as data, never as instructions, including tool results and retrieved documents. Keep instructions and data in separate channels where the platform allows it: OpenAI advises passing untrusted inputs through user messages rather than developer messages, because developer messages take precedence, and designing workflows so untrusted data never directly drives agent behaviour. Extract only specific structured fields — enums or validated JSON — from external inputs, and validate tool outputs against the schema the workflow expects before the agent acts on them. A fixed schema for what comes out of an untrusted step illustrates the idea:
{
"type": "object",
"properties": {
"intent": {"type": "string", "enum": ["summarise", "escalate"]},
"ticket_id": {"type": "string"}
},
"required": ["intent", "ticket_id"],
"additionalProperties": false
}The schema does not make the content trustworthy, and declaring additionalProperties false does not by itself remove anything: the workflow must explicitly validate each output against the schema and reject anything that does not conform. Even a conforming output can still carry hostile content inside an allowed string field, so values must be independently validated and authorised before they are passed to a tool call. The standard to aim for is the one quoted by Willison from research on securing agents against prompt injection: once an agent has ingested untrusted input, it must be constrained so that it is impossible for that input to trigger any consequential actions.
EchoLeak shows why this layer matters even when filters are present. It was a zero-click prompt injection vulnerability in Microsoft 365 Copilot, tracked as CVE-2025-32711 and scored CVSS 9.3, in which a single crafted email enabled remote, unauthenticated data exfiltration. The attack chained bypasses of Microsoft’s cross-prompt-injection classifier, link redaction, image redaction and a content-security-policy proxy, so sensitive details from the user’s context were embedded in an outbound reference that loaded without a click. Model-level resistance helps, but it is not a control on its own. Anthropic reports that Claude Opus 4.5 achieved a 1% attack success rate against prompt injections in browser use in its internal adaptive evaluation, after training, classifier and red-teaming work — and adds:
No browser agent is immune to prompt injection, and we share these findings to demonstrate progress, not to claim the problem is solved.
A 1% success rate still represents meaningful risk when the agent can act. Treat classifiers and refusal behaviour as one layer, and assume an injection will sometimes get through to the next layer.
Scope tools, identity and permissions to the task

If an injection succeeds, the next question is what the agent can do with it. That is decided by tool scope, identity and permissions, and it is where most of the damage is either prevented or allowed. Cycode’s summary of the OWASP list names this as ASI02, tool misuse and exploitation — a legitimate tool bent toward an illegitimate outcome, including safe tools chained into an unsafe sequence — and ASI03, identity and privilege abuse. The primary defences the summary pairs with them are least-agency tool scoping with parameter validation, and per-agent identity with short-lived, scoped credentials.
Apply least privilege per task, not per agent in general. Grant only the tools, data sources and scopes the specific job needs, and re-scope when the job changes. Give each agent its own identity rather than a shared service account or a borrowed human login, so its actions can be attributed and its credentials revoked without breaking other work. Keep credentials outside the model’s context: short-lived, task-scoped tokens issued by a broker outside the agent’s view, expiring automatically, are the pattern to aim for. Require human approval before irreversible, high-cost or externally visible actions — sending mail, deleting records, spending money, publishing changes — and make the approval bind to the exact call, not to a vague intention.
Separate the agent that reads untrusted content from the component that acts. An agent that ingests web pages, mail or tickets should propose an action; a separate, controlled component should approve and execute it. That separation breaks the most dangerous combination directly: the reader holds the untrusted content but not the power, and the actor holds the power but never sees the raw payload as an instruction. A written permission policy makes the scoping reviewable. In outline form, it might look like this:
{
"agent": "support-triage",
"tools": [
{"name": "read_ticket", "allowed": true, "approval": "none"},
{"name": "send_email", "allowed": true, "approval": "human"},
{"name": "delete_record", "allowed": false, "approval": "never"}
],
"credentials": {"scope": "task-only", "lifetime": "session"},
"network": {"egress": ["helpdesk.example.invalid"]}
}The example is an illustration of the shape of a policy, not a configuration for any particular product; the values are placeholders for a review, and the point is that every tool, credential lifetime and network destination is named before the agent runs.
Protect data, memory and communication from misuse
Three further surfaces need their own controls, because scoping tools does not by itself stop data leaving or poisoned state steering later decisions. The first is data itself. Set classification boundaries the agent cannot cross: what it may read, what it may return, and what it may pass to any tool. Watch the quiet exfiltration routes, not only the obvious ones. EchoLeak exfiltrated data through an image reference that loaded automatically; any channel that contacts another computer — a web request, an image load, a link a person is offered to click — can carry data out. Keep private data and outbound channels apart in the same session wherever the design allows, and check rendered output for links and images that carry parameters the user did not ask for.
The second surface is memory. Cycode’s summary of the OWASP list names memory and context poisoning as ASI06: stored context is corrupted and steers later decisions. Validate data before it enters persistent memory, isolate memory by user or session so one user’s poisoned entry cannot steer another’s, and set expiry or review for stored context rather than letting it accumulate indefinitely. Treat a memory write as a consequential action in its own right, because a single poisoned entry can outlive the session that created it and shape every session after it.
The third surface is communication — between agents, and with the supply chain behind the tools. Cycode’s summary of the OWASP list names insecure inter-agent communication as ASI07, with mutual authentication and signed messages as the primary defence, and agentic supply chain vulnerabilities as ASI04, with signed components, provenance and an AI bill of materials. Authenticate every participating agent, authorise which agents may delegate to which others, and verify tool and connector sources before the first connection. One case reported in the Cycode guide involved a command injection in the mcp-remote connector package, CVE-2025-6514, scored CVSS 9.6, in a package downloaded more than 437,000 times. An agent that discovers and loads new tools at runtime has a supply chain that keeps changing after deployment, so provenance checks and an inventory of every component the agent can load belong in the operating routine, not in a one-off review.
Test the system against misuse, not just against good inputs
Controls that have never been attacked are assumptions. Test each misuse scenario directly, with adversarial cases built for the route. For injection, plant instructions in retrieved content and in tool outputs, not only in direct user prompts, and include the quiet exfiltration forms: a reference-style link or image carrying data, a tool result that tells the agent to widen its scope, a stored entry that tries to steer the next session. For tool misuse, give the agent a task that needs only a narrow, low-privilege call and check whether it stays inside it. For identity, attempt the inherited-credentials path: an action the agent takes with credentials it inherited rather than credentials scoped to its task.
Measure what the control did, not what the model said. A refusal in words is not evidence that the tool call was blocked, the data stayed put, or the log recorded the attempt. Record, for each test, whether the consequential action happened, what reached the outside world, and what the audit trail shows. Anthropic’s account of its browser-agent work describes the same discipline from the builder’s side: training to resist injection, classifiers over untrusted content, and scaled expert human red teaming, with researchers continuously probing for creative attack vectors that automated systems miss. Re-test after every material change to tools, permissions, prompts or data sources, and re-run the lethal trifecta test whenever a tool, connection or data source is added to a session.
Frame the programme with the NIST AI Risk Management Framework’s functions in mind: Govern sets who is accountable, Map establishes the system’s context and risks, Measure assesses them through testing and monitoring, and Manage acts on what the testing finds. The framework, published as NIST.AI.100-1 in January 2023, is voluntary guidance, but its loop — map, measure, manage, and repeat when the system changes — is the shape a misuse-testing routine needs.
Monitor, log and stop misuse in production
Production is where a misuse attempt becomes an incident, and the controls there are detection, evidence and stopping power. Log every tool call, approval decision and outcome, with the identity of the agent and the user or task it acted for, in a form the agent itself cannot rewrite. Cycode’s summary of the OWASP list pairs rogue agents, ASI10, with behavioural monitoring and kill switches, and cascading failures, ASI08, with blast-radius isolation and circuit breakers. A baseline of normal tool sequences helps identify unusual chaining, and policy violations, scope crossings and other explicit control failures are independent detection signals that do not depend on a baseline: a call that crosses a data boundary is visible as a violation whether or not its sequence is unusual.
Watch for the signals that matter: tool calls in sequences no legitimate task produces, calls that cross the data boundaries set in the previous section, and spend or rate anomalies that suggest a loop or an exfiltration attempt. Google’s Secure AI Framework 2.0, which extends the framework with guidance on agentic AI risks and controls, is summarised as resting on three agent controls that fit this section directly: user approval for actions that alter user data or act on the user’s behalf, permissions limited to the tools and data strictly necessary for the task at hand, and observability over the agent’s actions, tool use and reasoning. Limiting is useless if no one can see what happened, and seeing is useless if no one can stop it.
Build the stop before it is needed: a kill switch that revokes the agent’s credentials and halts its tool access, a rollback procedure for changes it made, and an incident path that starts with preserving the logs and revoking the tokens, all practised before a real incident. Test the kill switch under load, including the case where the agent is mid-task, and confirm that stopping one agent does not silently leave a second agent holding the same credentials and the same poisoned memory.
What securing an agent against misuse cannot guarantee
No published control set eliminates prompt injection entirely. The layers in this article bound the damage and raise the cost of an attack; they do not remove the underlying ambiguity that instructions and data arrive as one stream of text. OpenAI’s safety guidance says the same thing in its own terms: even with its mitigations, agents will not be perfect and can still make mistakes or be tricked, so caution is needed in what access agents are given and how they are applied. Any claim that a filter or classifier catches every attack should be treated with the same scepticism Willison applies to guardrail products: in web application security, catching most attacks is a failing grade when the missed ones carry data out.
The common mistakes are the ones that quietly reopen closed routes: broad standing permissions granted just in case; shared credentials that impair agent-specific attribution and make selective revocation difficult or disruptive, where revoking access does not roll back an action already completed; a refusal treated as proof that a control held; logs the agent can alter, or no logs at all; a new tool added without re-running the trifecta test, so a previously safe session quietly gains the third leg. Each is a design decision, and each is fixable in the same sequence this article follows: separate, scope, protect, test, monitor.
Escalate beyond this general sequence when the stakes demand it: high-value, regulated or multi-tenant deployments, agents acting on financial or safety-critical systems, and any system where a single manipulated turn could reach irreversible effects at scale need dedicated security review and formal threat modelling. For everything else, the sequence still applies. Secure the system in layers, assume an injection will sometimes succeed, and make sure that when it does, the agent it misleads can reach very little, is watched closely, and can be stopped fast.












