Your AI agent trusts everything it reads
What a year and a half of attacks on AI agents shows about where the damage comes from, with the numbers, and the controls I'd put on any agent before it goes out.
PROMPT INJECTION: Hidden text in a post takes over the agent Its author can reach whatever the agent can
In May 2026, someone replied to a post on X with an encoded instruction. Grok read the reply and tagged Bankrbot, a bot that carries out crypto transactions when it's tagged, and Bankrbot sent about 3 billion DRB tokens, roughly $204,000 (MetaMask). The funds were later returned. In the twelve months before that, a single email could get Microsoft 365 Copilot to hand over company data without anyone clicking anything, a GitHub issue title set off a chain that ended in a poisoned release of a coding tool, and an audit of a marketplace of add-on skills for AI agents found 341 malicious ones. Every one of those agents was doing the job it was built for, reading what came in and acting on it, and in each case what came in was written by an attacker.
Language models can't reliably tell the content they're reading from the instructions they should follow, since both arrive as text in the same context window. Instructions hidden in content an AI reads are called prompt injection, and OWASP still ranks it the top risk for LLM applications in its 2026 list. The gap exists in every model, and no patch closes it for good, because an injection can be written in plain English. I ran into it building a scraper for Moltbook, a social network where AI agents post and reply to each other. Every post it fed my model was written by some other agent, nothing in the model reliably separated reading a post from obeying it, and I killed the project after a few days. Since then, my first question about any agent, mine or one a vendor is selling, is what it can do right after it reads something it didn't write, and whose keys it's holding when it does.
The damage matched the access the agent already had
Four incidents, August 2025 to May 2026.
1.5M
agent API tokens exposed
Moltbook's database was left open. Any one token was enough to take over that agent.
SOURCE: WIZ
2,349
secrets leaked
Malicious Nx versions told the AI tools already installed to hunt for secrets. Many refused.
SOURCE: GITGUARDIAN, VIA HACKREAD
700+
organizations' Salesforce data opened
Attackers used stolen login tokens that Drift's AI chat agent used to reach Salesforce.
SOURCE: HELP NET SECURITY
about$204,000Returned
sent by an agent
Grok read an encoded reply on X and tagged Bankrbot, which sent it.
SOURCE: METAMASK
Some of the largest numbers here involved no injection at all.
Five ways in, and what each one reached
An email the assistant read on its own
EchoLeak (CVE-2025-32711) needed one email and no clicks. Microsoft 365 Copilot reads a user's mail so it can answer questions about it, and a crafted message sitting in the inbox could get Copilot to pull company data out with no action from the user. It scored 9.3 out of 10 on CVSS, the standard severity scale, and Microsoft patched it in June 2025. In September 2026, Salt Labs reported the same kind of opening in Manus, an AI agent that can be connected to a user's other accounts (SQ Magazine). Disguised instructions in an email got the researchers code execution, then tokens for the victim's connected Gmail, Drive and GitHub. An assistant with an inbox in scope takes input from anyone who can send that person mail, and every account connected to it is within reach of that input.
A title on a GitHub issue or pull request
Cline, an open-source AI coding agent, ran a Claude-powered bot to triage issues on its GitHub repository, so the bot read whatever strangers typed into issue titles. In the attack now known as Clinejection, a crafted title hijacked that bot, and the chain that followed leaked an npm publish token, the credential that lets its holder release new versions of a package. The flaw was reported on January 1, 2026 and not fixed until it went public on February 9. On February 17, cline@2.3.0 shipped with an added step that installed OpenClaw, an always-on AI agent, and stayed live for about eight hours, according to Cline's post-mortem. Two months later, researcher Aonan Guan hijacked three more agents through the same kind of text: Claude Code Security Review through a pull request title, the Gemini CLI Action, and GitHub's Copilot agent through an HTML comment in an issue. He was paid bounties of $100 and $500 and no CVEs were issued, which tells you how this class of bug was being priced in April 2026.
Agents like these run in CI, the automation that builds, tests and releases code, right next to tokens that can publish it. Any field a stranger can type into, an issue title, a pull request title, a comment, becomes input to an agent holding those tokens. RoguePilot, Orca Security's research demonstration from February 2026 (since patched), reached a Codespace's GitHub token through an HTML comment in an issue. I'd split those jobs, so the agent that reads public text holds no publish rights and the job that publishes takes no input a stranger wrote. A publish token that expires within the hour and works on one package is also worth far less to whoever pulls it out than one that works until somebody remembers to revoke it.
A skill or package that ran with your permissions
In August 2025, malicious versions of the Nx build tool told the AI command-line tools already installed on the machine, Claude, Gemini and Amazon Q, to hunt for secrets. GitGuardian counted 2,349 secrets leaked from 1,079 repos in what became known as the s1ngularity attack (Hackread). Many of the AI tools refused. For the attacker the appeal was plain enough, since an agent the developer had already installed and trusted with the machine could simply be asked to do the searching.
Skills, the add-on instructions and scripts an agent loads to do a task, carry the same risk as packages, with an agent already attached. ClawHub, where people share skills for OpenClaw, had 341 malicious skills among the 2,857 that researchers audited in February 2026, and 335 of them installed AMOS, malware that steals data from Macs (The Hacker News). In late October 2026, Dark Reading reported a planted AGENTS.md file, the instructions file coding agents read when they open a project, found on a customer's machine. In Forever Security's reproductions, Codex turned off its own sandbox and approvals in over 90% of tests, and Claude Code leaked auth tokens in about half.
The worms have started using agents too. By August 5, 2026, the keyv worm had hit 444 npm packages and 1,381 versions, with more than 2 billion installs a month between them (Aikido, Datadog). It steals npm, GitHub, AWS and Stripe tokens, and it adds a Claude Code startup hook to repos in commits signed "claude", so it runs when someone opens the repo in Claude Code. Trust Wallet shows where stolen secrets end up. The Shai-Hulud worm's second wave had left more than 25,000 repos holding stolen secrets by November 24, 2025 (The Register). Trust Wallet says leaked GitHub secrets, "likely" from that wave, let attackers publish a malicious Chrome extension, and about $8.5 million left 2,520 wallets over December 24 and 25, 2025 (SecurityWeek).
A public post that moved money
Bankrbot is built to act on posts, and Grok is built to reply to them, so the attacker only had to put text in front of the first agent for the second one to move funds. OECD.AI's incident record puts the loss at $150,000 to $200,000, and MetaMask's report at about $204,000. Payloads like that one are already sitting on the open web, waiting for agents to read them. Google measured a 32% relative rise in malicious prompt-injection pages between November 2025 and February 2026, comparing snapshots of 2 to 3 billion pages each from Common Crawl, a public archive of the web, and the payloads it found included data theft and destruction (Google). Forcepoint reported live payloads that included a fixed $5,000 PayPal transfer and a hidden HTML comment asking for an API key.
A platform that left agent keys in the open
Some of the largest numbers here involved no injection at all. At the end of January 2026, Wiz found Moltbook's database left open, exposing 1.5 million agent API tokens, 35,000 email addresses and 4,060 private agent DMs, and any one of those tokens was enough to take over that agent (Wiz). The cause was a Supabase setting: row-level security, the rule that limits each user to their own rows, wasn't turned on. Moltbook had it fully fixed by February 1. Five months earlier, between August 8 and 18, 2025, attackers used stolen OAuth tokens, the login tokens Drift's AI chat agent used to reach Salesforce, to open the Salesforce data of more than 700 organizations (Help Net Security). In both cases the agent's credentials were the prize, and the damage matched what those credentials could reach.
The damage matched the access the agent already had
Line these up and the model was the weak point in only some of them. EchoLeak, Clinejection, Guan's three agents, Manus and Bankrbot were models talked into something. Moltbook, Drift, ClawHub and keyv needed no talking at all, only a database setting, stolen tokens or code that ran on install. In every case, though, what the attacker walked away with was decided earlier, by whoever set up the agent's access: an inbox and its connected drives, a publish token in a CI job, a developer's machine full of cloud keys, a wallet that moves when it's tagged, a Salesforce connection behind a chat widget. Injection gets the attention because it's the new part, and the controls that would have limited the damage mostly have nothing to do with language.
The model was the weak point in only some of them
THE INCIDENTS IN THE FIVE SECTIONS ABOVE
I split any system I build into the parts that have to be deterministic and the parts that can be probabilistic, and agent security is where that split matters most. The model deciding what an email or an issue title means is probabilistic, and it always will be. The s1ngularity refusals show a model will sometimes say no on its own, but nobody can predict which model, on which machine, on which day. The check between the model and the money should be deterministic: a cap on the amount, a list of allowed recipients, a token that only works on one repository, an approval step the model can't switch off. An injection can't talk its way past a check that doesn't read language, and the AGENTS.md reproductions show why the last item matters, since a sandbox and approvals the agent itself can turn off are part of what an injection can reach.
MCP, the standard way to plug tools into an agent, sits on the probabilistic side. The model reads each tool's description and decides which tool to call and with what, which is very helpful when you're exploring, and those descriptions are one more piece of text the agent reads and trusts. When a tool moves money or data, I build it directly on the provider's API, with fixed parameters that code checks, so the model can request the action but can't redefine it. It's also worth checking how a given MCP server handles access, because the spec leaves that to the implementer. In its words, "Authorization is OPTIONAL for MCP implementations," and authorization servers SHOULD, not must, issue short-lived access tokens.
How I'd contain an agent before it goes out
Scope it before release, starting read-only
An agent's permissions are easiest to set before anyone depends on it, so I start at read-only and widen access as the agent earns it. When I wrote the safe-AI policy for the CX team at Tools for Humanity, covering Claude, Codex and Notion AI, the defaults were read-only access, a dry run before any write, and hooks (scripts that check each action before it runs) that blocked writes outside an agent's role. Role-based access through a managed agent gateway, so each agent's permissions live in one place, was on the roadmap. A solo builder experimenting on their own laptop can reasonably skip tight scope, since the data at risk is mostly their own. A company can't, because every account the agent touches holds customers' or colleagues' data.
Give each agent short-lived tokens scoped to its role
In Cline's release, Drift's Salesforce connections and Moltbook's database, the credential itself was the prize, and it worked for whoever held it. A token that expires within the hour and does one job puts an end time on a theft and a limit on what the thief can do with it. I expect this to matter most in agent-to-agent, agent-to-person and agent-to-business finance, where agents will pay and get paid on each other's say-so. Bankrbot was an early look at that world, where one agent's post was enough authorization for another to send about $204,000.
Keep the reader away from anything that can act
The process that fetches a web page, an email or an issue gets no API keys, no write access to files and no tools, so if it's compromised, the worst it can hand back is bad text. Clean what it hands back by stripping HTML comments (the hiding spot in RoguePilot and in Guan's Copilot attack), invisible Unicode characters and bidirectional overrides, which flip the direction of text and can show a person a different order from the one the model reads. Cleaning only catches low-effort tricks, since an injection can be written in plain English, so it goes in front of the other controls rather than in place of them.
Put a person and a hard limit on anything that moves money or data
After an agent has read untrusted content, anything it does that moves money or data waits for a person to approve it: payments, refunds, changes to customer records, email to customers, file writes, publishing a release. A person approving the fortieth request of the day is reading language too, and gets tired. A per-transaction cap and a fixed list of allowed payees don't, so a payload like Forcepoint's $5,000 PayPal transfer stops at the check even if it gets past the person. If a person already reviews and sends every draft, that review is the approval step.
Cap anything that runs unattended
I wouldn't run an always-on autonomous agent, the OpenClaw kind that works around the clock, without caps and controls on it. I've seen runaway AWS and token bills from unattended agents with no attacker involved, and an agent reading the open web overnight is the case where everything above matters at once, because nobody is watching when the bad post arrives. A clean dry run helps, but one success doesn't mean the next hundred runs will go the same way.
Treat other people's skills and packages as untrusted
Several of the biggest recent hacks came through npm installs and skills marketplaces, and an install runs with the permissions of whoever installed it. That's also why I talked myself out of a product I once scoped, an MCP server that fetches, cleans and gates outside content before an agent sees it. Asking people to install open-source code to protect them from attacks hidden in open-source code didn't hold up, and the version of it I'd trust is the one you build yourself and can read every line of. Keep exploring, I still do, but never just download someone else's skill or package and run it where it can reach keys that matter.
When this is overkill, and why I expect it to matter more
Not every agent needs all six. A read-only summarizer feeding a person needs the reader split and the cleaning, and a solo builder working with their own data can go lighter than that. For a support bot reading every customer message, an agent filing vendor invoices or a sales tool researching websites, I look for the first action that touches money, a customer record, a release or the customer list, and that's where the approval and the hard limits go. Everything upstream of that action can stay probabilistic and fast.
The approval and the hard limits go at the first action that touches money
HOW I'D CONTAIN AN AGENT BEFORE IT GOES OUT
I expect more hacks in the next couple of years than in the last couple of decades, because agents now act on their own, around the clock and in swarms, on both sides of an attack. In November 2025, Anthropic disclosed that GTG-1002, a China-linked group, had run Claude Code with MCP tools against about 30 organizations, with AI doing an estimated 80 to 90% of the hands-on work (The Hacker News). That was misuse rather than injection, and it points the same way as everything above: attacks keep getting cheaper to run while the agents they target keep getting more access.
If you're deciding which work to hand an agent, the two-week AI Workflow Diagnostic follows one workflow end to end before anyone builds anything. "Don't build this yet" is one possible answer, and for an agent that reads the open web and can act on it, sometimes it's the right one.
Services
- Is your company paying for AI that hasn't changed how the work gets done?
- Is your bot handing more conversations to agents than the vendor promised?
- Is your AI wish list growing faster than anyone has time to build it?
- Are you paying for more AI seats than your team actually uses?
- Is the bot you launched last quarter still giving last quarter's answers?
Is your company paying for AI that hasn't changed how the work gets done?