Q3 2026 Security & Compliance$1.18B stolen across 107 incidents. Main drivers: supply chain, smart contracts, keys.
Get the report →

AI Agent Security: 5 Attack types explained

18 min read

AI agent security is the work of limiting what an AI agent can do when an attacker manipulates its inputs, tools, or memory. Today threats may include Morse-encoded social media posts, prompt injection attacks, or access control attacks.

In this article we will deep dive into AI agent security and how to protect your AI automations against current threats.

Why an AI agent is harder to secure than a chatbot

In production systems, an AI chatbot mostly provides answers by reading a question, looking up a knowledge base, and writing a reply. Examples may be a support widget, a helpdesk, or a Q&A over company documentation. In contrast, AI agents perform actions. They have a goal, plan, steps, and make calls with their credentials (APIs, databases, email, code, wallet). A result of agents' work changes something without a person checking it. For example, agents can issue refunds, close support tickets, deploy code, or trade on-chain.

Therefore, an AI agent is harder to secure because it outputs actions via API calls, code execution, or transactions initiated. When a chatbot fails, it gives a misleading or useless answer. Sounding relatively harmless, it has led to a lawsuit for a totally invented refund policy by AI chatbot in 2024.

At the same time, an agent fooled by a prompt hands the attacker privileges and reach across systems that the agent had. When AI performs actions, the risks of attacks/failures include deleting a production database, initiating unlimited payments to the adversary counterparty, or obtaining information that otherwise should have been private.

Simon Willison calls the dangerous combination the lethal trifecta: access to private data, exposure to untrusted content, and a way to send something out. Remove any one and most attacks fail. In an agent, each surface is quite wide, as private data is the inbox, the CRM, API keys and balances. And untrusted content can be obtained from any web page, email, tool output, message from another agent, and the agent's own memory. And for AI agents the most common “way out” is a payment initiated, an outbound request, an email, or an image link the chat client loads.

Lethal trifecta

1Private data

Inbox, CRM, API keys, wallet balances

2Untrusted content

Web pages, email, tool output, other agents, its own memory

3A way out

Outbound requests, email, image links the chat client loads, payments

Stephen Ajayi, Leading Offensive Security Engineer at Hacken, puts the typical mistake this way: teams treat agentic AI "like a normal model deployment instead of treating it like an execution system" (The RWA Ledger). The model is the same for every company that uses it. Instead, the difference lies in the access that the model has: the tools, API keys, databases, wallets and other agents. The model can't move money; those connections and permissions make it possible. That’s why every security review starts with an inventory of everything the agent can read, call and sign, and the permissions on each.

5 things an attacker can make your agent do

Generally we define 5 main threat outcomes, based on what attackers can make your AI setup do. We base this ranking on public incidents.

Read your data

Indirect prompt injection hides instructions in content the agent reads: a web page, a PDF, an email, a code comment. The agent treats the hidden text as part of its task. It searches whatever data it can access, then sends the result out through any channel it has, for example a link with the data in the URL or an image the chat client loads automatically.

In June 2025, Aim Security disclosed EchoLeak (CVE-2025-32711) in Microsoft 365 Copilot. The attacker sent one crafted email, and the victim never had to open it. When the user later asked Copilot an ordinary work question, Copilot retrieved the email, followed its hidden instructions and placed internal data from mail, Teams, OneDrive and SharePoint into an image link that delivered it to the attacker's server (arXiv 2509.10540). Microsoft has since patched the flaw. There was no click, no malware and nothing in the logs that looked like an attack, and everything Copilot could read was in scope.

In March 2026, Unit 42 documented 22 injection techniques across 12 live cases on the open web (Unit 42). The payloads targeted PayPal, Stripe and card checkouts, and no victim loss was reported. More on how it works: prompt injection attacks.

Tool misuse

An agent with a tool can be talked into using it the wrong way. Freysa was an AI agent launched as a public game in November 2024: it guarded a prize pool, its instructions said never to transfer it, and players paid a rising fee per message to try. The winning message opened a fake "admin session", told the agent that its approveTransfer function was the one for receiving incoming payments, and offered to contribute $100. The agent called approveTransfer and released the whole pool, 13.19 ETH, about $47,000 (Jarrod Watts). The function had no amount limit, so one wrong call moved everything.

The same happens through MCP, the protocol that connects agents to tool servers. In April 2025, Invariant Labs published a tool that added two numbers. Its description, which the agent reads and the user doesn't see, told the agent to read ~/.cursor/mcp.json and the user's SSH private key and pass them to the server in a hidden parameter. The user saw the correct sum (Invariant Labs). Since mcp.json often stores credentials for other MCP servers, one installed server can take the keys to all of them. See MCP security risks.

Initiate a payment

Payment attacks target the step where an agent's text becomes a transaction. Many setups split the work: one agent talks to users and decides what should happen, and a second system holds the wallet and executes. If the executor treats the first agent's output as an authorized command, the attacker doesn't need the key. It is enough to make the talking agent say the right words, and the executor signs and sends the payment, which on a blockchain can't be reversed.

That is how the Grok and Bankr case worked. Bankr is a service that trades for X users when they tag @bankrbot. The attack had two stages (SlowMist):

  • The attacker activated a Bankr Club membership for the wallet Bankr had created for Grok's account. It unlocked transfers with no confirmation step and no limit.
  • The attacker sent Grok a message in Morse code. Grok decoded it and replied publicly, tagging @bankrbot with a transfer instruction. Bankr's scanner treated Grok's reply as a command from the wallet owner and sent the tokens, about $175,000, to the attacker, who swapped them into USDC and ETH.

About 80 to 88% came back after negotiation, and the rest was left as an informal bug bounty. SlowMist's root cause: Bankr turned one agent's text into a financial authorization without checking the source, the intent or the unusual encoding.

Act on your behalf

Here the attacker skips the model and takes over whatever gives the agent its instructions: the operator dashboard, the agent's API keys, or the routing service between the model and your application. Instructions arriving through those channels count as the owner's, so the agent carries them out with its full authority and no injection is needed.

AIXBT is an autonomous crypto-commentary agent on X with its own wallet. On 18 March 2025, an attacker got into its operator dashboard and queued two prompts telling it to transfer funds. It sent 55.5 ETH, about $106,200, and the maintainers said the breach hit the dashboard, not the model (AI Incident Database). Whoever controls the operator console or the agent's API keys gets the agent's full authority, and in the logs the actions look like the agent's normal work. The same applies to the routing layer between the model and your application, which Ajayi says should be treated as "a sensitive control point", not "invisible plumbing".

Poison memory

Memory poisoning provides false entries in an agent's memory. Later, an ordinary request brings an adversary entry back, and the agent acts on it as if the owner had said it.

Researchers tested this on agents built with ElizaOS, a framework for Web3 agents. Planted records in the agent's stored history led it to make unauthorized transfers on a test network. Models were significantly more vulnerable to memory injection than to ordinary prompt injection, and prompt-injection defences gave limited protection once the stored context was corrupted (arXiv 2503.16248).

Bonus: Use your agent as a money mule

A money mule is a person who moves money from a criminal source on behalf of a criminal, sometimes without knowing it. An AI agent that can send payments can do the same job. Here the attacker doesn't steal from the agent's owner. They route dirty money through the agent, so the transfers leave the owner's accounts, under the owner's name, and look like ordinary business.

The first way is to talk a payment or banking agent into it: accept incoming funds, add a new payee, forward the money on, and split it into smaller transfers along the way. Each step can look like routine customer service. FraudBench, a study published in August 2026, tested four banking agents against 107 adversarial scenarios. The agents resisted only 49% to 65% of attacks, and money-mule scenarios were the hardest category for every model.

The second way doesn't need your agent at all, only your marketplace. Agents holding money that would otherwise be refused, frozen or seized buy "services" over x402 or other agent payment protocols from agents run by the same people. No goods or services change hands. The trade is counterfeit and set up only to make the money look like revenue. Such fake trades are hard to separate from genuine ones: when Visa and Artemis screened early agent payments for wash and test activity, they kept 61% of transactions but only 11% of the dollars (Visa and Artemis).

If your agent made the transfers, they went out of your accounts, so the AML questions, frozen funds and reports come to you. If you accept agent payments, your platform may be where the money gets cleaned. The controls from the next section apply here too: an allowlist of payees, a cap on the first payment to any new payee, and limits on rolling windows, so the money can't be split into small transfers that each stay under the cap.

Contribution by: Popoola Kayode, an expert on AML, crypto investigations, digital asset compliance, blockchain infrastructure, and AI security.

Limiting the damage

There are two approaches to AI security controls, and we recommend using both of them simultaneously. The first focuses on lowering the chance that an AI agent is manipulated, which is more of continuous work that includes balancing the task completion rate and these operations being resilient to attacks. The second approach is quite straightforward, as you basically limit what agent can lose in the worst of scenarios. Let’s look at them both:

Lower the chance of manipulation

Give each agent one narrow task, tag memory with its source, and isolate untrusted content from the part of the system that chooses tools.

Tagging memory means storing every entry with where it came from (the owner, a verified user, a tool result, a public post) and letting the agent follow instructions only from trusted sources. Text from a public post stays information and never becomes a command.

Isolating untrusted content means the model that plans and calls tools never sees raw emails, web pages or tool output. A separate step extracts only the fields the task needs, such as an amount, an invoice number or a date, into a fixed format, and anything that doesn't fit the format is dropped.

Dual LLM and CaMeL formalise this. Dual LLM is a design pattern Simon Willison proposed in 2023: one privileged model calls tools and executes actions, and a second, quarantined model processes everything from untrusted sources without any tool access. CaMeL, published by Google DeepMind researchers in 2025, adds an interpreter that tracks where every value came from before any tool call. But there is also a trade-off, as task completion rate becomes slightly lower on protected workflows. That gap is the trade-off between completed tasks and resilience.

Limiting maximum possible agent loss

This becomes possible when the agent has no access to three things: the signing key or admin token, the policy that sets its limits, and the path to change those limits.

In practice:

  • The key. The key lives in a smart account, an MPC setup or a hardware enclave. The agent gets a session key that the account accepts only for set amounts, recipients and contracts, and only until it expires. For APIs, the agent gets scoped tokens through a gateway: read-only access to the CRM, refunds up to a fixed amount.
  • The policy. Limits are checked by the signer, the custody provider's policy engine or the contract itself. A manipulated agent can request a payment but can't approve it.
  • The change path. Raising a limit needs the owner's approval through a channel the agent can't access, such as a passkey on the owner's phone. In the I-HITL experiment, the approval code for a higher cap arrived by email, the agents could read that inbox, and 9 of 10 models raised their own cap.

The further a limit is from the model, the harder it is to talk past

Where the limit is enforcedCan a manipulated agent get past it?
1
In the prompt“Never send more than $100”
Yes. A manipulated model ignores its own instructions
2
In the agent's code or processA spending cap the agent's runtime checks
Yes, if its host or a skill it installed is compromised
3
In a gateway or policy engineThe custody provider's policy, an API gateway with scoped tokens
Only if it reaches the approval channel or the policy credentials
4
In the signer, smart account or contractA session key accepted only for set amounts, recipients and expiry
Only with the owner key, or a limit change it can approve itself

So in the end, every secure agent automation looks schematically like this:

  • One agent per job, each with its own short-lived credentials.
  • Automatic policy checks on every action, and human approval for large amounts and new recipients, through a channel the agent can't read.
  • Limits on rolling windows: a daily cap that resets at midnight can be spent twice in two minutes.
  • Pinned MCP servers and skills, with auto-update off.
  • Logs at the target system, and a kill switch owned by someone outside the agent.

Then track and improve the agent with three metrics:

  • Task completion rate: the share of legitimate tasks it finishes.
  • Maximum enforceable loss: the most it can lose over a set window if an attacker fully controls the model, counting only limits it can't reach or change.
  • Attack success rate: the share of adversarial test cases in which it violates its policy or instructions.

AI security frameworks for agents

The frameworks that cover AI agents name the risks and the paperwork; none of them tests your deployment.

FrameworkWhat it gives you for agentsUse it when
OWASP Top 10 for Agentic Applications (2026)Ten agent risk classes, from goal hijack to inter-agent trustScoping a threat model or a test
OWASP Top 10 for LLM ApplicationsModel-level risks, including excessive agencyThe agent runs on an LLM you configure
MITRE ATLASAttacker tactics and techniques against AI systemsMapping red-team findings
NIST AI RMFA voluntary risk management processYou need a governance baseline
ISO/IEC 42001A certifiable AI management systemCustomers or regulators ask for certification
EU AI ActLegal obligations by risk tierYou place AI systems on the EU market

Testing AI agents

Testing an AI agent means attacking the whole chain, from the first injected input to the last action the agent can take, and checking the side effect rather than the model's text. Hacken's AI red teaming methodology starts by splitting the scope into layers: the model, the application, retrieval and memory, the agent or orchestrator, tools, identity and authorization, third-party providers, and hosting. A control found in one layer is not assumed to protect another.

If you need that chain run against your own agent stack before launch, that is what a Hacken AI security assessment does. For the method behind it, see AI red teaming.

Find out what your AI agent can be made to do

We attack your agent the way an attacker would, from the first injected input to the last action it can take, and retest every fix.

Request a quote
AI red teaming

FAQ

Frequently asked questions about AI agent security

What is AI agent security?

AI agent security is the set of controls that limit what an AI agent can do when its inputs are hostile. Most of it concerns the agent's reach: the keys, tools, credentials and other agents it can use, and whether their limits are enforced where the agent can't change them.

Can prompt injection be fully prevented?

No. Filters and better models lower the success rate, and encoded payloads like the Morse-code post in the Bankr case still get through. That is why the controls that matter most cap what the agent can do after it has been fooled.

What is MCP security?

MCP security covers the Model Context Protocol, the standard that connects agents to tools and data. The main risks are poisoned tool descriptions, over-broad permissions and weak authorization between client, server and upstream service. Hacken's MCP security guide goes through each one.

Subscribe to our newsletter

Be the first to receive our latest company updates, Web3 security insights, and exclusive content curated for the blockchain enthusiasts.

Speaker Img