RisksLast reviewed

What goes wrong with coding agents

AI coding agents act: they run commands, read files, call MCP servers and use the developer's credentials. These are the concrete ways that goes wrong, why the usual controls miss each one, and which of the six criteria catch it.

Risk 01

Auto-approved terminal commands

Coding agents ask before running a command, until the developer tires of the prompts and switches on an auto-approve mode or allow-lists a broad pattern. From then on the agent runs whatever it decides, at machine speed, with nobody reading the command first.

$ git push --force origin main
# Rewrites shared history; ran because git push was allow-listed.
Why the usual controls miss it
EDR sees an ordinary git process. AppSec sees nothing until the next pull request. The agent's own settings allowed it.
Risk 02

Scope drift and destructive actions

Asked to fix one thing, an agent decides the fastest route is to reset, delete or overwrite something else: a database, a migrations folder, a branch, a cloud resource. The command is legitimate; the decision to run it is not what anyone asked for.

$ rm -rf ./migrations && npm run db:reset
# The task was to add a retry to a webhook sender.
Why the usual controls miss it
Every control that judges commands by pattern or reputation lets it through, because developers run the same commands on purpose.
Risk 03

MCP server sprawl

The Model Context Protocol lets agents call external tools. Developers add MCP servers from registries and package managers, agents sometimes install them on their own, and unofficial copies of popular servers circulate. Each one runs with the developer's permissions, and few teams can list which are connected.

$ npx -y some-db-mcp-server
# An unofficial server, fetched and started by a config line.
Why the usual controls miss it
No traditional control inventories MCP servers. Local servers talk to the agent over stdio, so network tools never see them.
Risk 04

Inherited credentials

An agent runs as the developer. It can use their SSH keys, git credentials, cloud CLI sessions, Kubernetes contexts and database connections, which are often far broader than the task needs.

$ aws s3 rm s3://team-bucket --recursive
# Allowed: the developer's role can do it, so the agent can.
Why the usual controls miss it
IAM sees the developer's identity and approves. It cannot tell that an agent, not the person, made the call.
Risk 05

Secrets and data exposure

Agents read files to build context, including .env files, config with tokens, and customer data in fixtures, and send what they read to a model provider. Secrets also end up in agent output, logs and commits.

$ cat .env
# Read for context; the contents go into the next model request.
Why the usual controls miss it
Secret scanners check commits, not what an agent read and sent. DLP rarely inspects agent API traffic, and never local file reads.
Risk 06

Prompt injection through content

Instructions hidden in a README, an issue, a web page or an MCP tool's response can steer an agent to run a command or send data somewhere. The agent treats the text as part of its task.

Why the usual controls miss it
Model-side filters may catch some injected text; none of them stop the command the agent runs afterwards.
Risk 07

Unsanctioned agents and extensions

Developers try new agents, CLI tools and IDE extensions as they appear. The sanctioned agent may be locked down while an unmanaged one runs with no rules at all.

Why the usual controls miss it
Per-agent settings only govern that agent. Procurement and SaaS discovery miss tools installed from package managers.
Criteria that catch it
VisibilityDeployment effort
Risk 08

No record of what the agent did

After an incident, or when an auditor asks, nobody can say what agents ran last week, which policy applied, or who approved an exception. Transcripts sit on individual laptops, if they were kept.

Why the usual controls miss it
Logs exist for the effects (a process, an API call, a commit), attributed to a person, with the agent's role invisible.
Criteria that catch it
Audit evidence

What covers these risks

Most of these risks happen at the moment an agent acts, in the terminal or through MCP. That is why the ranking puts agent access security brokers first, with Unbound listed there, and keeps IAM, EDR and AppSec for the blast radius, the endpoint and the code.