Skip to content
All articles
Guides & How-ToAugust 29, 202620 min read

AI Agent Security in 2026: 5 Incidents, 1 Pattern

Five real incidents — EchoLeak, GitHub MCP, Amazon Q, Replit and Moltbook — and the identity, tool and approval controls that actually contain AI agent risk.

Jawad Fiaz

Jawad Fiaz

Founder & Editor

Share
Shield protecting an AI agent connected to email, code repositories and databases, illustrating AI agent security boundaries

By Jawad Fiaz · Updated 23 October 2026. Vendor advisories, incident reports and specifications were read between 16 and 23 October 2026.

Take CVE-2025-32711, the Microsoft 365 Copilot flaw known as EchoLeak. A single crafted email, sitting in an ordinary inbox, was enough to make Copilot collect data and send it out. The user did not click a link, open an attachment, or approve a prompt. Hidden instructions in the message rode along with legitimate content, and the assistant treated them as part of the job.

That is the uncomfortable shape of AI agent security in 2026. The model did not need to be jailbroken. It needed to be helpful in the wrong direction.

An agent is not a chatbot with a nicer interface. It is a model wrapped in an identity, a set of tools, and the authority to use them. AI agent security is mostly access control applied to software that can act. Most of the failures in this guide are ordinary permission mistakes that gained a larger blast radius. The question is not whether an agent is "safe" in the abstract. It is what the agent can do, under whose identity, and what happens when it is wrong.

What changed when chatbots got hands

A chatbot's output stops at your screen. An agent's output can become a command, an email, a database change, or a payment. That is the whole shift. The model is one component; the security boundary is the compound of model, instructions, memory, credentials, tools, and the identity the agent acts under.

This is why two agents with the same model can have wildly different risk. A read-only agent that searches a knowledge base is a different proposition from a coding agent that can edit files, install packages, and push commits. Claude Code and Cursor are useful precisely because they can do those things. The Model Context Protocol extends the same pattern to databases, browsers, and internal services. Use it carelessly and you have built a very capable deputy with your credentials.

That is why AI agent security is a systems problem: the model, the identity, and the tool surface all have to be right. Risk tracks reach, not intelligence — and reach is something you can inventory.

Five incidents that explain the risk

Five AI agent security incidents from the last 18 months are worth knowing in detail. None required a novel model attack; each is a story about an agent whose reach outgrew its guardrails.

1. The email that needed no click

EchoLeak, tracked as CVE-2025-32711, was a zero-click prompt injection in Microsoft 365 Copilot. A crafted email contained instructions hidden from the reader but visible to the model. When Copilot processed the message as part of its normal context, the injected text steered it toward data the attacker wanted. The exploit chain bypassed Microsoft's prompt-injection classifier, got around link redaction with reference-style Markdown, used auto-fetched images, and abused a Teams proxy that the content security policy allowed. Data left the tenant without a user action. Microsoft fixed the service server-side; the technical write-up is worth reading for the chain, not just the headline.

What would have stopped it: treating email as untrusted content even inside a trusted tenant, disabling automatic remote-image fetches, enforcing a narrow egress allowlist, and requiring confirmation before any assistant-initiated outbound request. The AI agent security lesson is not "filter harder." It is to remove the outbound path the injection needs. A classifier helps; it is not a boundary.

2. The public issue that read a private repo

In May 2025, Invariant Labs showed how the official GitHub MCP server could be turned into a data pump. An attacker opened a public issue containing hidden instructions. When the account owner asked their agent to look at open issues, the agent followed the injection, pulled private repository data into its context, and opened a pull request in the attacker's public repository. The private data was now public. The agent had done exactly what its broad GitHub token allowed.

What would have stopped it: a read-only token scoped to the specific repository, a hard separation between public and private contexts, no write access to public repositories from an agent session, and human review before any pull request leaves the organization. The failure was authorization, not model behavior. "The agent has a token" is not an access-control design.

3. The repository that ran commands

Between July and August 2025, researchers at Embrace The Red, HiddenLayer and MaccariTA reported prompt-injection issues in Amazon Q Developer and Kiro. A malicious repository or file could carry invisible instructions; Q Developer then ran commands such as find, grep and echo without human confirmation. A second variant used ping and dig to leak data through DNS. In Kiro, instructions planted in MCP settings files could lead to arbitrary code execution without a confirmation step; AWS added one for Supervised mode in 0.1.42. AWS's advisory lists the fixes: Language Server 1.22.0 on 17 July, 1.24.0 on 29 July, and Kiro 0.1.42 on 1 August, all adding human-in-the-loop confirmation for the dangerous commands.

What would have stopped it: confirmation before shell or network commands, DNS and egress monitoring, treating repository content as untrusted input, and reviewing MCP configuration files with the same suspicion as a script from the internet. Invisible characters are a reminder that "a human looked at it" is not a control if the human cannot see what they are looking at.

4. The database that vanished during a code freeze

In July 2025, SaaStr founder Jason Lemkin reported that Replit's coding agent had deleted a production database despite instructions not to change code without permission. Days later, a code freeze he announced was violated within seconds. Replit initially said a rollback was impossible and that it had destroyed all database versions; the rollback later worked. The Register's account captures the detail that matters: the instruction was in the prompt, not in the infrastructure.

What would have stopped it: separate development and production credentials, a deny rule for destructive SQL and shell commands, point-in-time recovery that is tested before an incident, and a freeze enforced by the platform rather than requested in a chat. If an agent can delete production data, the problem is the permission, not the wording of the instruction.

5. Moltbook: the public key was not the problem

On 31 January 2026, Wiz found a misconfigured Supabase database behind Moltbook, the viral social network for AI agents. The exposure included 1.5 million API authentication tokens, 35,000 email addresses, and private messages between agents. The database also revealed that the platform's 1.5 million "agents" belonged to roughly 17,000 human owners — an 88-to-1 ratio — and that there was no rate limiting or real verification that an account was an autonomous agent. This is the part that gets misreported.

A Supabase anonymous key is designed to be public. It acts like a project identifier. When row-level security is configured, exposing it is normal and safe. In Moltbook's case, the critical line of defense was missing: RLS policies were not in place, so the public key granted full read and write access. The AI agent security lesson is not "hide the key." It is "enforce access rules at the data layer, scope the token, add rate limits, and verify who is behind an identity." 404 Media and MIT Technology Review add the other half: much of the viral "agent" behavior was human-authored or heavily prompted. Verify the capability before you build a security model around it.

The pattern behind all five: the lethal trifecta

Simon Willison's lethal trifecta is the cleanest way to think about exfiltration risk. An agent becomes dangerous when it has all three of these at once:

  • access to private data;
  • exposure to untrusted content;
  • a way to communicate externally.

Two legs are manageable. Three legs are an exfiltration path. That is why the trifecta is the most useful AI agent security model: it is about architecture, not model quality. EchoLeak had mailbox data, an attacker-controlled email, and a Teams proxy. The GitHub MCP case had private repositories, a public issue, and the ability to open a public pull request. Amazon Q had developer credentials, a malicious repository, and DNS. Moltbook is the exception that proves the rule: no injection was needed because the private data was simply open.

You rarely get to remove all three legs. You usually get to remove one: keep private data out of the context, strip the outbound channel, or stop treating untrusted content as instructions. That is a design decision, not a filter you bolt on later.

The risks that do not make headlines

The incidents above are memorable because they are concrete. Most AI agent security failures are quieter.

Over-privileged access

Most agents are given the permissions of the person who set them up, plus a few "just in case" scopes. A support agent that only needs to read tickets should not hold a token that can delete customers. Excessive agency is not a model flaw; it is an authorization choice. Start from the task, not from the API's full surface. It is the most common failure in the public incident reports.

Prompt injection, direct and indirect

Direct injection is a user trying to override the system prompt. Indirect injection arrives through content the agent reads: a web page, an email, a PDF, a code comment, or a tool description. Agents make it worse because the model's output becomes an action. The practical defense is to assume some injections will land, and make the action layer refuse the dangerous ones.

MCP and the tool supply chain

MCP has become a major boundary: it turns a model into a caller of code you did not write. A server can look friendly and still be hostile. Tool poisoning hides instructions in the tool description, which the model reads but the user usually does not. A "rug pull" changes that description after approval. Shadowing uses one server's description to change how the agent treats another, trusted tool. The MCP security guidance adds confused-deputy and token-passthrough risks: a server that accepts your token and reuses it downstream can act with more authority than you intended. Treat tool descriptions as untrusted code, pin versions, and give each server its own credential.

Agent identity

An agent that runs as a shared user, a long-lived API key, or a copied OAuth token has no real identity to audit or revoke. Agent identity is the least glamorous part of AI agent security, and the one most likely to decide the outcome. You cannot answer which agent did what, on whose behalf, or with which credential. The fix is workload identity: a distinct identity per agent, short-lived tokens, explicit scopes, an audience restriction, and an owner. OAuth token exchange (RFC 8693) and SPIFFE-style workload identities are the building blocks; the OWASP agentic list calls the failure mode identity and privilege abuse.

Memory poisoning

Persistent memory is an underrated surface: a feature until it becomes a storage system for attacker instructions. Content read in one session can shape behavior in the next, and an agent that can search its own memory can propagate a bad instruction further. Classify what may be remembered, expire it, review it, and never treat memory as more trustworthy than current, verified context.

Multi-agent cascades

When agents delegate to other agents, every message is untrusted input. Multi-agent systems add a second boundary: the messages between agents. One compromised agent can instruct a more privileged one, and a bad plan can cascade through the chain before a human sees it. Limit delegation depth, scope each agent's role, authenticate inter-agent messages, and log the handoffs. The OWASP list calls the end state cascading autonomous failures; the practical version is "one agent's mistake should not become three agents' action."

Shadow AI

Shadow AI is the visibility half of the problem — use that IT and security teams do not know about. It can be a browser extension, a free summarizer, or an agent someone connected to a work account. It is a visibility problem before it is a tool problem. You cannot apply an allowlist, a retention policy, or an incident response plan to a system you have not inventoried.

The numbers, without the sleight of hand

Statistics in this field are often quoted without their definitions. Here are the ones worth using, what they measure, and where they come from.

Metric Figure What it measures Source
SaaS applications per enterprise 490 Average SaaS apps managed, not AI agents Reco, 2025 State of Shadow AI
Authorized SaaS applications 47% Share of those SaaS apps that are sanctioned Reco, 2025
Unauthorized SaaS applications ~260 53% of 490; a derived figure, not a separate survey Reco, 2025
Unauthorized applications overall 1,200 A broader count of unsanctioned applications; not a subset of the 490 CSA research note, citing Reco
Median time an unauthorized AI tool stays active 403 days Detection lag, not dwell time after an attack CSA research note
Breaches involving shadow AI 1 in 5 Share of breached organizations that reported a shadow AI incident IBM Cost of a Data Breach 2025
AI-related breaches without AI access controls 97% Among organizations that reported an AI-related breach IBM, 2025
Extra cost per breach with high shadow AI ~$670,000 Average premium, self-reported, correlational IBM, 2025

The 490 and 1,200 figures are not two counts of the same thing. Reco's 490 is the average number of SaaS applications an enterprise manages; 47% authorized leaves roughly 260 unauthorized SaaS apps. The 1,200 figure is a broader count of unauthorized applications overall, a population that includes tools outside the 490. If someone subtracts 490 from 1,200, or presents 1,200 as "of" the 490, they are using the numbers for effect rather than measurement.

The IBM figure deserves the same care. It is an average premium observed across breached organizations, not a guarantee that a shadow AI tool will cost you $670,000. The useful signal is the direction: unmanaged AI use correlates with higher breach cost and weaker access controls. That is enough to justify an inventory, even if the exact number varies by study.

The control stack that holds up

No single product makes an agent safe. But a workable AI agent security program has an order of operations, and one layer does more work than the rest.

Start with identity and tool scope

If you fix only one thing, fix this: give the agent its own identity, give it only the tools the task needs, and make the default read-only. A per-task identity with short-lived credentials is easier to audit and revoke than a shared key. A tool allowlist is easier to reason about than a prompt that says "be careful." Separate production credentials from everything else. This is the foundation. Human approval is a second layer, not a substitute for it.

Put a policy layer between the model and the action

The model should propose; a deterministic layer should decide. Validate the tool name, the arguments, the target, and the egress domain before anything runs. A small policy file is more reliable than another paragraph of instructions:

agent: support-triage
identity: spiffe://corp.example/agent/support-triage
tools:
  allow: [crm.read_account, crm.read_ticket, kb.search]
  deny: [crm.delete_*, payments.*, shell.*]
  require_approval: [crm.update_ticket, email.send]
constraints:
  crm.read_account: { fields: [id, name, plan], max_rows: 1 }
  email.send: { domains: [corp.example], max_recipients: 5 }
egress:
  allow: [crm.internal.example, kb.internal.example]

The exact syntax will vary by platform. The properties that matter are constant: deny by default, constrain arguments, and make the outbound path explicit.

Make approval meaningful

Approval is the part of the process that fails most quietly. If a reviewer sees forty prompts before lunch, the forty-first gets a click, not a review. That is approval fatigue, and it turns a control into a rubber stamp.

Use risk tiers instead of asking for everything. Read-only and reversible actions can run with logging. External sends, payments, permission changes, and anything irreversible should require a human. The most dangerous actions should require two people. Show the actual arguments and the diff, not a generic "Allow?" button. Let approvals expire, batch the low-urgency ones, and never auto-approve on timeout. Then measure the approval rate. If reviewers approve almost everything, the control is decorative.

tiers:
  - match: ["*.read_*", "*.search"]
    action: allow
  - match: ["crm.update_*", "email.send"]
    action: approve
    approvers: [support-lead]
    ttl: 15m
  - match: ["*.delete_*", "payments.*", "iam.*"]
    action: two_person
    ttl: 5m
controls:
  show_arguments: true
  batch_window: 10m
  expire_on_timeout: deny
  review_rate_alert: 0.9

Treat MCP servers as untrusted code

Before you connect a server, read every tool description in full. Pin the version or hash, and re-review when the description changes. Run local servers in a container with a read-only filesystem and no network unless the task needs it. Give each server its own credential; do not pass user tokens through. Allowlist the tools you actually use, and log the arguments and the decision for every call. If a server cannot explain what it does in plain language, it is not ready for production.

Isolate, log, and make recovery boring

Sandbox code execution. Keep development and production in separate accounts. Test backups and point-in-time recovery before you need them. Put a kill switch on every agent that can take a consequential action, and rate-limit tool calls and outbound requests. Log the agent identity, tool, arguments hash, decision, approval ID, egress domain, and model version. The goal is not a perfect prevention record; it is a short, boring recovery.

If an agent goes wrong: the first hour

AI agent security incidents rarely arrive with a clean timeline. Response starts with access control, not forensics. The order below is adapted from NIST SP 800-61 Rev. 3 and the CISA guidance on agentic AI adoption.

  1. Contain. Disable the agent or the specific tool, revoke its tokens, and block the outbound domain you suspect. Do not wait for a root-cause analysis.
  2. Preserve. Snapshot logs, configuration, tool descriptions, and the agent's memory before you reset anything. Memory is evidence.
  3. Scope. Identify which identities, data sets, and actions were involved, and what left the environment. Check DNS and egress logs, not just application logs.
  4. Eradicate. Remove the malicious server or tool description, fix the policy that allowed the action, rotate every secret the agent could read, and clear poisoned memory.
  5. Recover. Restore from a clean backup, re-enable the agent with a narrower scope, and watch it closely for the first few days.
  6. Review. Write the timeline, the root cause, the control that failed, and the change that prevents a repeat. Disclose according to your policy and any regulatory obligations.

The agent-specific twist is that the evidence is often split across the model provider, the orchestration layer, the MCP server, and the downstream SaaS audit log. Collect them before they rotate out.

If you use these tools but do not build them

You do not need a security team to reduce your own exposure. The basics of AI agent security for an individual are mostly permission hygiene, and a few habits cover most of it.

  • Review the accounts, files, and extensions an assistant can reach. Remove anything it does not need.
  • Do not paste passwords, API keys, or customer data into a prompt. They end up in logs and third-party systems.
  • Check what a connected tool can change before you enable it. Read-only is a feature.
  • Keep agents out of your most sensitive accounts, or put them behind read-only access.
  • Review anything that can send, pay, delete, or publish, especially the first few times.
  • Revoke old integrations and unused OAuth grants. An agent you forgot about is still an agent.
  • Use a separate browser profile for agent browsing so it does not inherit your logged-in sessions.

The point is not to avoid agents. It is to keep the blast radius smaller than the convenience.

How we researched this

This guide is based on vendor advisories, incident write-ups, the OWASP lists, the MCP specification, and NIST and CISA guidance read between 16 and 23 October 2026. We did not run a live exploit against a production agent. The configuration examples are templates, not tested against a specific vendor's policy engine, and should be adapted to your stack.

Frequently asked questions

What is AI agent security?

It is the work of keeping an AI agent's actions inside the boundary you intended. That means securing the model, the instructions and memory that shape it, and the identity, credentials and tools it uses to act.

What is prompt injection?

Prompt injection is an instruction hidden in content the model reads — an email, a web page, a tool description, a code comment — that changes what it does. For an agent, the danger is not the text itself; it is the tool call or message that follows.

Why are AI agents a security risk?

An agent combines a model with permissions. A wrong answer becomes a wrong action: a deleted record, a sent email, a payment, a leaked file. The risk tracks what the agent can reach, not how impressive the model sounds.

What is shadow AI?

Shadow AI is AI use that IT and security teams do not know about. It can be a browser extension, a free summarizer, or an agent someone connected to a work account. The problem is not the tool's brand; it is the data flow nobody approved or monitors.

How do you secure an MCP server?

Treat it like third-party code. Read the full tool descriptions, pin the version, limit its filesystem and network access, give it its own credential, and log every tool call. Re-review the server when its tools change, because a description can be rewritten after you approved it.

What is agent identity management?

It is giving each agent its own verifiable identity, with scoped, short-lived credentials and an owner, instead of letting it run as a shared user or a long-lived API key. It also means being able to revoke that identity quickly.

Is human approval enough?

No. Approval is a useful second layer, but it fails when people are asked dozens of times a day and start clicking through. Use it for irreversible, external or high-value actions, show the exact arguments, and measure whether reviewers are actually reading.

Do individuals need to worry about AI agent security?

Yes, at a smaller scale. Check which accounts and files an assistant can reach, remove permissions you do not use, keep secrets out of prompts, and review anything that can send, pay, delete or publish before you let it run.

What should you do if an agent is compromised?

Contain it first: disable the tool or agent, revoke its tokens, rotate any secrets it could read, and preserve logs and memory before you reset anything. Then find out which data and actions were involved, fix the configuration, and review how the agent got that access.

Sources

Share

Like what you're reading?

Get our best AI tool reviews and guides delivered to your inbox each week. No spam, unsubscribe anytime.

Jawad Fiaz

Written by

Jawad Fiaz

Founder & Editor

Jawad Fiaz covers AI tools, pricing and product research for AI Tools Vault.

Related Articles

More reading on guides & how-to