AI coding agent security risks and how to control them
Coding agents read your code, run commands and install packages with the developer's own access. That makes them a new path for prompt injection, leaked secrets and supply chain attacks, and 2025 brought public examples of each.
Next step
AI Agent Blocklist: every coding agent, AI editor and MCP server we track, as package names, process names, app IDs and domains
Block the agents you have not approved on devices and on the network, with a risk grade on every entry and daily updates.
The risks, one by one
Each risk below is a way an agent's access gets used against you. Most stay small with the right settings and grow large when an agent runs with full access and nobody watching.
Prompt injection
Instructions hidden in a README, code comment, issue, web page or tool description can be read by the agent as a task.
High with full accessSecrets on the machine
.env files, cloud credentials, SSH keys and tokens in environment variables are all within reach of a shell command.
HighDestructive commands
An agent that misreads a task can delete files, rewrite history or drop a database with the developer's own rights.
High in productionPoisoned agent tools
The agent itself, its extensions and its plugins are software with releases. A tampered release reaches every developer who updates.
HighMCP servers
Each server adds tools that run code or reach data. Tool descriptions can carry hidden instructions, and servers can change after approval.
High when unmanagedUnreviewed code
Agent output can contain vulnerabilities. Large changes tempt reviewers to skim, and some teams merge without review at all.
Medium to highCode sent outside
Agents send code and context to model providers. Under a personal account, your contract and data terms do not apply.
MediumInvented dependencies
Agents sometimes suggest packages that do not exist. If someone registers that name with harmful code, the next install pulls it in.
MediumPatterns reported in 2025
Public research and reports in 2025 showed the same few patterns again and again. We describe the patterns, not products, because the controls are the same for every agent.
- Pattern 1
Hidden instructions in tool descriptions
Researchers showed in 2025 that an MCP tool's description, which users rarely see, can ask a coding agent to read SSH keys and configuration files and pass them to the server.
- Pattern 2
A tampered release of an agent tool
Agent extensions and plugins update like any other software. A tampered release can carry instructions that ask the agent to delete files or cloud resources. Pin versions and review updates.
- Pattern 3
Agents with production access deleting data
Teams reported agents that deleted live data while working on a task, despite instructions not to. Keep production credentials off any machine where an agent runs.
- Pattern 4
Command injection in connection helpers
Some helper tools for reaching remote MCP servers could run commands when pointed at an untrusted server. Connect only to servers you have reviewed, and keep helpers updated.
- Pattern 5
Injected MCP configuration
Researchers showed that prompt injection in AI code editors can write or swap an MCP configuration file and start commands without a new prompt. Treat config files as sensitive and review every change.
- Pattern 6
Malware that asks local assistants for help
A tampered package release carried a prompt asking AI coding assistants on the developer's machine to list files that could hold secrets. The results were posted to public repositories under the developer's own account.
How much autonomy is safe, and where
Agents offer modes from read-only to fully autonomous. The right mode depends on the machine and what it can reach, not on the developer's experience.
| Mode | What the agent can do | Company laptop | Disposable container |
|---|---|---|---|
| Read-only or plan | Read code, suggest changes | Yes | Yes |
| Edit with approval | Edit files, ask before commands | Yes, with secrets denied | Yes |
| Sandboxed auto-run | Run commands inside a sandbox, ask to leave it | With managed settings | Yes |
| Classifier or auto modes | An automated reviewer approves actions | Only after a pilot | Yes |
| Bypass, full access, yolo | Everything, no checks | No | Only without production credentials |
Five layers of control
No single setting covers every risk. These layers work together, and each one is cheap on its own.
Inventory and block
Know which agents run, and block the ones you have not approved by package, process, app ID and domain.
Managed settings
Force company accounts, approvals and sandboxing on the agents you allow, so users cannot loosen them.
Secrets out of reach
Deny reads of secret files, keep tokens out of shells and give laptops no production credentials.
Tools and MCP
Allow only reviewed MCP servers and plugins, matched by command or URL, never by name.
Review and CI
Protected branches, required reviews and code scanning on every agent change.
Layer 1 in practice: find and block shadow coding agents
You cannot govern what you cannot see. Coding agents install in seconds from npm, PyPI, Homebrew or WinGet, and many live in the user's home folder where software inventory does not look.
Where to look
- Endpoint telemetry for agent process names started from terminals
- Package manager inventories on developer machines
- Editor extension inventories for VS Code and JetBrains
- Config folders such as .claude, .codex and .cursor in home directories
- Agent instruction files committed to repositories
- DNS and proxy logs for coding agent domains
Examples from our identifier file
- @anthropic-ai/claude-code npm package of Claude Code
- @openai/codex npm package of Codex CLI
- @google/gemini-cli npm package of Gemini CLI
- aider-chat PyPI package of Aider
- cursor-agent process of the Cursor CLI
- goose process of the goose agent
Layer 2 in practice: managed settings for the agents you allow
Every major coding agent now has an admin layer that users cannot override. The names differ; the goals are the same: company accounts, approvals on, full access off.
| Agent | Admin mechanism | Keys or settings that matter most |
|---|---|---|
| Claude Code | managed-settings.json, MDM profile, registry policy or server-managed settings | permissions.disableBypassPermissionsMode, allowManagedPermissionRulesOnly, forceLoginOrgUUID, managed-mcp.json |
| Codex | requirements.toml, macOS MDM or cloud-managed requirements | allowed_approval_policies, allowed_permission_profiles, prefix_rules, mcp_servers |
| Cursor | Enterprise MDM policies and the team dashboard | AllowedTeamId, Auto Run Configuration, MCP Configuration, Privacy Settings |
| GitHub Copilot | Organisation and enterprise policies, IDE policies | Feature policies, MCP registry with Registry only, VS Code ChatAgentMode, Visual Studio Disable Agent Mode |
Who is most exposed
Risk follows access. Start your rollout with the groups whose machines hold the most powerful credentials.
Platform and DevOps engineers
Cloud admin tokens, infrastructure code and deployment pipelines. An agent mistake here reaches production.
Application developers
Source code, test credentials and access to shared repositories that other teams build on.
Data scientists
Notebooks next to customer data, database connections and large exports on local disks.
Non-developers who build
Analysts and makers who ship tools with agents, often without code review or a security contact.
Layer 3 in practice: secrets and credentials
Most of the 2025 patterns ended in the same place: credentials on a developer machine. Shrinking what sits there shrinks every other risk.
- Deny agent reads of .env files, key folders and cloud credential files in each agent's settings
- Turn on the agent's operating system sandbox where it has one, because tool-level rules do not cover every command
- Keep long-lived tokens out of shell profiles; load short-lived ones when needed
- Give developer laptops no production database or cloud admin credentials
- Scan commits for secrets before they reach shared repositories
- Rotate any credential an agent may have seen during an incident
Layer 4 in practice: MCP servers and plugins
MCP servers and agent plugins are the newest supply chain on a developer machine. They run locally or reach company systems, and few organisations review them today.
Risks specific to MCP
- Hidden instructions in tool descriptions
- A server that changes after you approved it
- Local servers that run any command they are configured with
- Remote servers that receive company data and tokens
Controls that work
- Turn MCP off where nobody needs it
- Allow servers by exact command or URL, never by name
- Pin versions and review updates
- Block MCP packages and domains you have not approved
Layer 5 in practice: review agent changes like a stranger's
Agent changes are fast and often large. The review process has to keep up without becoming a rubber stamp.
- Protect main branches and require at least one human review for agent pull requests
- Run code scanning and dependency checks on every agent change
- Flag new dependencies for a second look, especially unfamiliar package names
- Keep agent changes small: one task, one pull request
- Label commits and pull requests made by agents so you can audit them later
- Block agents from changing CI configuration and deployment files without a named approver
Vibe coding: security and evaluation for non-developers
Agents now let people who are not developers build and ship apps by prompting. The output can look finished while missing basics a reviewer would catch.
| Check before it goes live | Why it matters |
|---|---|
| Who can sign in, and what each user can see | Generated apps often skip access checks between users |
| Where keys and passwords are stored | Keys pasted into front-end code are visible to anyone |
| Which packages it uses | Unknown or invented dependencies can carry harmful code |
| What data it collects and where it goes | Personal data brings legal duties the builder may not know |
| Who owns it after launch | An app with no owner never gets patched |
How the AI Agent Blocklist helps with coding agents
Layer 1 is where most companies are weakest, because the list of agents changes weekly. That is the part we maintain for you.
| What we deliver | Where you use it |
|---|---|
| npm and PyPI package names of command-line coding agents and MCP servers | Internal package proxies and endpoint rules |
| Process names, WinGet IDs, Homebrew names and macOS bundle IDs | Intune, Jamf, Defender and other endpoint tools |
| VS Code, Open VSX and JetBrains extension IDs | Editor policies such as AllowedExtensions |
| Coding agent and MCP domains | Firewalls, DNS filters and secure web gateways |
| Category and risk grade on every row | Block all, or the higher grades first |
Start with layer 1 today
The AI Agent Blocklist gives you 5,300+ agent identifiers on devices and 2,600+ AI agent domains, updated every day, so unapproved coding agents never get a foothold.
From $99 a month for one organisation. Download access is set up within one business day of your order.
See plans Ask a question- Package, process and app identifiers of coding agents
- Editor extension IDs for VS Code and JetBrains
- Domain list, hosts file, PAC file and firewall list format
- CSV and JSON with tool name, category and risk grade
- Daily updates as new agents appear
Ask us or order a plan
Tell us what you need to block and where your rules live. We reply within one business day.
- Files for firewalls, DNS filters, secure web gateways, MDM and browser policies
- Updated every day as new AI browsers, agents and extensions appear
- Plans for one organisation, for MSPs and for product makers, or a hosted filter we run for you
Questions about coding agent security
What are the main AI coding agent security risks?
Is it safe to let AI coding agents run terminal commands?
How do attackers use prompt injection against coding agents?
What is GitHub Copilot coding agent security like?
What is vibe coding and why is it a security concern?
Should companies block AI coding agents?
Do AI coding agents send our code to AI providers?
How do I find which coding agents developers already use?
Need a checklist for MCP specifically? Use the MCP security checklist.
Claude Code is a trademark of Anthropic, PBC. Codex is a trademark of OpenAI. Cursor is a trademark of Anysphere, Inc. GitHub and GitHub Copilot are trademarks of GitHub, Inc.
Gemini is a trademark of Google LLC. Aider and goose are trademarks of their respective owners. VS Code, Intune and Defender are trademarks of Microsoft Corporation. JetBrains is a trademark of JetBrains s.r.o. Jamf is a trademark of Jamf.
macOS is a trademark of Apple Inc. Visual Studio and WinGet are trademarks of Microsoft Corporation. Open VSX is a trademark of the Eclipse Foundation.
npm is a trademark of npm, Inc. PyPI is a trademark of the Python Software Foundation. Homebrew is a trademark of its owner.
Names are used only to identify the products discussed. AI Agent Blocklist is not affiliated with, sponsored or endorsed by these companies.