Prompt injection in AI agents
AI agents combine three things software rarely had at once: they read content from many sources, they make decisions based on it, and they hold the credentials to act on those decisions. A language model cannot reliably tell an instruction from data, so anything an agent reads can try to change what it does.
OWASP’s 2025 Top 10 for LLM applications puts that first. Its entry on prompt injection separates direct injection, where a user types something that changes the model’s behaviour, from indirect injection, where the instructions are hidden in a website or file the model reads. OWASP also says that, given how models work, it is unclear whether fool-proof prevention methods for prompt injection exist. That is the starting point for any agent: assume it can be fooled, and limit what happens when it is.
AI agent security risks
The documented security risks of AI agents fall into five groups.
- Prompt injection. Hidden instructions in an email, document, web page or tool result that the agent follows. OWASP lists it as LLM01.
- Excessive agency. OWASP’s LLM06 describes agents with more functionality, permissions or autonomy than the task needs, for example an agent that only needs to read a calendar but holds a token that can also send email.
- Sensitive information disclosure. The agent repeats or forwards data it should not, such as customer records, keys or internal documents. OWASP lists it as LLM02.
- Supply chain. Plugins, tool servers and models from third parties run with the agent’s access. The Model Context Protocol security guidance warns that local MCP servers run with the same privileges as the client and, without sandboxing and consent, allow arbitrary code execution.
- Credential misuse. Agents need keys to reach tools, and those keys leak through logs, prompts and misconfigured servers. The MCP guidance forbids token passthrough, where a server forwards a token that was issued for a different service.
And the same tools work for attackers. In November 2025, Anthropic reported that a group it assessed as Chinese state-sponsored used its agentic coding tool to perform 80 to 90 percent of an espionage campaign against about thirty organisations, succeeding in a small number of cases.
AI agent risk assessment
To judge whether an agent is too risky, check it against the lethal trifecta. Simon Willison’s test asks whether one agent has all three of: access to private data, exposure to untrusted content, and the ability to communicate externally. With all three, an attacker who gets instructions into the content can make the agent send the data out.
For each agent your business plans to run, write down:
- What data it can read. Customer records, email, files, source code, finance systems.
- What untrusted content reaches it. Inbound email, web pages, uploaded files, tickets from the public, other agents’ output.
- Where it can send things. Email, web requests, chat, file shares, other APIs.
- What it can change. Records, payments, permissions, code, devices.
- What credentials it holds, and for how long.
If all of the first three are present, remove one before going further. If the fourth includes anything irreversible, put a human approval in front of it.
Least privilege for AI agents
Limiting the damage an agent can do means narrowing its tools, its permissions and its paths out. OWASP’s guidance on excessive agency is specific:
- Limit the extensions an agent can call to the minimum necessary, and avoid open-ended ones such as a general shell or arbitrary URL fetch.
- Give each extension the least permission it needs, and run it in the context of the user it acts for.
- Require a human to approve high-impact actions.
- Validate every downstream request against policy rather than trusting the agent’s output.
- Log, monitor and rate-limit what agents do.
Pair that with credentials that expire on their own, scoped to one agent and one task, and with MCP servers installed only from sources you trust.
Local coordination and agent risk
Local coordination removes the leg of the trifecta that turns a manipulated agent into a breach. An agent that can only talk to known devices on a local network, and has no general route to the internet, has nowhere to send stolen data even if hidden instructions tell it to.
Offline Protocol gives agents that kind of network. Agents and apps on phones, computers and gateways advertise capabilities, discover each other and call each other request and response over Bluetooth LE, Wi-Fi and local IP, multi-hop across the mesh, with no broker and no internet. Every device proves itself with an Ed25519 key it generated, request and response bodies are sealed in an MLS session once one is confirmed, and each provider decides which requesters it serves. The SDK discovers providers; your application decides the policy. That is the division of labour that keeps agents useful: they coordinate freely with the devices around them, and the only path to the wider internet is the one you chose to give them.