How do you secure AI coding agents like Claude Code, Copilot, Cursor, Codex, and Muse Code?
One policy for Claude Code, Copilot, Cursor, Codex, and Muse Code — checked before each tool call through managed settings.
Read guideAI Security
Policies, rollout, and limits for securing Claude Code, GitHub Copilot, Cursor, OpenAI Codex, and Muse Code.
Coding agents run shell commands, read and write files, fetch URLs, and call MCP servers with the developer's credentials, on a laptop or in a vendor's cloud sandbox. None of that traffic passes through an AI gateway or a network proxy, and instructions in AGENTS.md or CLAUDE.md are read by the model rather than enforced. The enforcement point is the hook each agent fires before a tool call or prompt, installed by an administrator through managed settings or MDM so that a developer without administrator access can't remove it. A policy on that hook can deny destructive commands, reads of credential files, unreviewed MCP servers, disallowed models, and high-risk destinations. OpenTelemetry and the Claude Compliance API add visibility across the organization without enforcing.
Start with the coding agent security guide for the enforcement model and each vendor's limits. Then open the guide for the agent you deploy: Claude Code, GitHub Copilot, Cursor, OpenAI Codex, or Muse Code. Use the policy guides for destructive commands, secrets, MCP servers, and models, and read the fail-open guide before you rely on a hook for enforcement.
One policy for Claude Code, Copilot, Cursor, Codex, and Muse Code — checked before each tool call through managed settings.
Read guideHooks for every Claude Code tool call, prompt, and model switch — deployed through managed settings or MDM.
Read guideTo secure GitHub Copilot's agents, install hooks that send each pending tool call to a policy service before the tool runs.
Read guideCursor runs hooks as commands, so a policy check needs a small wrapper script on preToolUse and beforeSubmitPrompt with failClosed set.
Read guideCodex runs hooks as commands, so a policy check is a wrapper script on PreToolUse, PermissionRequest, and UserPromptSubmit that exits 2 on any failure.
Read guideTo stop a coding agent running destructive commands, deny them at the hook that the agent fires before each tool call.
Read guideShortlist coding agent security tools by where they enforce – native settings, hooks, endpoint agents, gateways, or code checks.
Read guideMark an agent session untrusted after a risky finding, and lock risky follow-up actions until a person reviews it.
Read guideBlock the AWS CLI, AWS API hosts, and AWS credential files in one policy, so a blocked route doesn't lead to another.
Read guideTurn auto mode off in managed settings, or refuse risky tool calls in autonomous modes with a hook policy.
Read guideTo stop a coding agent reading .env files and credentials, deny the read at the hook that the agent fires before each tool call.
Read guideTo restrict which MCP servers a coding agent can use, check each MCP tool call against an allowlist at the hook that the agent fires before the call runs.
Read guideKeep developers on approved AI models with one hook policy.
Read guidePersonal AI accounts are a common form of shadow AI.
Read guideThe model can ignore or be talked out of rules in AGENTS.md and CLAUDE.md.
Read guideClaude Code and Copilot hooks fail open, and the Codex and Cursor wrappers fail closed.
Read guide