Claude inference hooks vs. runtime DLP for coding agents
Key takeaways
- Claude inference hooks are a strong pre-inference DLP gate, but judging what a coding agent does is left to the server you run.
- Hooks return only allow or deny, with no redaction, and they don't apply on Amazon Bedrock, Google Cloud or Claude Platform API organizations.
- Pair hooks with runtime monitoring of tool calls, file changes, commands and egress, and send findings to your SIEM.
- Start observe-only, then block a short list of dangerous actions once you trust what gets flagged.
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:
- One hook governs conversations across Claude Enterprise products, including claude.ai, Cowork, Claude Code, Claude for Microsoft 365, Claude Tag and Claude in Chrome.
- Nothing is installed on endpoints. Evaluation happens server-side.
- Your endpoint must return a verdict within a timeout.
- System prompts and tool definitions are never included in what is sent.
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:
- Deployment scope: not available on Amazon Bedrock, Google Cloud or Claude Platform API organizations.
- Tool calls: "Validate tool calls" is optional. With it on,
tool_callevents may leave out calls to some of claude.ai's own tools, and a response containing only omitted calls produces notool_callframe. - Payloads: your endpoint receives text and structured tool-call information, not raw bytes. Image-only content isn't inspected.
- Voice mode: a small share of tool calls isn't sent, and deny reasons may not be shown.
- Timeouts: a slow endpoint forces a failure decision. Fail-open risks bypass. Fail-closed risks blocking every developer when your scanner has a bad hour.
- Other agents: a hook on Claude says nothing about Codex or Copilot CLI sessions.
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.
- Blocking review checks a tool call before it runs and allows, denies or escalates it to a person.
- Trailing review grades the whole session to catch patterns a single action doesn't show.
- Built-in monitors cover secret exposure, and organization-wide custom instructions add your own data policies.
- Cross-model grading mixes models in the pipeline, so the monitor doesn't share the agent's blind spots.
- Rollout and export: admin-locked settings deploy through MDM, and findings reach your SIEM through the Watcher Python SDK and API, with example exporters for Google Security Operations, Microsoft Sentinel, Splunk HEC and OpenTelemetry.
- Hosting: Watcher runs on Apollo's managed cloud in Western Europe, or self-hosted so session data stays in your environment.
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 hooks | Runtime monitoring (Watcher) | |
|---|---|---|
| Control point | Before inference, on Anthropic's servers | Around each agent action, on the endpoint |
| Sees | Prompts, transcripts, optional tool calls | Tool calls, results, whole sessions |
| Verdict | Allow or deny | Allow, deny or escalate; trailing session grades |
| Coverage | Claude Enterprise surfaces | Claude Code, Codex, Copilot CLI, plus gateway and SDK paths |
| Typical DLP use | Block regulated content in prompts | Catch 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?
- Inventory agent surfaces: which Claude Enterprise products are on the hook path, and which developers use Claude Code, Codex or Copilot CLI.
- Write your hook verdict policy and choose fail-open or fail-closed deliberately.
- Turn on "Validate tool calls" only after testing its gaps with representative coding prompts.
- Deploy runtime monitoring observe-only. Measure alert volume and triage time.
- Add custom instructions for your data policies and confirm secret-exposure detection fires on test cases.
- Export findings to your SIEM and build triage on the high-signal events.
- 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.