Blog

Informative, up-to-date and exciting – the Oneconsult Cybersecurity Blog.

AI Agent Security: Threats and Attack Vectors
marco-bertenghi-senior-penetration-tester
Marco Bertenghi
|
20.05.2026
(updated on: 21.05.2026)

Artificial intelligence (AI) has advanced rapidly in recent years. While in 2023 it still consisted mainly of simple chatbots – with OpenAI’s ChatGPT being the prime example – it has evolved into an ecosystem of highly complex, autonomous systems. Today, companies are deploying AI applications across various business areas: from intelligent customer support chatbots and retrieval augmented generation (RAG) systems to fully autonomous AI agents that independently plan tasks, access tools, and make decisions.

This autonomy generates tangible productivity gains, but at the same time opens up new attack vectors. Reality shows that these risks are no longer merely theoretical scenarios: When the open-source agent OpenClaw went viral in late January 2026, security researchers identified over 135,000 publicly exposed instances, an RCE vulnerability with a CVSS score of 8.8, as well as hundreds of malicious skills in the official marketplace – including active infostealer campaigns targeting macOS and Windows – within just a few days. Even popular coding agents such as GitHub Copilot and Google Jules have already been compromised via prompt injections.

This blog post will explain:

  • the different types of AI applications
  • the specific risks and common attack vectors
  • why traditional security measures are no longer sufficient

For detailed information, additional attack vectors, and practical mitigation strategies, please refer to our white paper Agentic AI Security.

LLMs, RAG Systems, AI Agents – The Three Types of AI Systems

To understand the security risks posed by agentic AI systems, it is necessary to clearly distinguish between the different types of systems. AI applications can be divided into three categories based on their level of autonomy.

  • Chat applications (LLMs) constitute the simplest form. The user interacts directly with a language model, such as ChatGPT. The application processes text inputs and returns text responses. In some cases, multiple modalities are supported, such as images, audio, and video. Security risks primarily concern prompt injection and the disclosure of sensitive data.
  • RAG systems supplement the language model with external data sources, such as Google NotebookLM. For queries, additional relevant documents can now be retrieved from a knowledge base and provided as context. In addition to the LLM risks, attack vectors arise from manipulated documents and insecure data pipelines.
  • Agentic systems represent the most complex yet riskiest category. AI agents, such as Codex by OpenAI or Claude Code by Anthropic, act largely autonomously. They plan multi-step tasks, call upon external tools and APIs, store information in memory, and delegate tasks to other agents. These systems provide the largest attack surface, as successful attacks can lead to uncontrolled actions with real-world consequences.

The autonomy of agentic systems is not an optional feature, but their core characteristic. Aside from simple chatbot applications, LLMs alone offer only limited value to businesses. It is only through the ability to independently plan, make decisions, and intervene in systems that they realize their full economic potential. However, it is precisely this autonomy that places agentic systems in a highly privileged position within the IT landscape, making them an extremely attractive target for attackers. A compromised agent is therefore not a passive data leak, but an active attacker within your network. A typical agentic AI system consists of several core components, each of which poses its own security risks: the LLM acting as the thinking machine (vulnerable to prompt injections and jailbreaks), the planning module (vulnerable to goal hijacking and plan manipulation), the tool integration (vulnerable to tool misuse and privilege escalation), the memory/context (vulnerable to memory poisoning and context leakage), and the multi-agent orchestration (vulnerable to agent communication poisoning).

From Chatbots to Autonomous AI Agents: The Security Risk Matrix

The following matrix, based on the work of Kim et al., illustrates how complex and varied the attack surfaces of AI agents can be. It assesses the security posture of an agentic AI system across seven key dimensions – ranging from the trustworthiness of inputs through tool and memory usage to the user interface.

Each dimension is rated on a scale from Level 1 to Level 3: Level 1 represents highly restricted systems with low risk, while Level 3 represents maximally flexible, autonomous systems with the highest risk profile. The higher the level, the more stringent the accompanying security measures need to be.

The matrix does not replace a comprehensive risk analysis, but it offers a quick, structured introduction to the question: How exposed is our AI system actually – and where is the greatest need for action? A sales agent (see also section: Example of an Attack Chain on an AI Agent) with persistent memory, known tools, and a dynamic workflow (i.e., predominantly Level 3) requires fundamentally different protection mechanisms than a simple FAQ chatbot that operates entirely at Level 1.

DimensionLevel 1Level 2Level 3
 Not very flexible / low riskModerately flexible / medium riskMost flexible /
high risk
Reliability of input dataNo external dataPredefined external dataAny external data
Access sensitivityNo sensitive dataPredefined sensitive dataAny sensitive data
WorkflowSimple chatbotFixed workflow defined by the developerDynamic workflow defined by the LLM
ActionsLLM response onlyLLM response, retrievalLLM response, retrieval, execution
MemoryNo memoryTemporary session memoryPersistent memory across sessions
ToolsNo toolKnown toolsAny tools
User interfaceText onlyWeb-based image previewInteractive web elements

Security Matrix for AI Systems: Based on the Work of Kim et al. (https://arxiv.org/abs/2603.11088)

Attack Vectors Targeting AI Agents

The threat landscape for AI applications is complex. The following section systematically outlines the most important attack vectors, starting with the most commonly exploited and moving on to the most technically sophisticated.

Prompt Injections: The Most Dangerous Attack Vector

Prompt injections rank first in the OWASP LLM Top 10 and are considered the most commonly used attack vector against AI applications. Attackers manipulate the inputs to an AI system to bypass security mechanisms, alter the intended behavior, or extract sensitive data. In practice, it is distinguished between three attack patterns:

  • Direct prompt injections: In direct prompt injections, attackers enter malicious instructions directly into the user input field to expose system prompts, bypass security rules, or trigger unauthorized actions.
  • Indirect prompt injections: In indirect prompt injections, malicious instructions are embedded in data that the AI system processes from external sources – such as websites, documents, emails, or database entries. This is particularly critical for RAG systems and agents with internet access, as attackers do not require direct access to the system.
  • Multi-turn attacks: In multi-turn attacks, attackers distribute the malicious instruction across several consecutive messages. Each individual message appears harmless, but taken together, they lead to the desired manipulation.

Attacks on AI Agents: From Goal Hijacking to Memory Poisoning

Agentic AI systems significantly increase the attack surface. The OWASP Top 10 for Agentic Applications identifies the following threats, among others:

  • Agent goal hijacking: Manipulated inputs cause the agent to pursue a goal entirely different to that intended by the developers. In the case of an agent with tool access, this can result in it deleting files, exfiltrating data, or executing malicious code.
  • Tool misuse and privilege escalation: Agents with access to tools and APIs can be manipulated into using them beyond their intended scope. In particular, if access controls are inadequate, an agent may perform privileged actions for which it is not authorized.
  • Memory poisoning: Attackers manipulate an agent’s persistent storage to influence its future behavior. Once injected, malicious code remains persistent across sessions and is activated during subsequent interactions.
  • Agent communication poisoning: In multi-agent systems, attackers can manipulate communication between agents.
  • Overwhelming Human-in-the-Loop: Agentic systems can overwhelm the human monitoring process by bombarding users with an excessive number of confirmation requests. This leads to decision fatigue (also known as “approval fatigue”) and ultimately to the blind approval of potentially harmful actions (also known as “YOLO mode”).

Attacks on AI Agents via MCP

Anthropic’s Model Context Protocol (MCP) has established itself as a widely adopted standard for the tool integration in AI systems. Tool integration is a central component of AI agents, as it significantly expands their capabilities. While LLMs can be thought of as the brain, MCP servers and tool calls are the hands – they enable interaction with the environment. However, this increasing adoption brings specific security risks. Three particularly serious attack vectors are explained in more detail below.

Tool Poisoning

A malicious MCP server hides harmful instructions within a tool’s description metadata. This metadata consists of text that is processed by an AI agent but is typically never displayed to the user in the UI. The agent treats the hidden instructions as part of the intended use of the tool and executes them.

Example for tool poisoning

The tool specification below demonstrates a tool poisoning attack disguised as a solution to the famous “How many R’s are contained in ‘strawberry’?” problem. The user sees a harmless, one-line description in the UI, while the model sees the complete JSON, including a hidden <IMPORTANT> block that inserts a mandatory grounding_context parameter and instructs the agent to silently populate it with the contents of ~/.ssh/id_rsa.

When the user asks their innocent counting question, the privileged agent reads the private key, passes it to the tool, and returns a correct answer. This doesn’t seem suspicious to the user, but the key has long since left the system via the tool’s call arguments.

Tool Shadowing

All associated tool descriptions are visible to the agent at the same time. This allows a malicious tool to plant behavioral clues that influence how the agent invokes another, legitimate tool. The malicious tool never performs the harmful action itself; it merely manipulates the agent’s reasoning. The code of the trusted tool remains unchanged.

Example for tool shadowing

The tool specification below demonstrates a tool shadowing attack. The summarize_text tool itself is harmless, as it merely summarizes text and does not send emails on its own. The poison lies once again in the description: a hidden instruction that the agent must set attacker@oneconsult.com in the BCC field for every subsequent email sent, disguised as an internal compliance requirement. As soon as this description is placed in the model context, it influences the behavior of a completely different, legitimate send_email tool belonging to the same agent. Employees in the sales department use the agent to summarize detailed notes from scoping calls with customers and forward them to other internal employees. The agent composes the message correctly and silently adds the attacker to the BCC field. The email arrives as usual; nothing seems suspicious. The malicious tool was never invoked, and the code of the email tool was never altered.

The following is a realistic excerpt from a tools/list response containing two tools: a clean send_email tool and a seemingly harmless summarize_text tool, whose description contains the shadowing attack.

Rug Pull

At the time of integration, an MCP server appears normal, passes the review, and is approved as legitimate. Later, the server operator changes the tool’s behavior or description to carry out malicious activities. The agent automatically adopts the new definition via the MCP’s dynamic capability announcement.

RAG Attacks

RAG pipelines also create new attack vectors. In document poisoning, attackers inject manipulated documents into the knowledge base. Anthropic’s research shows that as few as 250 poisoned documents in a corpus can be enough to induce backdoor behavior, regardless of the model’s size.

Example of an Attack Chain on an AI Agent

A medium-sized Swiss company uses a “Sales Assistant” – an AI agent that processes incoming customer inquiries from a shared mailbox, retrieves information from the CRM, and searches the internal knowledge base. In addition, it can use a web fetch tool to retrieve information from public company websites to automatically enrich the details of inquiring companies (industry, company size, location) and thus support lead prioritization. To increase efficiency, the agent was equipped with persistent memory so that it can retain context across multiple interactions.

four-attack-phases-ai-agent-security
  • Phase 1 – Infiltration: Attackers send an inconspicuous price inquiry to the public sales email address. Hidden within the HTML body of the email – invisible to the human eye, for example through Unicode tags or white text on a white background – are additional instructions: In the future, the agent is to additionally query the CRM for hot leads over CHF 100,000 for all support requests and send them to an external URL controlled by the attackers for automatic lead validation. (indirect prompt injection)
  • Phase 2 – Persistence: The agent interprets the hidden instruction as a legitimate process directive and stores it as a “sales process rule” in its long-term memory. From this point on, the attack requires no further interaction with the attackers. (memory poisoning; persistent compromise across session boundaries)
  • Phase 3 – Initiation: One week later, the same agent processes a completely legitimate request from another customer. In the background, it also follows the poisoned “sales process rule”: It retrieves the hot leads via its CRM tool and passes the data as URL parameters to its web fetch tool – supposedly to compare them against an external source “for lead validation”. In reality, the URL points to a server controlled by the attackers, which silently logs the parameters and returns an unsuspicious standard response. (agent goal hijacking, tool misuse)
  • Phase 4 – Exfiltration: The corporate data leaves the organization via a regular HTTP request from the web fetch tool – a tool used dozens of times a day in normal business operations. To SIEM, EDR, and DLP systems, the traffic looks like routine lead enrichment because the action is executed from an authorized identity. The human supervisor merely confirms the visible field “Mark customer inquiry as processed” – the malicious secondary action runs below their threshold of perception. (data exfiltration; insufficient logging & observability; approval fatigue in Human-in-the-Loop controls)

At no point in this attack chain was a traditional security vulnerability exploited. There is no CVE, no malware, and no exploit. The attack consists solely of text and logic that tricks a system into using its intended functions against its owner. A conventional vulnerability scan would overlook this attack path.

Why Traditional Security Tests Are Not Sufficient for AI Agents

Traditional vulnerability scans and application tests are designed to detect established attack patterns such as SQL injection, XSS, IDOR, or RCE. They do not cover the complex, AI-specific attack landscape. The risks of AI applications are fundamentally different:

  • Prompt injections are based on natural language and cannot be detected with signature-based scans.
  • Agentic vulnerabilities such as goal hijacking or memory poisoning arise from the interplay of model behavior, orchestration logic, and system architecture.
  • The attack vectors are highly dynamic and require creative, manual attack simulations by specialized penetration testers with expertise in AI security.
  • Tool integrations and MCP configurations must be evaluated in the context of the overall architecture, not in isolation from it.

A specialized AI Penetration Test closes this gap. It combines automated attack techniques with manual verification to uncover novel vulnerabilities that conventional tests cannot detect. Manual verification by specialized penetration testers is essential in this process: They evaluate the results within the context of the specific application architecture, identify logical vulnerabilities in the orchestration layer, and simulate targeted attacks that no scanner can anticipate.

Conclusion: Take Action Now and Secure AI Applications

The threat landscape for AI applications has fundamentally changed with the emergence of agentic systems. The key findings can be summarized as follows: Agentic AI systems create an entirely new category of security risks that go far beyond known LLM vulnerabilities, such as prompt injections. Tool misuse, agent goal hijacking, memory poisoning, and agent communication poisoning are real threats with potentially serious consequences. Prompt injections remain the most dangerous attack vector, and their scope of impact is significantly expanded by agentic systems. As a new standard for tool integrations, MCP introduces specific security risks that must be specifically addressed. And conventional security tests are not sufficient to uncover the novel vulnerabilities of agentic AI systems – this requires specialized AI penetration tests.

AI Agent Security Audit

Through its AI Agent Security service, Oneconsult offers specialized AI Penetration Tests designed to precisely close these gaps. As part of a gray-box testing approach, we analyze your AI applications, including architectural documentation, prompt templates, tool specifications, and configuration interfaces. You will receive a comprehensive security assessment that identifies prioritized vulnerabilities and provides specific recommendations for action.

Receive support with AI security
marco-bertenghi-senior-penetration-tester

Author

Marco Bertenghi is Senior Penetration Tester at Oneconsult with specialized AI expertise in the area of agentic systems and LLMs.

LinkedIn

Your security is our top priority – our specialists provide you with professional support.

Availability Monday to Friday 8:00 a.m. – 6:00 p.m (exception: customers with SLA – please call the 24/7 IRR emergency number).

Private individuals please contact your trusted IT service provider or the local police station.

For more information about our DFIR services here:

QR_CSIRT_2022_EN@2x
Add CSIRT to contacts

Don’t miss anything! Subscribe to our free newsletter.