All guides

    Guide

    What kinds of security tools cover AI coding agents, and what does each one miss?

    Updated

    Short answer

    Four kinds of tools cover AI coding agents, and none of them covers everything on its own. Scanners check the code agents write. Sandboxes limit what an agent can reach. MCP proxies watch tool traffic. Pre-execution checks judge each command, file edit and push before it runs. Each one has a blind spot, so pair a build-time scanner with a runtime check and keep the sandbox under both.

    A coding agent creates two separate problems. One is the code it writes. The other is what it does on a laptop while it writes it, using your developer's credentials.

    Most tools in this space cover one of those, and some cover only a slice of one. Here's each category, what it does and where it can't see.

    Scanners check what the agent wrote#

    Scanners (SAST, DAST, SCA and AI pen testing) look at code, dependencies and running apps after the agent has produced them. They catch the hardcoded secret in a commit, the vulnerable package and the missing auth check.

    What they miss: anything the agent did that isn't in the diff. A scanner doesn't see the curl that sent a credential out, the rm -rf that ran during cleanup, or a push that already happened. It judges the artifact, not the action.

    Sandboxes limit reach#

    A sandbox bounds what a process can touch. Claude Code's sandbox, for example, routes network connections through a proxy on your machine that checks each host against your allowed domains, which start empty. That's a real control. Turn it on.

    What it misses: it covers less than most people assume. Per Anthropic's docs, it covers shell commands only; Claude's file tools, MCP servers and hooks run outside it. It's also off by default.

    A sandbox says where an agent can go. It doesn't say whether a given action inside that boundary makes sense for the task.

    MCP proxies watch tool traffic#

    An MCP proxy sits between the agent and its MCP servers. It can allowlist servers, log calls and enforce token scopes. That matters because the MCP spec warns that attackers can execute any command with MCP client privileges, and says servers must not accept tokens that weren't issued to them.

    What it misses: everything that isn't MCP. Shell commands, file edits and git pushes never cross it. For the full MCP picture, see how to secure MCP servers for coding agents.

    Pre-execution checks judge each action#

    A pre-execution check sits at the agent's hook and evaluates each pending action before it runs. Claude Code's PreToolUse hook is the documented example: it fires before a tool call executes and can block it.

    What it misses depends on how it's built. A hook that only matches command text misses the same action written another way. A check that runs inside the agent's own process can be steered by the agent. Exfiltration split across several separate calls is hard for any per-action check. It's a layer, not a perimeter.

    Native permission prompts are the weakest version of this. Anthropic reports that users accept 93% of manual prompts anyway.

    Questions to ask any vendor#

    Ask these in the review. They show you what a tool really covers, which a demo won't.

    • Where does it run? On the developer machine, in your cloud or in the vendor's?
    • What leaves the machine? Commands, file contents and prompts are sensitive. Ask for the data flow in writing.
    • Does it cover every agent? You want one policy across the agents your teams actually use, not one per tool.
    • Is it outside the agent? If the agent can edit or disable the control, the harness grades its own homework.
    • What happens when it fails? Fail-closed or fail-open?
    • Can it start watch-only? You need to see what agents do before you enforce.
    • How is it deployed? Through the MDM you already run, or by asking every developer to install something?
    • What are the stated limits? A vendor that lists none hasn't looked.

    Build-time and runtime cover different failures#

    Build-time tools check the code the agent generates. Runtime tools check the actions the agent takes while it generates that code.

    Skip either one and you leave a gap. Scan only, and a secret can leave the machine before any commit exists. Check actions only, and an insecure artifact can still get merged.

    A workable stack:

    • A sandbox or container for untrusted work, with scoped, short-lived credentials
    • An MCP allowlist with scoped tokens
    • A pre-execution check across every agent, started watch-only
    • A scanner on every commit and in CI

    Where Harden fits#

    Harden Agentic Integrity Foundation (AIF) is the runtime check. It runs on the developer laptop, outside the agent, at the agent's pre-execution hook. It checks every command, file edit and push against the session's intent before it runs. Decisions are made locally, nothing leaves the machine, and if the check can't run, the action doesn't run either.

    It applies one policy across agents, gets pushed by the MDM you already run, and starts watch-only. Harden AI Scanner (AIS) handles build time: it scans the code agents generate. Together they make up Harden Ensō, the most complete protection for coding agents, covering every action the agent takes and the code it generates. See Harden AI Scanner and what a pre-execution check should do.

    AIF doesn't replace least privilege, scoped credentials or egress policy. It sits on top of them.

    FAQ

    Related questions

    Is a sandbox enough to secure a coding agent?

    No. A sandbox limits reach, but it doesn't judge whether an action fits the task. Claude Code's own docs say its sandbox covers shell commands only and is off by default.

    Do I need both a scanner and a runtime check?

    Yes, if you want to cover both the code agents write and the actions they take. A scanner can't see a command that leaked a credential, and a runtime check doesn't review the final code.

    Does an MCP proxy cover shell commands and git pushes?

    No. It only sees MCP tool traffic. Shell commands, file edits and pushes happen outside that path.

    Can I try a runtime check without enforcing right away?

    Yes, if it has a watch-only mode. That mode logs what agents do without blocking, so you can tune policy on real activity before you enforce.

    Why not rely on the agent's built-in approval prompts?

    Because people approve almost all of them. Anthropic reports that users accept 93% of manual prompts, so in practice the prompt doesn't stop much.

    Sources

    1. Sandboxing - Claude Code Docs
    2. Security Best Practices - Model Context Protocol
    3. Hooks reference - Claude Code Docs
    4. Claude Code auto mode - Engineering at Anthropic

    Start free at harden.run

    Full Enterprise access, free for 60 days: unlimited developers, custom policies, centralized visibility, no commitment.