{"id":30760,"date":"2026-07-23T12:47:32","date_gmt":"2026-07-23T11:47:32","guid":{"rendered":"https:\/\/www.kaspersky.co.uk\/blog\/ai-agents-under-attack-2026-incidents\/30760\/"},"modified":"2026-07-23T12:47:32","modified_gmt":"2026-07-23T11:47:32","slug":"ai-agents-under-attack-2026-incidents","status":"publish","type":"post","link":"https:\/\/www.kaspersky.co.uk\/blog\/ai-agents-under-attack-2026-incidents\/30760\/","title":{"rendered":"Practical attacks on corporate AI agents"},"content":{"rendered":"<p>Cybersecurity news increasingly focuses on attackers using AI for reconnaissance, vulnerability hunting, and writing scripts or malware. Against this backdrop, a less conventional category of attacks remains largely overlooked: threat actors leveraging AI tools that are already deployed within the target infrastructure.<\/p>\n<p>AI agents designed for coding, as well as command-line tools\u00a0\u2014 such as Claude Code CLI, Gemini CLI, Codex CLI, Amazon Q CLI, and the like\u00a0\u2014 are particularly attractive targets. These agents can read and modify files, execute shell commands, install packages, and connect to external services. Developers frequently allow them to run in autonomous mode to avoid manually confirming every action. For an attacker, such an agent becomes a ready-made multitool that has the right privileges, access to critical data, and security clearances from the get-go. That said, other types of AI agents, such as automated financial workflow assistants, are equally vulnerable to exploitation.<\/p>\n<h2>Why trusted agents pose a threat<\/h2>\n<p>An AI agent differs from standard software in its broad access privileges, the wide array of ways it can be prompted to execute actions, and the difficulty of detecting its anomalous behavior. Enterprise security controls (EPP, EDR, XDR, SIEM) scan for malicious files, known command patterns, and suspicious action sequences. Even if a specific strain of malware hasn\u2019t been seen before, its behavior often gives it away: bulk searches for documents, spawning PowerShell processes, accessing credential stores, or exfiltrating data to an external server from an unknown application will trigger a deluge of alerts in the SOC.<\/p>\n<p>It\u2019s much harder to apply that same detection logic to a legitimate, pre-installed AI agent. By design, these tools are capable of executing an extremely broad range of operations. Running scripts, reading configuration files (including secrets), moving documents, and installing dependencies can all be a part of their normal operation \u2014 especially on a developer\u2019s machine.<\/p>\n<p>When an attacker attempts to exploit this kind of AI system, they use natural language to convey their instructions to the agent. A request to hunt for passwords, API keys, or cryptocurrency wallets can be framed in thousands of ways, expressed in a variety of languages, or phrased indirectly. Furthermore, a malicious command can be hidden in any data stream the agent reads\u00a0\u2014 including text fields in documents, file names, or even error logs, as shown in one of the examples below.<\/p>\n<p>Integration between agents and third-party software further expands the attack surface. Agents are frequently connected to email, instant messaging apps, task management systems, knowledge bases, and MCP servers. As a result, a malicious instruction can originate from virtually any source whose data the agent processes automatically.<\/p>\n<p>Below are several examples of attacks where threat actors leveraged AI agents to achieve their goals.<\/p>\n<h2>The Nx attack: a coding agent hunting for passwords<\/h2>\n<p>The most prominent and widespread example is the compromise of Nx npm packages in August 2025, <a href=\"https:\/\/www.kaspersky.com\/blog\/nx-build-s1ngularity-supply-chain-attack\/54223\/\" target=\"_blank\" rel=\"noopener nofollow\">dubbed s1ngularity<\/a>. Attackers exploited a vulnerable GitHub Actions workflow, stole a package-publishing token, and released trojanized versions of several @nx packages that harvested developer secrets.<\/p>\n<p>The malicious post-install script checked whether Claude Code, Gemini CLI, or Amazon Q CLI were installed on the victim\u2019s machine. If any of these were detected, the agent was issued an instruction to scan for cryptocurrency wallets, ENV files, API keys, and other sensitive data. The agents were executed with auto-approval flags enabled, such as <code>--dangerously-skip-permissions<\/code>, <code>--yolo<\/code>, and <code>--trust-all-tools<\/code>.<\/p>\n<p>The search results were then exfiltrated to public GitHub repositories created by the attackers. Over several waves of the attack, thousands of secrets belonging to hundreds of organizations were exposed.<\/p>\n<p>Instead of developing a complex, custom harvesting tool, the attackers repurposed the victim\u2019s own legitimate agent. It already could navigate the file system, understand file context, and identify high-value target data. However, post-incident analysis by security experts revealed drawbacks to this approach: the AI occasionally refused to carry out unethical tasks. Furthermore, the malware authors had to adjust their code so that it \u201cwaited\u201d for the AI agent, which could take a considerable amount of time to process the task while generating significant intermediate output.<\/p>\n<h2>Communication via\u2026 error logs<\/h2>\n<p>The <a href=\"https:\/\/tenetsecurity.ai\/blog\/agentjacking-coding-agents-with-fake-sentry-errors\/\" target=\"_blank\" rel=\"noopener nofollow\">AgentJacking<\/a> study was not a malicious attack, but it differed from one only in intent: its authors had no interest in stealing secrets. After developing the attack technique, the researchers tested it on a global scale and received callback responses from AI agents belonging to more than a hundred real-world companies \u2014 some of them major enterprises.<\/p>\n<p>The attack targeted Sentry, a widely used telemetry service. Websites and mobile applications automatically transmit error reports to Sentry so developers can monitor issues without requiring active user reporting. These reports are accepted without authentication because errors often occur for anonymous visitors that the site or application knows nothing about.<\/p>\n<p>The researchers configured their own MCP server within Sentry, allowing AI agents to analyze reports automatically. Next, they submitted a fake error message containing a data block formatted to match Sentry\u2019s MCP server data structure. Embedded inside was an indirect prompt injection\u00a0\u2014 an instruction to run \u201cadditional diagnostics\u201d via a command like: <code>npx @controlled-validation-package --diagnose<\/code>.<\/p>\n<p>If error handling were delegated to an agent, it could take the instruction as legitimate and execute a command resulting in the automatic installation of a third-party package. In this experiment, the package merely contacted the researchers\u2019 command-and-control server without exfiltrating any sensitive data. A genuine malicious package, however, could steal credentials, tamper with code, or establish persistence in the system. Identifying targets for such an attack is equally straightforward: an organization\u2019s use of Sentry is easily detectable by analyzing website code or checking the strings in mobile application binaries.<\/p>\n<p>Notably, according to the study\u2019s authors, Sentry acknowledged the issue but stopped short of implementing comprehensive fixes, opting instead to block only the specific variant of the malicious query routed through the MCP. Screenshots included in the study reveal that a Sentry employee described the system as \u201ctechnically not defensible\u201d against the attack.<\/p>\n<h2>Stealing financial data via MCP<\/h2>\n<p>Abusing unsecured MCP servers\u00a0\u2014 as seen in the Sentry case\u00a0\u2014 is just one way to attack this protocol. Introduced just a year ago, and already dubbed \u201cUSB for AI agents\u201d, the Model Context Protocol standard was adopted rapidly without robust built-in security controls. As a result, attacks targeting MCP are bound to proliferate \u2014 <a href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2026\/06\/30\/securing-ai-agents-ai-tools-move-from-reading-acting\/\" target=\"_blank\" rel=\"noopener nofollow\">a trend Microsoft recently warned about<\/a>.<\/p>\n<p>Threats can lie hidden even within the description of an MCP tool before the agent ever uses it. Agents parse tool descriptions to determine when to call the tool and what data to supply. If an MCP server provider stealthily alters a description \u2014 adding an instruction that demands collection of additional data \u2014 the agent may execute it as part of its standard workflow.<\/p>\n<p>Microsoft highlights a scenario involving a financial agent that verifies vendor banking details via an external MCP service. Following a malicious update to the tool\u2019s description, the agent begins appending unpaid-invoice data to its responses. The user sees a normal response, while confidential financial data is quietly exfiltrated to the server owner. Individually, each operation appears authorized: the agent operates under the employee\u2019s permissions, queries an approved service, and uses a standard interface. Yet a data breach still occurs.<\/p>\n<p>It remains unclear from Microsoft\u2019s ambiguous phrasing whether this example is purely hypothetical or based on an investigation into a live incident. However, the fact that the post originated from Microsoft Incident Response points to the latter.<\/p>\n<h2>Prompt injections have already gone mainstream<\/h2>\n<p>In 2026, Unit 42 researchers <a href=\"https:\/\/unit42.paloaltonetworks.com\/ai-agent-prompt-injection\/\" target=\"_blank\" rel=\"noopener nofollow\">identified<\/a> widespread attempts to covertly embed instructions designed for AI systems across numerous public websites. Many of these instructions aim to force models to reveal system prompts, approve sites and posts during ad placement reviews, or boost phishing pages through SEO manipulation.<\/p>\n<p>Similarly, <a href=\"https:\/\/blog.google\/security\/prompt-injections-web\/\" target=\"_blank\" rel=\"noopener nofollow\">an analysis of Common Crawl data<\/a> by Google recorded a surge in such material: between November 2025 and February 2026, the share of malicious injections increased by 32%.<\/p>\n<p>That said, confirmed cases of successful compromise using these techniques remain scarce. The presence of an injection on a webpage does not guarantee that an agent ever actually executed the command. Nevertheless, threat actors have clearly begun optimizing web content for an era when it will be read not just\u00a0\u2014 and perhaps not primarily\u00a0\u2014 by humans.<\/p>\n<h2>How to defend against agent-based attacks<\/h2>\n<p>The key takeaway for cybersecurity teams and all AI users alike is simple: an AI agent should never be considered trusted merely because it has been officially approved for enterprise use.<\/p>\n<p>Organizations must:<\/p>\n<ul>\n<li>Maintain an inventory of agents, MCP servers, and the various tools available for them. Use allowlists to restrict agent tools, and package installations to components explicitly vetted and approved by information security. Allowlists must specify exact package versions.<\/li>\n<li>Monitor version changes to MCP tools and other dependencies. Re-evaluate updates before adding them to the approved inventory.<\/li>\n<li>Apply the principle of least privilege. Grant agents only the specific permissions needed for a given task, and only for the duration of that task.<\/li>\n<li>Enforce human-in-the-loop approval for package installations, script executions, file sends, and other high-risk actions.<\/li>\n<li>Run agents in isolated environments with limited access to developer workstations.<\/li>\n<li>Disable dangerous auto-approval modes.<\/li>\n<li>Restrict outbound network connections, and permit data transmission only for approved services.<\/li>\n<li>Store secrets in centralized, secure vaults, using short-lived tokens and rotating them regularly.<\/li>\n<li>Forward prompt logs, tool calls, shell commands, and agent network traffic into <a href=\"https:\/\/www.kaspersky.co.uk\/enterprise-security\/unified-monitoring-and-analysis-platform?icid=gb_kdailyplacehold_acq_ona_smm__onl_b2b_kasperskydaily_wpplaceholder_______\" target=\"_blank\" rel=\"noopener\">SIEM<\/a> and <a href=\"https:\/\/www.kaspersky.co.uk\/next-xdr-optimum?icid=gb_kdailyplacehold_acq_ona_smm__onl_b2b_kdaily_wpplaceholder_sm-team___knext____8decdd5dd6f73a2c\" target=\"_blank\" rel=\"noopener\">XDR<\/a> systems. For these tools to be effective, they require deep operational context regarding agent activity alongside specialized rule sets tailored to AI data processing pipelines.<\/li>\n<\/ul>\n<input type=\"hidden\" class=\"category_for_banner\" value=\"kaspersky-next\">\n","protected":false},"excerpt":{"rendered":"<p>We analyze the first-ever real-world incidents where attackers targeted AI agents deployed in corporate environments.<\/p>\n","protected":false},"author":2722,"featured_media":30761,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1836,2360,2361],"tags":[1043,3913,3856,1695],"class_list":{"0":"post-30760","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-business","8":"category-enterprise","9":"category-smb","10":"tag-ai","11":"tag-ai-agents","12":"tag-llm","13":"tag-machine-learning"},"hreflang":[{"hreflang":"en-gb","url":"https:\/\/www.kaspersky.co.uk\/blog\/ai-agents-under-attack-2026-incidents\/30760\/"},{"hreflang":"en-in","url":"https:\/\/www.kaspersky.co.in\/blog\/ai-agents-under-attack-2026-incidents\/30925\/"},{"hreflang":"en-ae","url":"https:\/\/me-en.kaspersky.com\/blog\/ai-agents-under-attack-2026-incidents\/25957\/"},{"hreflang":"ru","url":"https:\/\/www.kaspersky.ru\/blog\/ai-agents-under-attack-2026-incidents\/42338\/"},{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/ai-agents-under-attack-2026-incidents\/56169\/"},{"hreflang":"ru-kz","url":"https:\/\/blog.kaspersky.kz\/ai-agents-under-attack-2026-incidents\/30882\/"},{"hreflang":"en-au","url":"https:\/\/www.kaspersky.com.au\/blog\/ai-agents-under-attack-2026-incidents\/36425\/"},{"hreflang":"en-za","url":"https:\/\/www.kaspersky.co.za\/blog\/ai-agents-under-attack-2026-incidents\/36320\/"}],"acf":[],"banners":"","maintag":{"url":"https:\/\/www.kaspersky.co.uk\/blog\/tag\/ai\/","name":"AI"},"_links":{"self":[{"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/posts\/30760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/users\/2722"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=30760"}],"version-history":[{"count":0,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/posts\/30760\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/media\/30761"}],"wp:attachment":[{"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=30760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=30760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaspersky.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=30760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}