# AI coding agent security risks (and the controls for each)

DevFeed: [AI coding agent security risks (and the controls for each)](<https://devfeed.tech/articles/ai-coding-agent-security-risks-and-the-controls-for-each-119453.md>)

Original publisher: [Read original article](<https://nirmata.com/2026/10/30/ai-coding-agent-security-risks-and-controls/>)

Author: Ritesh Patel

Published: 2026-10-30T15:00:00Z

Content type: article

Language: en

Sources: [Nirmata](<https://devfeed.tech/sources/nirmata.md>)

Topics: [Security](<https://devfeed.tech/topics/security.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [code security](<https://devfeed.tech/topics/code-security.md>), [MSP MCP](<https://devfeed.tech/topics/msp-mcp.md>), [credential-based attacks](<https://devfeed.tech/topics/credential-based-attacks.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-security](<https://devfeed.tech/tags/agent-security.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [ai-coding-agent](<https://devfeed.tech/tags/ai-coding-agent.md>), [ai-coding-agent-security](<https://devfeed.tech/tags/ai-coding-agent-security.md>), [ai-coding-agents](<https://devfeed.tech/tags/ai-coding-agents.md>), [ai-governance](<https://devfeed.tech/tags/ai-governance.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [coding-agent-security](<https://devfeed.tech/tags/coding-agent-security.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [control](<https://devfeed.tech/tags/control.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-servers](<https://devfeed.tech/tags/mcp-servers.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [prompt-injection](<https://devfeed.tech/tags/prompt-injection.md>), [risks](<https://devfeed.tech/tags/risks.md>), [secrets](<https://devfeed.tech/tags/secrets.md>), [security](<https://devfeed.tech/tags/security.md>), [security-risks](<https://devfeed.tech/tags/security-risks.md>)

## AI overview

AI coding-agent security requires layered controls because each addresses different risks and none covers everything. The excerpt uses Claude Code as its worked example: approval prompts rely on human review, while OS sandboxing limits shell command reach; filesystem scope, deny rules, and PreToolUse hooks add further restrictions. The sandbox covers shell commands only, so file tools, MCP servers, and hooks remain outside it. Deny patterns can miss alternate command forms, and hook failures do not block by default unless configured to do so. Managed settings can enforce endpoint controls, but their precedence and loading should be checked with `/status` and `claude doctor`. For central controls, AIControls routes sessions through a gateway, provides per-user tokens and budget limits, and can hold, redact, or block PII; these measures complement endpoint settings. The excerpt also notes that reviewing a repository's `.mcp.json` does not reveal every available MCP server.

## Source excerpt

The main risks of AI coding agents, from prompt injection to leaked secrets and unvetted MCP servers, each paired with a control and the point where it stops.