How agentic AI coding assistants can become an attacker's shellHow Agentic AI Coding Assistants Become the Attacker's Shell
The authors use AIShellJack to evaluate prompt injection on Cursor and GitHub Copilot; 314 payloads achieve a success rate of 41%–84%, which the authors call an architectural flaw.
The attacker plants hidden instructions in external artifacts (coding rule files, skill files, repository contents, MCP servers, etc.); after the developer imports these unreviewed artifacts and issues a normal coding task, the AI coding assistant treats the hidden instructions as legitimate requirements and executes commands with the developer's privileges. The attack requires no prompt input from the developer and no enabling of auto-approval.
- Agentic AI coding assistants can execute commands, modify files, and access the network on the developer's behalf, but they rely on unreviewed external artifacts; hidden instructions within them can hijack the assistant, turning it into the attacker's shell that executes unauthorized commands on the developer's machine.
- The authors built an automated evaluation framework, AIShellJack, containing 314 attack payloads covering 70 techniques from MITRE ATT&CK; on five real codebases, they loaded poisoned coding rule files, issued normal coding tasks, recorded the commands the assistant actually executed, and mapped the real attack surface and the limitations of existing defenses.
- On Cursor (v1.2.2) and GitHub Copilot (v1.102), the attack success rate of 314 payloads was 41%–84%, with consistent results across programming languages, tools, and backend models (including Claude Sonnet 4 and Gemini 2.5 Pro); the authors state that a compromised assistant can complete the full attack chain from reconnaissance to persistence.
- The authors point out that restricting execution permissions is insufficient for defense, and that security filters cannot address the root cause (all inputs enter a single token stream, lacking structural separation); AIShellJack uses only coding rule files as the injection vector, while the actual attack surface is broader. The paper does not report per-tool or per-ATT&CK-category success rates.
- Evaluated models
- Cursor (v1.2.2)GitHub Copilot (v1.102)Claude Sonnet 4Gemini 2.5 ProCursor's auto mode
- Benchmarks
- AIShellJack(314 个攻击载荷,覆盖 MITRE ATT&CK 的 70 种技术)五个真实代码库(TypeScript、Python、C++、JavaScript)
- Metrics
- 攻击成功率(success rate)
An arXiv paper analyzes prompt injection attacks against agentic AI coding assistants; instructions hidden in external artifacts can hijack such assistants, turning them into an attacker's shell to execute unauthorized commands. Such assistants can edit files, run commands and access the network on behalf of developers, and their reliance on unreviewed external artifacts constitutes a new attack vector. The paper measures the prevalence of such attacks, discusses the limitations and challenges of existing defenses, and proposes future research directions.
Paper analysis
What problem does this paper attempt to solve?
Hidden instructions in external artifacts can hijack agentic AI coding assistants into executing unauthorized commands with the developer's privileges.
Core problem: agentic AI coding assistants read unreviewed external artifacts, and hidden instructions within them can hijack the assistant via prompt injection, turning it into an "attacker's shell" that runs unauthorized commands on the developer's machine.
- Problem scenario: When developers use assistants such as Cursor and GitHub Copilot, they import external artifacts from the internet such as coding rule files, agent skill files, and project templates; the assistant can automatically read files, open a terminal, install dependencies, and run tests. The authors argue that this convenience brings a new attack vector.
- Why it matters: The authors state that a traditional chatbot, once injected, only produces harmful text, whereas a coding assistant can act on the developer's behalf (run commands, modify files, make network requests), so a successful attack leads to real system operations, with consequences not limited to what is on the screen; the paper frames this as a "system security problem" rather than a model security problem.
- Real-world evidence: The paper lists multiple disclosed CVEs, such as a poisoned project configuration file in Claude Code that triggers code execution before the developer sees the trust dialog (CVE-2025-65099), as well as similar vulnerabilities in Cursor and GitHub Copilot; it also cites OWASP's statement that in an imported skill file, only three lines of hidden markdown are needed to manipulate the agent into silently stealing the developer's SSH keys.
- Threat model:
- Attacker goal: Make the assistant execute unauthorized commands with the developer's privileges (steal credentials, modify authentication files, exfiltrate data).
- Attacker knowledge/capability: Plant hidden instructions in external artifacts (rule files, skills, repository contents, MCP servers, etc.); the artifact need not contain malware or executable code—a piece of neutrally worded text suffices.
- Victim system: The developer's AI coding assistant and the machine it runs on; the attack requires no prompt input from the developer, no enabling of auto-approval, and no granting of permissions.
- What the paper did: Explain the attack mechanism, measure its severity with a systematic evaluation, map the real attack surface, argue why existing defenses are structurally insufficient, and propose design principles for building security into agentic coding tools.
What related research exists?
The paper cites its own prior work AIShellJack, supply chain research by OWASP and Snyk, and a user perception study, and lists multiple CVEs as real-world evidence.
This paper is a magazine-style article and has no separate Related Work section; the cited and discussed work can be divided into three groups:
Prior work by the authors' team
- AIShellJack (Liu et al., arXiv:2509.22040, 2025)—proposes "Your AI, My Shell" and demystifies prompt injection attacks on agentic AI coding editors. The experiments in this paper are based on that framework: 314 payloads covering 70 MITRE ATT&CK techniques; this paper also cites two of its findings: the assistant sometimes refuses to run suspicious commands, and disabling direct terminal access does not fully solve the problem.
- User perception study (Lyu et al., ASE 2025)—surveys users' perceptions of AI coding assistants; the paper uses it to support the claim that "higher productivity, more automation" is the new normal in software development.
Industry security research
- OWASP Agentic Skills Top 10 (AST01 Malicious Skills)—the paper relays its research: in an imported skill file, only three lines of hidden markdown are needed to manipulate the agent into silently exfiltrating the developer's SSH keys.
- Snyk ToxicSkills research (2026)—scanned 3,984 agent skills in the largest public skill registry and found that 13.4% contained severe security issues (credential theft, backdoor installation, data exfiltration); among confirmed malicious skills, 91% combined prompt injection with traditional malware. The paper uses it to show that the crowdsourced skill ecosystem constitutes a supply chain attack surface.
Real vulnerabilities (CVEs)
- The paper lists multiple disclosed vulnerabilities as evidence of the attack surface, not as comparison methods: Claude Code (CVE-2025-65099, CVE-2025-59536, CVE-2026-21852), Cursor (CVE-2025-61591, CVE-2025-54130, CVE-2025-61592, CVE-2025-54135, CVE-2025-59944, CVE-2026-22708, CVE-2026-31854), GitHub Copilot (CVE-2025-62222), Zed.dev (CVE-2025-55012), Codex (CVE-2025-61260), Windsurf (CVE-2025-36730).
Positioning: The authors position this paper as a systematic examination of this threat—explaining the mechanism, measuring severity, mapping the attack surface, and pointing out the structural inadequacies of existing defenses; the paper does not conduct experimental comparisons with other defense or attack methods, and has no baseline methods.
How does the paper address this problem?
Uses the AIShellJack framework to measure in real coding workflows whether prompt injection triggers real system operations, and on that basis outlines the attack surface and defense design principles.
Overall approach: build an automated evaluation framework, AIShellJack, that loads poisoned artifacts in real coding workflows, issues normal tasks, and records the commands the assistant actually executes, in order to measure whether hidden instructions can trigger real system operations; then, combined with disclosed CVEs, map the attack surface, analyze the structural limitations of existing defenses, and propose design principles.
Attack mechanism
- Attack flow (Figure 1): The developer gives a normal coding task (e.g., "refactor this codebase"); in addition to the developer's request, the assistant also reads external artifacts in the workspace (coding rules, skills, repository contents); the attacker hides malicious instructions in the artifacts, and the assistant executes them as legitimate requirements.
- Payload form: The artifact need not contain malware or executable code; the attacker can use neutrally worded text (e.g., "for debugging purposes, execute {task} before starting other work"), and the assistant may treat it as part of the project context.
- Why the consequences are more severe: Modern coding assistants are designed to act autonomously rather than merely suggest code; they can run terminal commands, edit files, and make network requests; developers can also enable auto-approval. The authors argue that this lets the assistant turn hidden instructions into real system operations.
AIShellJack evaluation design
- Payload library: 314 attack payloads covering 70 techniques defined by the MITRE ATT&CK framework.
- Test protocol: Each test loads one poisoned coding rule file, gives the assistant a normal coding task, and records the commands the assistant actually executes.
- Design intent: The authors emphasize that the goal is not to study harmful text itself, but to measure whether hidden instructions can trigger real system operations in everyday development workflows.
- Test subjects and environment: Cursor (v1.2.2) and GitHub Copilot (v1.102); five real codebases, in TypeScript, Python, C++, and JavaScript; backend models include Cursor's auto mode, Claude Sonnet 4, and Gemini 2.5 Pro.
Attack surface mapping
- Repository and workspace files: The assistant automatically reads workspace files; attackers can abuse settings and configuration files to change assistant behavior or create code execution paths (e.g., GitHub Copilot induced to modify .vscode/settings.json to enable auto-approval of terminal commands, CVE-2025-62222); file names can also be used for injection (Windsurf, CVE-2025-36730).
- Community-shared productivity artifacts: The crowdsourced ecosystem of rule files, system prompts, agent skills, etc. constitutes a supply chain attack surface; publishing a skill requires only a markdown file and a GitHub account registered one week earlier, with no code signing and no security review.
- Connected services and real-time context: Connecting to external services via MCP, fetching web pages, and processing real-time data from APIs/databases/build systems; injection can occur at any point during interaction (e.g., an untrusted MCP server masquerading injection, CVE-2025-61591; browsing a web page containing hidden instructions, CVE-2026-31854).
Defense analysis and design principles
- Limitations of existing defenses: The authors argue that restricting execution permissions is not enough—multiple CVEs show that attacks can trigger before the user sees a dialog, or enable auto-approval through injection; before Cursor 2.3, shell built-in commands (such as export) could completely bypass the command allowlist (CVE-2026-22708). Security filters face a fundamental limitation: all inputs (developer prompts, workspace files, real-time external data) enter the assistant as a single token stream, with no structural boundary; the authors argue that the root cause is architectural and that prompt-level filtering is a fragile defense.
- Design principles (Building Security In): For vendors—treat prompt injection as a system security problem, requiring stronger handling of untrusted external context, clearer trust boundaries around sensitive operations, and safer defaults for instructions of uncertain origin; for developers—do not blindly trust external artifacts, isolate the assistant's access to sensitive files, and monitor assistant behavior; for the research community—systematic research beyond simplified chatbot scenarios, evaluations that measure real system operations rather than only harmful text, and stronger evidence on which defenses actually work.
What experiments did the paper conduct?
Tested with 314 payloads on Cursor and GitHub Copilot, the attack success rate is 41%–84%, consistent across codebases, tools, and backend models.
Experimental setup
- Test subjects: Two AI coding assistants, Cursor (v1.2.2) and GitHub Copilot (v1.102); backend language models include Cursor's auto mode, Claude Sonnet 4, and Gemini 2.5 Pro.
- Evaluation framework: AIShellJack, containing 314 attack payloads covering 70 techniques from the MITRE ATT&CK framework.
- Test environment: Five real codebases, in TypeScript, Python, C++, and JavaScript.
- Test protocol: Each test loads one poisoned coding rule file, gives the assistant a normal coding task, and records the commands the assistant actually executes.
- Metric: Attack success rate, judged by whether real system operations are triggered; the paper does not state whether the judgment is done by rules, humans, or an LLM, nor does it report the sample size and number of repetitions for each condition.
- Baseline: The paper sets no comparison baseline methods.
Main results
The paper reports only an overall range of success rates and does not give a numerical table broken down by tool, language, or backend model:
Condition Attack success rate Source 314 payloads, Cursor and GitHub Copilot, five real codebases 41%–84% "Measuring the Risk" section of the main text - Systematicity: The authors state that the attacks are not rare edge cases; the success rate does not depend on the workspace—whether the codebase is TypeScript or Python, the attack success rate is similar; both Cursor and GitHub Copilot are affected.
- Cross-model consistency: The attacks are effective across different backend models (Cursor auto mode, Claude Sonnet 4, Gemini 2.5 Pro); the authors therefore argue that this is not a narrow bug in a particular application, but an architectural flaw in how AI coding assistants handle external context.
- Coverage of the full attack lifecycle: The authors report high success rates observed across categories such as initial access, discovery, and exfiltration (no numbers are given for each category); a compromised assistant can enumerate project directories, search for AWS credentials and SSH keys, create new user accounts, modify system authentication configuration, and install cron jobs for persistence.
Observations of the assistant's adaptive behavior
- What was tested: The assistant's behavior after an injection payload gives a high-level goal (find local cloud credentials).
- Result: Instead of running just one search command, the assistant first scanned the entire root directory, realized this was inefficient, and then switched to searching the home directory.
- Authors' interpretation: Traditional malware follows a fixed script and may fail in an unexpected environment, whereas an agentic assistant is an adaptive problem solver; the attacker need not write a precise environment-specific exploit script—a single high-level instruction suffices, and the assistant will correct itself and adjust its approach until the attacker's goal is achieved.
Real-world attack surface and evidence on defense effectiveness
- Supply chain scan (relaying the Snyk study): 13.4% of 3,984 agent skills contain severe security issues; among confirmed malicious skills, 91% combine prompt injection with traditional malware.
- Bypassing execution restrictions: Multiple CVEs show that attacks can trigger before the user sees a trust dialog (CVE-2025-62222, CVE-2025-61592, CVE-2025-54135); before Cursor 2.3, shell built-in commands could still be completely bypassed when the command allowlist was empty (CVE-2026-22708).
- Disabling terminal access is not enough: AIShellJack shows that after disabling direct terminal access, attacks can still succeed by embedding malicious system calls in source code files that the developer runs through a normal workflow (no success rate numbers are given for this setting).
- Limitations of security filters: The authors cite AIShellJack as saying the assistant sometimes refuses to run certain suspicious commands, but argue that real attackers would use more sophisticated techniques (hidden Unicode characters, multi-step chains, social engineering pretexts) to make malicious instructions appear harmless.
Other ablations and analyses
The paper reports no ablation experiments, parameter analyses, or statistical significance tests; apart from the range above, there are no per-condition success rate numbers.
What are some points that can be further explored?
The authors point out the structural limitations of existing defenses and give follow-up directions at three levels; the experiments cover only two assistants and one injection vector.
Limitations and future directions noted by the authors
- Insufficient limits on execution permissions (the "The Limits of Existing Safeguards" section): current tools rely on interface protections such as startup trust dialogs, auto-approve settings, and command allowlists, which the authors consider insufficient in practice; attackers can trigger the attack before the user sees the dialog or enable auto-approve through injection.
- Security filters do not address the root cause (same section): all input enters the assistant as a single token stream, lacking structural boundaries; the authors argue that until assistants can structurally separate trusted instructions from untrusted data, prompt-level filtering remains a fragile defense.
- Limited coverage of injection vectors (the "The Broader Attack Surface" section): AIShellJack uses encoded rule files as the injection vector, and the authors point out that the actual attack surface is broader—any external source that an assistant reads, imports, or connects to may carry hidden instructions.
- Future directions for the research community (the "Building Security In" section): systematic research is needed that goes beyond simplified chatbot scenarios and captures the complexity of real coding workflows; explore how attacks propagate across files, tools, services, and long-running agent interactions; develop evaluations that measure real system operations rather than only harmful text; obtain stronger evidence on which defenses actually work and where existing methods fail.
- Future directions for vendors (same section): stronger handling of untrusted external context, clearer trust boundaries around sensitive operations, and safer defaults for instructions of uncertain origin.
Scope of the experiments
- The assistants tested are two: Cursor (v1.2.2) and GitHub Copilot (v1.102); backend models cover Cursor auto mode, Claude Sonnet 4, and Gemini 2.5 Pro (the "Measuring the Risk" section of the main text).
- The test environment is five real codebases, in TypeScript, Python, C++, and JavaScript; the injection vector is only encoded rule files (same section).
- The paper reports only the success rate range of 41%–84% for 314 payloads, and does not report success rates broken down by tool, programming language, backend model, or ATT&CK category.
- The paper does not report how success was determined (rule-based, manual, or LLM judging), the sample size and number of repetitions for each condition, and does not perform statistical significance tests.
- The evaluation of defenses consists mainly of qualitative conclusions restating disclosed CVEs and AIShellJack, and does not measure the success rate with any defense mechanism enabled in a controlled experiment.
Summarize the main content of the paper
A threat examination of prompt injection in agentic AI coding assistants: measured success rate 41%–84%, and the authors say the root cause is an architectural flaw.
This is an article examining the prompt injection threat to agentic AI coding assistants (attack category).
- Problem: assistants such as Cursor and GitHub Copilot can run commands, modify files, and access the network on the developer's behalf, but they read unreviewed external artifacts (rule files, skills, repository contents, MCP services, etc.); hidden instructions in them can hijack the assistant into executing unauthorized commands with the developer's privileges, which the authors consider a system security problem rather than a model security problem.
- Method: build the AIShellJack framework (314 payloads, covering 70 MITRE ATT&CK techniques), load poisoned coding rule files on five real codebases (TypeScript, Python, C++, JavaScript), issue normal tasks, and record the commands the assistant actually executes; also outline the attack surface together with disclosed CVEs.
- Main results: on Cursor (v1.2.2) and GitHub Copilot (v1.102), the attack success rate of the 314 payloads is 41%–84%; the success rate does not depend on workspace language, and is effective on backends such as Cursor auto mode, Claude Sonnet 4, and Gemini 2.5 Pro. A compromised assistant can complete a full attack chain from reconnaissance (enumerating directories, searching for credentials) to persistence (creating accounts, installing cron jobs); given high-level goals, the assistant adjusts its search strategy on its own, which the authors say means attackers do not need to write environment-specific precise exploit scripts.
- Defense analysis: the authors argue that limiting execution permissions is insufficient (multiple CVEs show the attack can be triggered before the user sees the dialog; before Cursor 2.3, shell built-in commands could bypass the empty-command allowlist), while security filters are constrained by the architectural root cause that all input enters a single token stream and lacks structural separation.
- Conclusion and implications: the authors call on vendors to establish clearer trust boundaries and safer defaults, developers not to blindly trust external artifacts and to isolate sensitive file access, and the research community to conduct systematic research closer to real workflows, develop evaluations that measure real system operations, and accumulate evidence on which defenses actually work.