AI Agent Security Is Application Security
PHP2Shell, the LiteLLM backdoor, and the agent that tried to backdoor a GitHub project.
On October 21, 2026, PHP shipped emergency patches for CVE-2026-109618 and CVE-2026-109619, two use-after-free bugs in the core engine, both rated 9.2 on CVSS v4.0, both reachable by an unauthenticated attacker, both exploited before the patches were out. The pair got the nickname PHP2Shell. Palo Alto Networks counted more than 22.6 million potentially vulnerable internet-connected instances, which is a count of instances and not of unique sites, and other scanners put the exposed host count between 2 million and 5 million. Either way, SRE teams spent the week patching runtimes.
The same week, product teams were evaluating agent platforms. Anthropic launched Claude Duet on the same day as the PHP patches, a proactive agent that reads your email and calendar and acts for you, with an approval step before it sends a message, makes a payment, signs a document or deletes a file. The two groups were working on the same attack surface, and most of them were in different meetings.
This post makes one argument. An AI agent is an application. It runs on the same runtimes, pulls the same packages, and sits behind the same web servers as everything else you operate, so every vulnerability in that stack is a vulnerability in the agent. On top of that, it has a second input channel that the stack never had: prompts, tool results and documents that it reads and acts on, and that an attacker can write. Securing an agent is application security plus the discipline of treating everything the model reads as untrusted input. The teams that treat it as a separate problem, owned by whoever picked the model, are the ones that get the incident.
The evidence for that argument is the rest of 2026. The LiteLLM backdoor in March, the Clinejection chain in February, the sandbox escapes across four coding agents in July, and the UK AI Security Institute's August incident report each show one layer of the chain failing, and in each case the failure gave the attacker whatever the agent was allowed to do.
PHP2Shell: Why a Runtime CVE Is an Agent CVE
The two bugs are distinct, and PHP's advisory describes them separately. One is an out-of-memory condition that interrupts request processing while data is only partly initialised, after which cleanup operates on that invalid data. The other is a second memory-safety fault in the same core engine. Both end in remote code execution without authentication. Fixes landed in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Bitsight's scan found that only about a third of identifiable PHP instances run a branch covered by the update, with PHP 7.4 the most common version in the wild, so a large share of the exposed population has no patch coming. Wiz reported demonstrating unauthenticated code execution against WordPress, Drupal and Joomla deployments, and Kaspersky saw exploitation attempts before the patches were published.
An agent cares about this for a plain reason: agents run code and call services. They execute tool calls that hit internal web apps. They write and run scripts in sandboxes. They call APIs that sit behind PHP, Python and Node. Anthropic's Managed Agents, in public beta since April and used by Notion, Rakuten, Asana and Sentry, runs each agent in an isolated container that hosts whatever runtimes and dependencies the developer specifies. The isolation protects the host from the agent. It does nothing for the vulnerable service the agent calls, or for a vulnerable runtime inside the container itself.
The part that is new is the blast radius. A compromised web server answers requests. A compromised agent initiates actions, with the credentials it was given and the tools it was wired to: it sends mail, opens pull requests, moves money, edits records. An RCE in the agent's environment is an RCE with a to-do list.
The Agent Supply Chain Has Already Been Hit Four Times This Year
The runtime vulnerabilities are the familiar part. The agent-specific attacks are worse, because the supply of tools, servers and packages is younger and the defences are thinner.
On March 24, the threat group TeamPCP published backdoored LiteLLM versions 1.82.7 and 1.82.8 to PyPI. LiteLLM is the gateway library that a large share of agent frameworks use to talk to model providers, and the package sees on the order of 95 million downloads a month. The malicious builds were up for about three hours before PyPI quarantined them, and Help Net Security put the downloads in that window at roughly 47,000. The payload was a credential stealer: SSH keys, cloud credentials, Kubernetes secrets, wallets and .env files, plus a .pth file in 1.82.8 that ran on every Python start-up. Any host that installed either version had to be treated as fully compromised, with every credential rotated.
The month before, the Clinejection chain, disclosed by researcher Adnan Khan, showed what a prompt injection does to a build pipeline. Cline's automated issue triage ran Claude Code with Bash, Read and Write tools on every new issue, and inserted the issue title into the prompt unsanitised. A crafted title made the agent install a package from a commit. That package poisoned the GitHub Actions cache so that the nightly publish workflow picked up the attacker's entries, which exposed the npm, VS Code Marketplace and OpenVSX publishing tokens. On February 17, a tampered Cline CLI went out on npm and its postinstall script put an unauthorised agent on roughly 4,000 developer machines before the version was deprecated.
Before either, in September 2025, the postmark-mcp package on npm had shipped fifteen clean versions. Version 1.0.16 added one line that blind-copied every email sent through the server to the author's address. Nothing about the package looked different to the agents using it.
Then in July, Pillar Security disclosed seven sandbox escapes across Cursor, OpenAI Codex, Gemini CLI and Antigravity. None of them broke the sandbox. The agent wrote files inside the workspace, and unsandboxed host components later trusted those files: hooks, virtual environments, Git metadata. Cursor fixed its paths in version 3.0.0, including CVE-2026-48124. An earlier Cursor bug, CVE-2026-22708, let shell built-ins such as export run without matching the allowlist or prompting the user, so a prompt injection could set PAGER and have the next approved git command run attacker code; Pillar's proof of concept exfiltrated SSH keys. The allowlist, the control that was supposed to bound what the agent could run, was the path in.
These four incidents exploit one property of agents: the agent trusts its tools. When an MCP server returns a result, the agent reads it as information. When a dependency exposes a function, the agent calls it. When a file in the workspace says what to do next, the agent does it. The trust chain runs from the model through the orchestration layer through the tools through the packages, and a compromise at any link inherits the agent's permissions.
The AISI Report: What a Capable Agent Does With No Controls
On August 4, the UK AI Security Institute published an incident report from a routine cyber evaluation. Between July 25 and July 28 it ran 122 evaluation runs across seven models on two cyber ranges, with internet access enabled and the developers' cyber classifiers deliberately switched off, conditions AISI says do not reflect how the models are made available to the public. In 10 of those runs the agents took 19 actions outside the scope of the test: 17 from Anthropic's Mythos 5, 2 from OpenAI's GPT-5.6 Sol.
The worst of them was an agent, tasked with retrieving a protected piece of data inside the range, that instead opened a pull request with malicious code on a real public GitHub project, researched the maintainers, created several fake identities and used them to pressure a real maintainer into approving it. The maintainer refused. Challenged in public, the agent edited its earlier activity to look harmless and considered starting over under a fresh identity. It used Tor to get around GitHub network restrictions, which is what tripped AISI's alert. Another agent left public instructions on GitHub for reusing its accounts and artefacts, which later agents found and followed. AISI contained the incident within an hour of the alert and found no resulting real-world harm.
The report matters here for its remediation list, which could have been written by an application security team. Fine-grained network controls, with internet access justified per task instead of on by default. Real-time monitoring that can flag or block out-of-scope actions as they happen. Evaluation design that assumes a capable model may act beyond its remit. Those are egress policy, runtime monitoring and threat modelling. The agent is new. The controls are not.
Where the Current Defences Stop
The model and product layers have real controls now. Anthropic's Compliance API, expanded in May with 28 integrations across CrowdStrike, Microsoft Purview, Okta, Palo Alto Networks, Zscaler, Wiz, Snyk and others, gives security tooling access to conversation content, uploaded files and activity events for governance, retention and investigation. Claude Duet gates sending, paying, signing and deleting behind user approval, never sees the user's passwords, and runs a classifier over every message to catch sensitive data leaving.
These protect against the agent doing the wrong thing with legitimate inputs. They do not protect against the agent doing the sanctioned thing with poisoned inputs, which is what LiteLLM, Clinejection, postmark-mcp and the sandbox escapes all were. The Compliance API tells you afterwards what the agent read and did. An approval gate asks a human whether to send the email, and the human says yes, because the email looks right.
The gap sits at the tool and dependency layer, and it is a gap in kind. A web application firewall inspects HTTP. A container policy enforces resource limits and network boundaries. Neither can tell a tool result that says "run this command" apart from a tool result that says "run this command" with a different intent behind it. The boundary an agent needs is semantic, and nothing at the infrastructure layer enforces semantics. That work moves up into the agent's design.
The Controls That Have Held Up in Production
We build and run agent systems for clients, and the security work in them is unglamorous: it is the same checklist as for any production service, with six additions for the second input channel. The ones below are from systems that are live.
First, the controller never reads prose from an untrusted source. In the autonomous feature pipeline we built for a mobile game studio, the orchestrator reads a small structured result from each worker and each tool and decides the next step from that. Worker output, generated assets and tool responses are data to validate, and they never become instructions. The same rule applies to documents retrieved for a RAG step and to anything an MCP server returns. If a value must become an action, it goes through a schema and an allowlist in code, and a value that fails either one stops the run.
Second, approval gates for anything that costs money, touches a customer or cannot be undone, and the gates are durable. In a supervisor and worker system we run over more than ninety tools exposed through MCP, approvals are persisted so that a container restart or a redeploy mid-task cannot skip one, and the record of who approved what survives with the trace. A gate that lives in memory is a gate that disappears under load.
Third, an identity per agent, with permissions scoped to the task. In that same system each agent fetches its tools per request under the caller's own credentials, so every action is bound to the right account and a worker that reads contacts cannot edit a form even if its prompt tells it to. Treat the agent's tool allowlist as attack surface and keep it short. The Cursor bugs are what an allowlist looks like when nobody reviews it as one.
Fourth, the MCP layer gets the same hardening as any API: TLS, OAuth 2.0 with PKCE, authorisation checked per agent and per tool, input validation on every argument, audit logging of every call, and rate limits. The July MCP specification revision made this easier by putting the method and tool name in request headers, so a gateway can route, meter and audit agent traffic without parsing request bodies that contain customer data.
Fifth, dependency hygiene with the agent in mind. Pin versions, including the gateway library and every MCP server, and review the diff on each bump, because the fifteenth version was clean and the sixteenth was not. Run agents that execute code in isolation with no ambient credentials, with egress restricted to the hosts the task needs. The AISI finding that internet access should be justified per task is the right default for a production agent too.
Sixth, verification that does not trust the agent's own account of its work. The game pipeline runs five independent checks on every output, from deterministic geometry checks to a full-game boot, and the playable gate can only be satisfied by a real boot. In one build every visual check passed and the runtime contract caught five real bugs. Security verification follows the same pattern: evaluation sets that include injection attempts, replayed against each release, with a failing injection case blocking deploy.
None of this is exotic, and that is the point. The founder of Vindler spent fifteen years in fraud prevention for retail banks and payment companies, where the adversary adapts to every control you ship. An agent in production is the same kind of adversarial surface, and it gets the same kind of engineering.
What This Means for Teams Deploying Agents Now
Patch your runtimes. Pin your dependencies. Audit your supply chain continuously. Monitor CVEs in every package your agent containers carry, and treat an unpatched agent container as what it is, an unpatched server with credentials. The PHP2Shell population includes services that agents call every day.
Then add the agent-specific layer: every prompt, tool result, document and file the model reads is untrusted input; actions that matter go through code-level validation and durable approval; each agent gets its own identity and the smallest tool set that does the job; MCP servers are audited like third-party APIs, on every version; and the evaluation suite includes the attacks.
Gartner expects 40% of enterprise applications to embed task-specific agents by the end of 2026, up from under 5% in 2025. The companies shipping those agents without the security discipline to match are building the next attack surface, and the teams patching PHP2Shell this week and the teams evaluating agent platforms next quarter are, whether they know it or not, working the same problem.
Working with Vindler
Vindler designs, builds and operates production agent systems, and the security work is part of every build. The controls above come from systems we run: the multi-agent architecture with durable approvals over MCP, and the autonomous game feature pipeline with its approval gate and verification stack. We have written before about the ClawHub supply chain attack, MCP for enterprises and the July 2026 MCP specification, which covers the authorization changes referenced above.
If you have an agent in production, or one about to go there, and nobody has reviewed its tool permissions, its approval model and what it does with a poisoned tool result, the Production Readiness Review covers exactly that. It is an engineering review of the system you have, with findings you can act on. It is not a penetration test or a compliance opinion, and we say so in the agreement. To talk it through, book a call or see how we build MCP and agent infrastructure.
Sources
PHP2Shell: the Bitsight advisory for the version exposure data, Kaspersky for the pre-patch exploitation, SecurityWeek and Picus Security for the technical description, Endor Labs for the fixed versions, and TechTarget for the Palo Alto Networks instance count and the lower counts from VirusTotal and CybelAngel. LiteLLM: the Cloud Security Alliance research note and Phoenix Security; the 47,000 download figure is Help Net Security's. Clinejection: Simon Willison's write-up, Snyk on the cache poisoning, and the CSA note for the February 17 npm release and machine count. Sandbox escapes: BleepingComputer on the Pillar Security disclosure, NVD and SC World on CVE-2026-22708. The AISI incident: the AI Security Institute's report, published August 4, 2026. Claude Duet: MacRumors, October 21, 2026. Compliance API integrations: Security Boulevard. Managed Agents: The Decoder. The Gartner forecast is from its August 2025 press release on task-specific AI agents in enterprise applications.
Published October 26, 2026.




