AI agent security

Claude inference hooks vs. runtime DLP for coding agents

Key takeaways

What does complete DLP coverage mean for coding agents?

It means preventing loss across the whole agent loop: the prompt, the model call, and every command, file write and network request that follows. Coding agents run with a developer's credentials, so they can read .env files, call MCP servers and push to remotes in ways nobody typed into a prompt.

Inference hooks cover the first part of that loop well. The rest needs a different control.

How do Claude inference hooks work?

Inference hooks pause each governed request on Anthropic's servers and ask a security endpoint your organization (or your vendor) runs for an allow or deny verdict before inference proceeds. Per Anthropic's documentation, they are available only to Claude Enterprise organizations.

Key mechanics from the docs:

Where do inference hooks add the most DLP value?

Hooks are best at real-time prompt inspection. Anthropic describes DLP as the most common deployment: forward the transcript to your DLP scanner and deny prompts that carry regulated or classified material. The docs also describe sensitivity-label checks and transcript archival.

For coding agents, this stops a pasted customer dataset or a classified design document from ever reaching the model, and from steering the agent toward exposing it. It works on every Claude Enterprise surface at once, with no rollout to developer machines.

Verdicts are allow or deny only. There is no redaction.

Where do inference hooks stop?

Hooks stop at the model boundary, and several documented gaps narrow even that boundary:

Most important, unless "Validate tool calls" is on, a verdict on the prompt can't govern what happens locally. An allowed prompt can still lead to cat ~/.aws/credentials or a curl to an unapproved host.

What can you do today with built-in agent controls?

Use them. Claude Code's permissions, managed settings and hooks, and Codex's sandbox and approval modes, are good products that cut real risk. Network sandboxing with egress allowlisting limits where data can go, and approval prompts keep humans in the loop on risky commands.

They stop short in three places. Each agent has its own settings, so policy drifts across tools. Approval fatigue sets in as sessions get longer. And you get little organization-wide evidence of what agents actually did.

What does a runtime monitoring layer add?

Agent runtime monitoring reviews actions as they happen, against the user's task, and records them. Watcher, built by Apollo Research, is an MDM (or EDR) for AI agents. Its aim is enabling, not policing: engineers keep their workflow while security sees and controls what agents do.

Watcher runs alongside Claude Code, Codex and GitHub Copilot CLI through each agent's hooks, whichever model provider sits behind them. Other harnesses connect through gateway hooks (Tailscale Aperture, LiteLLM) or SDK examples.

Watcher isn't an inference-hook endpoint, doesn't plug into Anthropic's verdict pipeline, and doesn't classify or redact content.

How do the two layers fit together?

Hooks govern input and intent. Runtime monitoring governs execution.

 Inference hooksRuntime monitoring (Watcher)
Control pointBefore inference, on Anthropic's serversAround each agent action, on the endpoint
SeesPrompts, transcripts, optional tool callsTool calls, results, whole sessions
VerdictAllow or denyAllow, deny or escalate; trailing session grades
CoverageClaude Enterprise surfacesClaude Code, Codex, Copilot CLI, plus gateway and SDK paths
Typical DLP useBlock regulated content in promptsCatch secret exposure and out-of-task actions

A blocked prompt never becomes an action. An allowed prompt that turns into a risky action still gets reviewed.

When are inference hooks sufficient?

Hooks alone are reasonable when developers use only Claude Enterprise surfaces, work is mostly conversational, and your DLP policy maps cleanly to prompt content. They aren't enough when agents edit files, run shell commands, call MCP servers or push to source control. They also fall short when you run more than one agent or provider, or when any traffic goes through Bedrock, Google Cloud or API organizations.

What is a practical DLP rollout for coding agents?

  1. Inventory agent surfaces: which Claude Enterprise products are on the hook path, and which developers use Claude Code, Codex or Copilot CLI.
  2. Write your hook verdict policy and choose fail-open or fail-closed deliberately.
  3. Turn on "Validate tool calls" only after testing its gaps with representative coding prompts.
  4. Deploy runtime monitoring observe-only. Measure alert volume and triage time.
  5. Add custom instructions for your data policies and confirm secret-exposure detection fires on test cases.
  6. Export findings to your SIEM and build triage on the high-signal events.
  7. Enable blocking on a short list of dangerous actions, then widen it.

Frequently asked questions

How should we handle DLP when we want redaction instead of blocking?

Hooks can only allow or deny, so redaction has to happen before the request reaches Claude, in a developer-side tool or gateway you control. Watcher doesn't redact either. Treat denial as the hook's outcome and design the user message and retry path around it.

What happens when the hook endpoint times out?

Anthropic's docs define a verdict timeout, but your failure policy is a design decision you should confirm and test. Slow your endpoint on purpose in a pilot and observe what developers experience.

Do hooks cover Claude Code tool calls?

Only when "Validate tool calls" is enabled, and only for the event types the docs list. Some claude.ai tool calls can be omitted, so don't treat hooks as complete tool-call governance.

Which deployments are out of scope?

Amazon Bedrock, Google Cloud and Claude Platform API organizations. Hooks are for Claude Enterprise only.

How do we validate protection before blocking?

Seed test prompts with synthetic sensitive strings, log every verdict at your endpoint, and compare results against expectations. Track verdict latency and failure rates too.

Run a two-week pilot with both layers in observe mode, then decide what to block. A free agent security audit is a low-friction way to see what your agents are doing today.

Add action-level review to prompt-level DLP

Book a call and we'll show you how Watcher reviews the tool calls, commands and file changes that follow an allowed prompt, across Claude Code, Codex and Copilot CLI.