Governing AI Coding Agents: Lessons From 2026's Incidents
Coding agents are already the most widely deployed autonomous agents in most enterprises, and almost none of them show up in a cloud agent registry. They run on developer laptops. They load local MCP servers, read and write files, call APIs, and execute shell commands under a developer's own credentials. A security team that has carefully inventoried its server-side agents can still be blind to the largest agent population it owns.
The 2026 incident record makes the stakes concrete. In the span of a few months, a worm propagated through AI coding agent configuration files, a production database was deleted in a single API call, and a hijacked coding-assistant session seeded a supply-chain worm across roughly 100 internal repositories. Each one points to a specific control that governs how coding agents are found, what they can reach, and how their behavior is watched.
Why coding agents are now your largest agent population
The adoption data is no longer ambiguous. Snyk's June 2026 analysis of nearly 10,000 developer environments found that 50.8% of developers have at least one MCP server installed, 43% run two or more AI coding environments, 37% run three or more, and one in seven developers with MCP servers had at least one security finding. A single engineer routinely runs several coding agents, each with its own tools and credentials.
The tooling mix is shifting underneath that growth. A JetBrains survey of more than 15,000 developers found Claude Code's at-work use rose from 18% to 39% between January and mid-2026 while Cursor's fell from 18% to 12%, as summarized by NeuralTrust. Any governance approach tied to one named product will be out of date within two quarters.
And the data these agents handle is the sensitive kind. Verizon's 2026 DBIR found source code was the top data type submitted to external AI models, out of 858,440 DLP events, as reported by Mimecast. Proprietary code is leaving the building through the same agents that make developers faster.
The governance problem follows from where these agents live. They run on employee machines, outside cloud agent registries, so the inventory methods built for server-side agents on Bedrock or Vertex don't see them.
Four 2026 incidents and the control each one needed
Each of the year's notable coding-agent incidents maps to a governance control that would have reduced its reach.

On Miasma, StepSecurity put the mechanism plainly: "A .claude/settings.json SessionStart hook is effectively a postinstall for your editor". Opening a repository runs code. Microsoft has not confirmed that every disabled repository carried the AI-agent payload, so the exact blast radius is still open, but the propagation path is clear.
The Cloud Security Alliance called Mini Shai-Hulud the first supply-chain attack on record to weaponize AI coding agent configuration files as a persistence mechanism. The configuration file, not the model, was the attack surface.
PocketOS is the blast-radius lesson. As The Register reported, an AI coding agent deleted the production database and all volume-level backups in a single API call to Railway. The data was later recovered. The point is not that the model misbehaved; it's that a single agent held credentials that could destroy production and its backups in one step.
Mandiant's AI Risk and Resilience 2026 documents the session-hijack path: a threat actor compromised a SaaS provider, hijacked an active AI coding assistant session on a developer's workstation, and used it to recommend a poisoned package that spread the Shai-Hulud worm across roughly 100 internal repositories. A second case documented subverted assistant CLI hooks producing remote code execution, with prompt-injection manipulation attributed to the threat actor UNC6780 (TeamPCP).
Discovering coding agents, MCP servers, and hooks on developer endpoints
Registry-based and API-driven discovery miss coding agents because these agents run locally, not on a managed cloud platform. Finding them takes techniques that reach the endpoint and the network:
- Telemetry. Listeners on OpenTelemetry streams detect coding agents, the tools they load, and configuration changes as they happen.
- Network-layer analysis. Traffic carries LLM API call signatures and MCP activity, which surfaces agents that emit no telemetry of their own, including non-standard setups.
- MCP server monitoring. The Model Context Protocol is how coding agents expose and consume capabilities. Watching for new MCP servers flags agents as they come online and catches capability changes in real time.
The MCP layer is its own supply chain, and it's large. The Cloud Security Alliance estimated 200,000 vulnerable instances across a supply chain of more than 150 million package downloads, with at least seven confirmed high- or critical-severity CVEs, including CVE-2026-30623 in LiteLLM. Discovering which MCP servers your developers run is the first step toward knowing what those agents can reach.
Arthur runs this multilayered discovery across telemetry, MCP, and network signals, so coding agents and their MCP servers get inventoried as the agent population they are, then triaged, assigned an owner, and organized into a governed application.
Credentials and blast radius: separating read commands from destructive ones
PocketOS is a credential-scope problem in disguise. An agent that can read a production database rarely needs to drop it, and almost never needs to delete the backups too. Practitioner guidance here is consistent: grant least privilege, separate read paths from destructive ones, and issue scoped, short-lived credentials so a single agent action can't reach production and its recovery path at once.
This is a design discipline that belongs in the agent's architecture, not a setting to toggle after an incident. The governance question a security team should be able to answer for every coding agent is simple: what can this agent reach, and what is the worst thing it can do with one call?
Treating agent configuration files as monitored assets
Miasma and Mini Shai-Hulud both turned on the same insight: files like .claude/settings.json, .vscode/tasks.json, and MCP configs are executable code. A SessionStart hook runs when a developer opens a project. An MCP config decides which servers an agent trusts. These files deserve the same review, change tracking, and monitoring you apply to any code that runs with developer privileges.
In practice that means knowing which config files and hooks exist across the developer fleet, flagging changes to them, and treating an unexpected hook the way you'd treat an unexpected postinstall script in a dependency.
Telemetry and SOC handoff for coding-agent sessions
The Mandiant cases show why runtime visibility matters: the damage happened inside active sessions on developer workstations, not in a static artifact a scanner could catch ahead of time. Coding agents should emit their activity as telemetry the same way any other agent does, and anomalies should route to the SOC.
Emitting agent activity as structured traces makes session-hijack patterns, hook subversion, and unexpected tool calls visible as they happen rather than in a post-incident reconstruction. Monitoring pass/fail and anomaly rates over time turns a spike in unusual agent behavior into a signal worth investigating before it spreads.
A policy baseline for sanctioned vs. unsanctioned coding agents
Pulling the controls together, a workable baseline for governing coding agents across an engineering org covers five things:
- Ownership. Every coding agent and MCP server in use has a named, accountable owner.
- Approved agents and servers. A maintained list of sanctioned coding agents and MCP servers, with a path to review and onboard new ones instead of discovering them after an incident.
- Credential scope. Documented, least-privilege credential grants for what agents can reach, with destructive actions separated from read access.
- Config-file review. Hooks and MCP configs reviewed and monitored as executable code.
- Behavioral monitoring. Session telemetry routed to the SOC, with anomaly detection on tool calls and agent actions.
Arthur covers the discovery, inventory, and monitoring layers of that baseline: finding coding agents and their MCP servers across telemetry and network signals, inventorying the tools and data each one can reach, and monitoring their behavior with a handoff to the SOC. The credential and config-review disciplines sit alongside it as part of how teams build and operate the agents themselves.
Coding agents are the agent population most enterprises already have the most of and the least visibility into. The teams that find them, inventory what they can reach, and watch how they behave are the ones who get the productivity without inheriting the next worm.
Want to see how Arthur discovers and governs the coding agents already running in your environment? Book a demo with an AI expert.