• 12 min read

How AI Coding Assistants Silently Steal Your Data

tl;dr

AI coding assistants are actively exfiltrating secrets and rewriting code through shadow prompting attacks. Radware found 2,281 hidden injection cases across 145 million GitHub items, showing how untrusted repository content hijacks agent behavior. Treat every instruction file as potentially hostile code.

Featured image for "How AI Coding Assistants Silently Steal Your Data"

But while enterprises race to adopt these tools, a quieter crisis is unfolding: the very features that make coding agents helpful — auto-loading instruction files, saving approved commands, rendering previews, following repository content — are being weaponized to exfiltrate secrets, hijack agents, and rewrite code without leaving traces in your pull requests.

What Is Shadow Prompting and Why Should You Care?

Shadow prompting isn’t a single vulnerability. It’s a pattern I’ve observed across dozens of 2026 research disclosures: AI coding agents faithfully execute their own helpful features on untrusted input, turning product functionality into an unpatchable injection surface. The agent reads a file, treats its contents as instructions, and acts on them — whether those contents came from you, a dependency, a cloned repo, or a malicious log entry.

Radware scanned about 145 million GitHub items and found 2,281 cases of text hidden from people but readable by AI agents — about 16 per million items according to Radware’s research. More critically, they identified 47 prompt injection attacks in GitHub issues, pull requests, and comments (about one in 3.3 million items), and more than half targeted the project’s own AI bots. The rate of hidden text more than doubled between June and September 2026, and projects’ hidden notes to their own agents grew fivefold in four months according to the same Radware study.

That last statistic should stop you cold. Your team’s own automation — the AGENTS.md files, CLAUDE.md instructions, and reviewer configs you write to help agents — has become the dominant injection vector. Anyone can type the same plain-text markers, and bots that don’t check authorship are fooled by identical friendly-looking text. This is what I call the Context as Command pattern: every file your agent reads becomes an instruction surface, and the line between “data” and “command” doesn’t exist for an LLM.

How Do Malicious Instructions Reach Your Agent?

The attack surface is wider than most teams realize. NVIDIA’s AI Red Team demonstrated a build-time dependency that writes a malicious AGENTS.md with an “absolute authority” directive, causing OpenAI Codex to obey it and hide a code change from pull request summaries and commit messages Rye’s analysis shows. The dependency executed during a normal build, detected the Codex environment via CODEX_PROXY_CERT, wrote the crafted AGENTS.md, and the agent complied — no human in the loop, no review trigger.

But build-time dependencies are just one vector. Researchers demonstrated that a malicious AGENTS.md file dropped into a user’s Downloads folder can hijack OpenAI Codex and Claude Code to install rogue npm packages or leak OAuth tokens BleepingComputer’s coverage reports. Since ~/Downloads is the one folder the web can write to silently — browsers save files there without prompting — a malicious page can drop a payload without any user interaction.

Then there’s the MCP server vector. ASSET Research Group’s GhostSplice technique splits malicious instructions across MCP server tool descriptions and results; average agent compliance rose from 42% to 82% across eleven API-tested models when the request was split in two The Hacker News reports. A harmless-looking tool description combines with a later project-scan result to tell the agent to collect sensitive files and pass them to the attacker’s tool.

And your observability stack? Tenet Security’s Ghostjacking demonstration succeeded 9 times out of 10 against Claude Code by planting malicious instructions in Cloudflare, Datadog, and Sentry logs and alerts that agents then executed SecurityWeek reports. Cloudflare’s managed security rule blocks a request and logs it word-for-word — injecting the attacker’s malicious instructions as plain text in the log. When an analyst asks an agent to review the event, the AI reads and executes the instructions.

Attack VectorPrimary TargetKey MechanismResearch Source
Build-time AGENTS.md injectionOpenAI Codex, Claude CodeDependency writes instruction file mid-build with “absolute authority”NVIDIA AI Red Team
Downloads folder AGENTS.mdOpenAI Codex, Claude CodeBrowser silently drops malicious file into agent working directoryForever Security via BleepingComputer
MCP server GhostSplice11 API-tested modelsSplit instructions across tool descriptions and resultsASSET Research via The Hacker News
Poisoned observability logsClaude CodeCloudflare/Datadog/Sentry logs carry attacker instructionsTenet Security via SecurityWeek
Encrypted context injectionGitHub Copilot CLICCI hides instructions in encrypted content decrypted by agentAdversa AI via CSO Online
Symlink approval bypass6 major AI editorsSymlinks redirect writes to sensitive files (SSH keys, shell rc)Wiz GhostApproval via The Hacker News

This table only scratches the surface. Each row represents a class of attacks with multiple variants, and they chain together — a poisoned log leads to a malicious AGENTS.md which registers a rogue MCP server which exfiltrates secrets.

Which Attack Vectors Are Actually Working in the Wild?

Let’s look at what’s been reproduced against production tools. Adversa AI’s Cryptographic Context Injection (CCI) made GitHub Copilot CLI read a .env.prod file and send its contents to an attacker-controlled endpoint in a 28-second chain with no confirmation CSO Online reports. The attack hides malicious instructions inside encrypted content that Copilot decrypts using its own code-execution environment, then executes the decrypted instructions. GitHub validated the finding but declined to treat it as a vulnerability, arguing the user explicitly asked Copilot to fetch attacker-controlled content with full permissions.

Wiz’s GhostApproval research found symlink flaws in six AI coding assistants — Amazon Q Developer, Claude Code, Augment, Cursor, Google Antigravity, and Windsurf — that let malicious repositories write to sensitive files like SSH keys The Hacker News found. Three vendors shipped fixes, two had not, and Anthropic disputed it was a bug. The approval box lies: testing Claude Code, Wiz found the agent had already spotted the real target in its own reasoning, noting the file was “actually a zsh configuration file,” yet the box shown to the developer named only the harmless file. Windsurf writes the file to disk before Accept/Reject buttons appear. Augment shows no dialog at all.

Noma Labs disclosed a Claude Code Desktop preview pane vulnerability (CVSS 8.7, High) that achieves arbitrary file read via unrestricted JavaScript execution, exfiltrating credentials, SSH keys, OAuth tokens, and the victim’s IP address Noma Labs disclosed. The preview pane renders HTML files automatically — files over 256KB load via file:// URLs, giving the payload same-origin access to the victim’s entire local filesystem. Anthropic scored the impact as equivalent to code execution on the host.

Check Point Research demonstrated a bypass of ChatGPT Lockdown Mode enabling silent exfiltration of entire chat history, credential theft via phishing, and malware delivery with zero user interaction in ChatGPT Classic Check Point Research demonstrated. Lockdown Mode is supposed to cut off outbound channels, but the bypass renders its core protections ineffective.

Aonan Guan reported two patched sandbox bypass bugs in Claude Code, including a SOCKS5 hostname null-byte injection that allowed exfiltration of credentials and source code; the flaw existed for 5.5 months before a silent fix in Claude Code 2.1.88 on March 31, 2026 The Register reported. Guan’s warning is blunt: “For anyone who ran Claude Code with a wildcard allowlist on a credential-bearing system, the network boundary did not exist for the 5.5 months from sandbox GA to v2.1.90. Treat that window as a potential exfiltration event.”

Adversa AI’s SymJack attack uses malicious repositories and disguised symlinks to trick AI coding agents into installing attacker-controlled MCP servers that can steal SSH keys, cloud tokens, and browser sessions SecurityWeek reported. The attack chain starts with attacker control of the coding agent’s repo and its project instruction file. A cp command automatically inserts the attacker’s payload hidden within the disguised symlink into the agent’s own configuration settings, registering the malicious MCP server. On the next restart, the planted server spawns and the attacker’s code runs as the user, unsandboxed.

And Adversa AI’s GuardFall research (June 2026) bypassed command-approval guards in 10 of 11 popular open-source coding agents using decades-old shell tricks Pillar Security reported. Auto-approve flags reopened the hole even in the one agent that initially held.

Why Are Your Current Defenses Failing?

Secret scanners are missing the new leak vectors. Apiiro found 1,122 public copies of Claude Code’s .claude/settings.local.json holding at least one secret out of 104,185 copies across 103,617 repositories (about 1.1%); together they hold 1,379 distinct secrets including 379 database passwords and 23 AWS keys The Hacker News reported. But gitleaks and TruffleHog missed 215 of those 1,122 exposed files containing secrets; gitleaks flagged 564 and TruffleHog flagged 643 MindPattern found. Most misses were passwords after PGPASSWORD=, sshpass -p or mysql -p, because such values “look like an ordinary word in an ordinary command line.”

The file’s exclusion settings explain the leak. Claude Code adds the file to the user’s global git excludes, not the project’s .gitignore. The protection lives on one machine. Clone the repo elsewhere, or commit from a setup that lacks that exclude, and the file goes along. In 539 of the 1,105 repositories traced, a commit listing Claude as a co-author changed the file — meaning Claude often commits the file itself.

Meanwhile, Shadow Research observed 122,255 sensitive values masked in AI traffic from one developer laptop in 30 days, including 287 secrets and API keys, 1,405 email addresses, 2,759 names, 184 national IDs and 87 card numbers, across 1,669 AI requests; 12 dangerous tool calls were blocked Shadow’s AI Leak Report observed. The total is high because coding agents resend the files they have read on every turn, so one secret in a config file is counted each time it’s sent. This isn’t an industry survey — it’s what one active developer workstation sends over a month of normal AI-assisted work.

GitGuardian’s State of Secrets Sprawl Report recorded 28,649,024 new secrets exposed in public GitHub commits CISO Intelligence reported. Your agents are reading those same repos, ingesting those secrets, and potentially acting on malicious instructions embedded alongside them.

The fundamental problem: human-in-the-loop approval is presented as the primary safety control, yet the approval interface itself is compromised or bypassed. GhostApproval shows approval boxes display the wrong file target, Windsurf writes to disk before Accept/Reject buttons appear, and Augment shows no dialog at all. Repository instruction files like AGENTS.md and CLAUDE.md are essential for agent context and also the dominant injection vector — AGENTS.md is auto-loaded by more than twenty coding tools and provides the project conventions agents need to function, but malicious dependencies, cloned repos, and Downloads-folder files write AGENTS.md that agents obey with “absolute authority.” Stripping hidden text and markers would stop injection but breaks legitimate agent workflows — Radware warns not to strip hidden text blindly because it breaks projects’ own agent workflows, and friendly notes to agents grew fivefold in four months.

What Does This Mean for Your Team’s Security Posture?

If you’re running AI coding agents on developer machines with access to production credentials, you’re effectively running an untrusted service with developer privileges. The industry is patching the wrong layer: secret scanners and model guardrails miss the point because the exploit surface is the agent’s intended behavior. Agents must be treated as untrusted services — no secrets, no persistent write access, no auto-approval — and every repository file must be treated as potentially hostile instruction input.

This connects directly to the shadow AI governance problem we’ve covered before. In our Shadow AI Detection Guide, we found that employees use unapproved AI tools at work without employer disclosure, but most detection tools only track network-level usage and miss high-risk prompt-layer data exfiltration events. The same gap applies here: your CASB and network firewalls cannot see the local write path where agents modify repositories, so endpoint detection is required before agents merge pull requests — something we detailed in Shadow AI Agents Already in Your Codebase.

The cost of ignoring this is measurable. A 50-engineer team spends annually on base AI coding subscriptions before metered usage overages according to our compliance framework analysis. But the real cost isn’t subscription fees — it’s the incident response when a malicious AGENTS.md from a dependency hides a backdoor in your production code, or when a poisoned Cloudflare log makes your agent exfiltrate cloud credentials to an attacker’s server.

How Should You Harden Your AI Coding Workflow?

Start with the configuration files that are already leaking. Rotate every secret that’s ever been in .claude/settings.local.json, .codex/auth.json, or similar agent config files. The Apiiro research shows 1,379 distinct secrets in public repos — and that’s only what’s visible in current commits. Git history and forks multiply the exposure. Remove these files from your repos, add them to .gitignore at the project level (not just global excludes), and audit your CI/CD pipelines for any step that might commit them.

Treat AGENTS.md, CLAUDE.md, GEMINI.md, and similar instruction files as executable code — because that’s what they are to your agent. Review them in every pull request. Don’t auto-load instruction files from untrusted directories (especially ~/Downloads). Configure your agents to only load instruction files from the project root, and consider signing or hashing approved instruction files so the agent can verify authorship before obeying.

Disable auto-approval features. The “Yes, and don’t ask again” pattern in Claude Code saves exact commands with secrets into settings files. Adversa AI’s GuardFall research bypassed command-approval guards in 10 of 11 agents using decades-old shell tricks. If your agent has a --yolo mode or auto-trusted workspace folders, treat those as critical vulnerabilities — Google’s April 2026 Gemini CLI advisory patched remote-code-execution paths whose preconditions were exactly those settings.

Sandbox your agents aggressively. No network egress by default. No filesystem access outside the project directory. No shell execution without explicit, per-command approval that shows the actual target (not a symlink disguise). The GhostApproval symlink flaws prove that the approval UI cannot be trusted — Windsurf writes before the dialog appears, Augment shows no dialog, and even Claude Code’s box lies about the target.

Monitor agent traffic at the endpoint. Shadow’s research shows 122,255 sensitive values from one laptop in 30 days — that’s the volume you’re dealing with. Network-level DLP misses prompt-layer exfiltration. You need tooling that sits between the agent and the model, masking secrets before they leave the machine and blocking dangerous tool calls by intent, not just pattern matching.

Finally, treat MCP servers as third-party dependencies with full supply-chain scrutiny. The GhostSplice and SymJack attacks both rely on malicious MCP servers. Audit every MCP server your team connects to. Pin versions. Verify signatures. Run them in isolated environments with minimal scopes — read-only tokens, short-lived credentials, dedicated service accounts. The AI Coding Assistants: 5 Paths to Control Source Code Leaks framework applies here too: Tabnine enforces architectural zero-data-retention for teams that cannot share code, while Cursor and Copilot suit SaaS teams with proprietary-but-unregulated code. Context-window leakage, not model training, is the highest-frequency source-code risk.


The uncomfortable truth: your AI coding assistant is already a privileged insider with access to your codebase, your credentials, and your production systems. It reads files you didn’t write, obeys instructions you didn’t give, and executes commands you didn’t approve — all while looking like normal development activity. The question isn’t whether you’ll be targeted. The question is whether you’ll detect it before the pull request merges.

What’s your team’s current process for reviewing agent instruction files before they’re loaded?