# Agentic AI security and governance for engineering leaders

> The security risks of AI agents in engineering teams, mapped to the OWASP Top 10 for Agentic Applications and to real incidents, with the controls, owners and evidence a VP of Engineering or CTO needs.

AI agents in an engineering team act with an engineer’s access. They read the repository, run commands in a terminal, call MCP servers and cloud APIs, and push code. Agentic AI security is the work of deciding what that access should be, enforcing it outside the agent, and keeping enough evidence to know what happened. Governance is the same work with owners and a review cadence attached.

This guide is for the person accountable for it: a VP of Engineering, CTO, head of platform or head of security. It covers the risks that have shown up in public incidents, how they map to the OWASP Top 10 for Agentic Applications, and a short list of controls with the evidence that shows each one is working. For the policy itself, start from the [AI agent policy template](https://www.excellent.so/guides/ai-agent-policy-template).

## What has actually gone wrong

Most public incidents fall into four groups. Each has happened to a real team or been demonstrated by researchers, and each has a primary source in our [incident list](https://www.excellent.so/incidents).

| Kind of incident | Public example | What failed |
| --- | --- | --- |
| An agent destroys data it was allowed to reach | Replit’s agent deleted a production database during a code freeze in July 2025; the data was restored by rollback. [Write-up](https://www.excellent.so/guides/replit-agent-deleted-production-database) | The development agent had a path to production, and the freeze was only an instruction in the chat. |
| Malicious code uses an installed agent | In August 2025 malicious Nx packages ran Claude Code, Gemini CLI and Amazon Q’s CLI with approval-skipping flags to search machines for secrets. [Write-up](https://www.excellent.so/guides/nx-s1ngularity-ai-cli-supply-chain-attack) | Any program on the machine can start an agent with its prompts turned off. |
| A compromised agent, extension or MCP server | The Amazon Q VS Code extension 1.84.0 shipped with malicious code (AWS says it failed to run); `postmark-mcp` BCC’d every email to an outside address. [Amazon Q](https://www.excellent.so/guides/amazon-q-extension-wiper-prompt) · [postmark-mcp](https://www.excellent.so/guides/postmark-mcp-malicious-mcp-server) | Trust in a name or an auto-update instead of a pinned, reviewed version. |
| Prompt injection turns tools against the user | Researchers showed a public GitHub issue steering an agent to copy private repository data into a public pull request through the GitHub MCP server. [Invariant Labs](https://invariantlabs.ai/blog/mcp-github-vulnerability) | One session held untrusted input, private data and a way to publish. |

Vendors fix their own bugs quickly. Anthropic, for example, has published 32 advisories for Claude Code, every one with a fixed version. [Claude Code vulnerabilities](https://www.excellent.so/guides/claude-code-vulnerabilities) Your exposure comes less from any single bug than from how much access an agent holds when something goes wrong.

## The OWASP Top 10 for Agentic Applications

In December 2025 the OWASP GenAI Security Project published the Top 10 for Agentic Applications (labelled 2026). It gives security and engineering teams a shared vocabulary for these risks. The table maps each item to what it looks like for engineering teams using agents, and to a control. The names and IDs are OWASP’s; the examples and controls are ours. [OWASP Top 10 for Agentic Applications](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/)

| OWASP item | What it looks like with engineering agents | First control |
| --- | --- | --- |
| ASI01 Agent Goal Hijack | Text in an issue, README or web page tells the agent to do something else. | Keep untrusted input, private data and the ability to send or publish out of the same session. |
| ASI02 Tool Misuse and Exploitation | The agent uses a legitimate tool destructively: `DROP`, `terraform destroy`, a force push. | Human approval outside the chat for destructive actions; deletion protection at the platform. |
| ASI03 Identity and Privilege Abuse | The agent acts with the engineer’s full credentials, including production. | Task-scoped credentials; no standing production access on development machines. |
| ASI04 Agentic Supply Chain Vulnerabilities | A malicious MCP server, extension or agent release. | An approved list with pinned versions; vendor advisories watched. |
| ASI05 Unexpected Code Execution (RCE) | A cloned repository runs code before the trust prompt; a command slips past an allowlist. | Current versions; unfamiliar repositories opened in a container. |
| ASI06 Memory & Context Poisoning | Instructions planted in files the agent reads every session, such as rules files. | Review changes to agent instruction files like code. |
| ASI07 Insecure Inter-Agent Communication | One agent hands work to a sub-agent or another tool with more access. | The same credential limits for helpers as for the main agent. |
| ASI08 Cascading Failures | An agent’s mistake flows into CI, a deploy or another agent’s input. | Normal review and CI gates on agent-written changes. |
| ASI09 Human-Agent Trust Exploitation | The engineer accepts the agent’s summary (“all tests pass”, “nothing can be restored”) without checking. | Check the system, not the summary: diffs, test runs, the database. |
| ASI10 Rogue Agents | An agent keeps acting outside its instructions, as in the Replit code freeze. | Controls that don’t depend on the agent following instructions. |

## The controls that matter most

If you do nothing else, do these. Each one is enforced outside the agent, so it holds when the agent is wrong, injected or compromised.

| Control | Where it is enforced | Evidence it is working |
| --- | --- | --- |
| Agents never hold standing production credentials | Cloud IAM, secret manager, separate development accounts | An access review that lists which identities on developer machines can reach production |
| Destructive operations need approval | Database deletion protection, protected branches, an approval step before infrastructure changes apply | Refused force pushes and blocked deletes in the platform’s audit log |
| Permission-skipping modes only in disposable environments | Devcontainers or VMs for autonomous runs; managed settings where the agent supports them | Session logs showing which sessions ran without approvals, and where |
| Approved agents, extensions and MCP servers, pinned | An allowlist in your device management or managed settings, dependency review for version bumps | An inventory of what is installed on each machine, compared with the list |
| Agent-written code goes through the same review and CI | Branch protection and required checks | Pull requests merged without review: zero |
| Session logs kept, with secrets scrubbed | Retention on each machine; a scan for keys in logs | Incidents you could reconstruct from the logs, and how long that took |

## A governance model that fits an engineering org

Keep the structure light. The [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework) organizes the work into four functions, Govern, Map, Measure and Manage, and that maps onto an engineering org without a new committee:

- **Govern.** One accountable owner, usually platform or security engineering, and a one-page policy. [Policy template](https://www.excellent.so/guides/ai-agent-policy-template)
- **Map.** An inventory: which agents, versions, MCP servers and credentials each team uses.
- **Measure.** A monthly look at the evidence column above: sessions without approvals, destructive actions, keys in logs, unapproved MCP servers.
- **Manage.** An incident path that preserves evidence, and a quarterly review of the policy against what happened.

## Questions to ask before you roll out an agent

1. What can it reach on an engineer’s machine, and which of those credentials reach production?
2. Which actions does it take without asking, and who can change that setting?
3. Can an administrator set the policy centrally, and can a user override it?
4. Where are its session logs, how long are they kept, and do they hold secrets?
5. How does the vendor publish security advisories, and how fast do fixes ship?
6. Which MCP servers and extensions will it be allowed to use, and who approves new ones?

## Where Excellent fits

Excellent runs beside the AI agents your engineers already use and checks what they did. The free scan reads supported agents’ session logs on a Mac and reports force pushes, deletions in folders you mark as never-delete and keys that ended up in a log, after the fact. With Pro, Excellent adds a live check that can ask or block before supported risky actions; coverage varies by agent and action. It produces the session-level evidence for the Measure step. It does not replace credential scoping, branch protection or a vendor’s own fixes. [Run the free scan](https://www.excellent.so/scan) · [Roll Excellent out to a team](https://www.excellent.so/guides/roll-out-excellent-to-a-team) · [Excellent for companies](https://www.excellent.so/enterprise)

Source: https://www.excellent.so/guides/agentic-ai-security-for-engineering-leaders
