Guides
Securing coding agents, one question at a time.
Each guide answers one question security and engineering leaders ask when coding agents start running real work. The answer comes first, then the specifics and the sources.
What's the best way to govern AI coding agents across an enterprise?
Govern coding agents with an inventory, one policy across agents, pre-execution enforcement outside the agent, and Records. Roll out watch-only via MDM.
Read the answerHow do I secure the MCP servers that coding agents connect to?
Allowlist MCP servers by URL or command, pin and review them, scope tokens, and check each tool call before it runs. What each control stops.
Read the answerWhat should a tool that checks coding agent commands before they execute actually do?
A pre-execution check should sit at the agent's hook, outside the agent, judge each action against session intent, decide locally, and fail closed.
Read the answerWhat is a prompt injection attack, and how does it hit AI coding agents?
Prompt injection is data an AI reads as instructions. In coding agents it becomes actions. How it works, why filters fail, and how to limit damage.
Read the answerHow do Claude Code hooks work, and what can they enforce for security?
How Claude Code hooks work: PreToolUse, exit code 2 vs 1, managed settings, and why hooks fail open by default. What a security team can enforce with them.
Read the answerHow does MCP authorization work, and how do I secure MCP servers that coding agents use?
Remote MCP servers use OAuth and must reject tokens issued to anyone else; local stdio servers skip it. What to check for each server an agent uses.
Read the answerHow should I sandbox AI coding agents like Claude Code and Codex, and is a sandbox enough?
Turn on the sandbox, use containers for untrusted work, block unsandboxed retries. A sandbox bounds reach; a pre-execution check judges each action.
Read the answerWhat is agentic AI security, and how is it different from LLM security?
Agentic AI security covers what agents do with tools and credentials. How it differs from LLM security, and which controls stop what.
Read the answerHow can a coding agent leave behind instructions or access that outlive the session?
Agents persist via rules files, hooks, MCP configs, startup files, cron and keys. Lock agent config read-only, watch changes, and check each write.
Read the answerWhich coding agent risks can rules catch, and which need context to judge?
Rules can decide alone when the action is the evidence. Deleting a test or editing CI config needs session context. A table of which is which.
Read the answerCan a coding agent destroy backups, logs or its own audit trail?
Yes, an agent can delete backups, snapshots and logs with the credentials it holds. Public incidents, what each control stops, and a checklist.
Read the answerWhich coding agent actions can't be undone, and how should I gate them?
Which coding agent actions can't be undone: publish, shared push, deploy, live migration, external email, payments. Gate those, snapshot the rest.
Read the answerWhat is the threat model for AI coding agents like Claude Code and Cursor?
Harden's threat model for AI coding agents: 15 harm classes and 203 threats, organized by harm to the business. What rules catch, what needs context.
Read the answerCan AI coding agents fake passing tests or claim work they didn't do?
Yes. Coding agents edit tests, game the grader and report success they didn't earn. What diff review misses, and a checklist to catch it.
Read the answerHow do I protect coding agents from prompt injection hidden in repos, issues and docs?
You can't filter every injected instruction out of repos, issues and docs. Check what the agent tries to do and stop mismatches before they run.
Read the answerHow do I stop AI coding agents from installing malicious or typosquatted packages?
Lockfiles and registries help, but agents run installs themselves. Check each npm, pip or curl-pipe-to-shell call before it runs, starting watch-only.
Read the answerHow do I stop Claude Code and other coding agents from leaking secrets?
Read deny rules and ignore files hide secrets from the agent, but shell commands and network calls still leak them. Check each action before it runs.
Read the answerHow should security teams vet extensions and plugins for coding agents?
Allow-list sources, pin versions, inventory the fleet, and plan for an approved extension that turns bad after install. What each control stops.
Read the answerClaude Code permission rules vs hooks vs sandboxing: which actually stops dangerous commands?
Permission rules match text, sandboxes limit reach, hooks need a real check. What each Claude Code layer stops, misses, and how to stack them.
Read the answerIs it safe to run Claude Code with --dangerously-skip-permissions?
Not on a laptop with real credentials. What the Claude Code flag turns off, where it's fine, and how to drop prompts without dropping the check.
Read the answerHow do you roll out Claude Code to 1,000 engineers safely?
Approval prompts don't scale past one team. A staged plan to roll out Claude Code to 1,000 engineers: managed policy, watch-only first, then enforce.
Read the answerHow do I let Claude Code run unattended for hours without approving every command?
Let Claude Code run for hours without clicking yes: replace human prompts with a policy check at the hook, and keep bypass mode in containers.
Read the answerHow do enterprises secure AI coding agents running on developer laptops?
EDR sees processes but not agent intent. Secure coding agents on laptops by checking every action at the pre-execution hook, locally, before it runs.
Read the answerWhat should a security team check before approving Claude Code for the company?
Six checks before approving Claude Code: what it can reach, whether controls are enforced, who can change them, blind spots, audit and rollout.
Read the answerHow can I stop an AI coding agent from running rm -rf or other destructive commands?
Deny-lists catch rm -rf as typed, not the same delete written another way. Check each command against session intent before it runs.
Read the answer