Configure Inference hooks
Connect your AI security server, control enforcement and rollout, and, in beta, check uploaded files and their Microsoft Purview sensitivity labels (MIP labels).
Inference hooks send what you choose to check to an AI security server you choose, and hold each one for an allow or deny verdict before Claude processes it. By default, that’s prompts and tool calls. This page walks through turning the feature on, connecting your server, choosing what to check, and controlling enforcement. To learn what Inference hooks are and when to use them, see the Inference hooks overview. To build the AI security server itself, see Develop an Inference hooks integration.
Before you start
You need:
- The
organization:managepermission in claude.ai, which only the Owner and Primary owner roles hold. The Admin role doesn’t have it. - An AI security server HTTPS endpoint that accepts verdict requests: an
https://URL on port 443, on a publicly routable host, reachable without redirects. Reverse-tunnel hosts (ngrok and similar tunnel services) are not supported: Anthropic’s network policy blocks them. Don’t test through a tunnel; host your server on a domain you control. For the full hosting requirements, and to build the server and verify signed requests, see Develop an Inference hooks integration.
Set up Inference hooks
There are three enforcement states:
- Off: With Enforce verdicts off, your AI security server is never contacted and nothing is inspected.
- Shadow: With Enforce verdicts on and Mode set to Shadow mode, your AI security server receives what you chose to check and returns verdicts, and a deny blocks nothing.
- Enforcing: With Enforce verdicts on and Mode set to Allow the request or Block the request, a deny blocks the request.
The following steps take a new configuration from off to enforcing.
Allow Inference hooks for your organization
Go to claude.ai > Organization settings > Data and privacy and find the Inference hooks section. Turn on Allow for your organization.
Turning this on unlocks the Inference hooks settings page and always forces Enforce verdicts off, so allowing the feature never starts inspection by itself: even a configuration that previously had enforcement on stays uninspected until you turn Enforce verdicts back on in the final step.
Open the Inference hooks settings page
Still in Data and privacy, open the Inference hooks section to reach the Inference hooks settings page. It lives under Data and privacy rather than as its own entry in the settings nav, so its breadcrumb reads Data and privacy / Inference hooks. Until you save an endpoint, the page warns that prompts aren’t being inspected yet, and Enforce verdicts stays off with a Requires endpoint badge.
Configure your endpoint
Click Configure to open the Set up endpoint dialog box and enter the Endpoint URL: the
https://URL that receives verdict requests. Onlyhttps://URLs are accepted.The dialog box asks for nothing else at this point: custom request headers come in step 5, and failure handling in step 6. Click Next to save. Once an endpoint is saved, the button reads Edit.
Store your signing secret
The first save generates your webhook signing secret and reveals it once. Copy it and store it securely before clicking Next: the secret cannot be retrieved later, only rotated.
Your AI security server uses this secret to verify the signature on every request it receives, including the connection test in the next step. For the verification procedure, see Verify the signature.
Add request headers and test the connection
Clicking Next on the signing secret dialog box reopens the endpoint dialog box, now with two more controls:
- Custom request headers: up to 16 static headers sent with every verdict request so your AI security server can authenticate the caller. Header values are stored encrypted and never shown again; after saving, only the header names are displayed. Because values are write-only, saving any change to the headers requires re-entering every value. Changing the endpoint URL clears all stored header values so your credentials are never sent to a new destination; re-enter them after a URL change. Header names must use standard HTTP token characters with
-rather than_, and must not collide with reserved names (request-framing headers such asContent-*andHost, proxy and cookie headers, client-address headers such asX-Forwarded-*, thewebhook-*signature headers, and theX-Anthropic-*prefix). Values must be printable ASCII. - Test connection: Claude sends a synthetic test prompt to the URL and headers currently in the form, not the saved values, so re-enter any stored header values before testing. On success, the result reports whether your AI security server returned an allow or a deny verdict for the test prompt, which surfaces a deny-everything default before you start enforcing. It also shows the round-trip time Anthropic measured for that one test request, on a new connection, including the connection handshake. The test sends no file frame. A verdict shows only that your server answered, not that it inspects file frames or accepts large request bodies; see the Turn on file checks (beta) step.
Click Save to store any headers you entered.
Common failure results:
Result What to check URL rejected The URL failed a structural check. Use an https://URL on port 443.Private or internal IP The URL’s host is a private or internal IP address, an IPv6 address, or localhost. Use a publicly routable host.Timeout The AI security server did not return a verdict within the timeout. Transport error DNS resolution, the TLS handshake, or the connection failed, or the hostname resolves to a private address. Non-200 status The AI security server responded with a status other than 200. Verdicts must come back as HTTP 200; redirects are not followed and count as failures. Unparseable response The AI security server responded, but the body is not a valid verdict. Signing secret required Your organization has no signing secret, so the test would be sent unsigned. Click Generate secret under Request signing, then test again. - Custom request headers: up to 16 static headers sent with every verdict request so your AI security server can authenticate the caller. Header values are stored encrypted and never shown again; after saving, only the header names are displayed. Because values are write-only, saving any change to the headers requires re-entering every value. Changing the endpoint URL clears all stored header values so your credentials are never sent to a new destination; re-enter them after a URL change. Header names must use standard HTTP token characters with
Choose failure handling and timeout
Under Failure handling, set Mode to choose what occurs while the AI security server is unreachable or verdicts time out:
- Block the request: stop inference when your AI security server can’t deliver a verdict (fail closed).
- Allow the request: let the request proceed to the model without inspection (fail open).
For a file, Block the request refuses the file and Allow the request lets it proceed. In some failures, a file can be refused under either setting, even with file checks off. If Anthropic can’t read whether your organization may use Inference hooks, a file proceeds unchecked under Block the request, and your size limit doesn’t apply.
The dropdown menu’s third option, Shadow mode, is a rollout tool rather than a failure policy; see Shadow mode.
Then set Prompt verdict timeout (ms), under the Check prompts and tool calls switch: 1 to 10,000ms, with a default of 5,000ms. If the page doesn’t show that switch, the timeout is under Failure handling. The budget covers the entire exchange, and a slower verdict counts as an unreachable server, so set the lowest value your server can reliably meet. You can change it while Check prompts and tool calls is off, because Test connection and the circuit breaker’s recovery checks also use it. File checks have a timeout of their own; see Choose what to check.
Mode saves when you select an option. To save a new timeout, click Save changes. When you first save the endpoint, the defaults are Allow the request and 5,000ms.
Turn on file checks (beta)
First, add your rules for the file frame. Make your server return a verdict for prompts too, even if it handles only files: Test connection sends only a test prompt, and after the circuit breaker trips, recovery checks send only a prompt. If your server doesn’t answer it, the breaker stays tripped until you turn Enforce verdicts back on.
To try your rules first, note your Mode, then use shadow mode. There’s no shadow mode for files alone, so it also stops blocking prompts and tool calls. To keep enforcing those, return
allowfor each file frame, and log the verdict that you would have returned. Failed file frames then count toward the circuit breaker, and a trip also stops prompt checks.Then, turn on Check files and confirm. Change Largest file size (MB) or File verdict timeout (ms) if you need to, and click Save changes; see Choose what to check. Turn on Send file content only if your server needs the file’s bytes and accepts request bodies up to 64 MiB, or lower Largest file size (MB) so that file frames fit.
Choose a rollout percentage
Under Rollout, set Requests inspected (%) to run inspection on a percentage of requests while you bring your AI security server up. The value ranges from 0 to 100: 100 inspects everything, and 0 turns inspection off.
Each request rolls once for its whole conversation turn, so a single conversation can be partially inspected across turns. Requests and files outside the sampled percentage proceed without inspection, even when failure handling is set to Block the request.
Turn on Enforce verdicts
To evaluate verdicts against live traffic without blocking anyone at first, set Mode to Shadow mode (step 6) before turning on enforcement; see Shadow mode.
Turn on Enforce verdicts to gate Claude on your AI security server’s verdict for each check you turn on, then confirm in the dialog box, which restates your failure handling choice. Allow about a minute for the change to reach every Anthropic server; requests already in flight complete under the old setting. Turning it off stops all checks, again within about a minute; your configuration is kept.
Validate tool calls sends the tool calls in each of Claude’s responses to your AI security server and waits for its verdict before they run; see The tool call frame. It is on by default in a new configuration. It has no effect while Enforce verdicts is off. While Check prompts and tool calls is off, it shows as off and you can’t change it. A change to it takes about a minute to reach every Anthropic server, as with Enforce verdicts.
If you turned on file checks and your server’s records look right, set Mode back to the one you noted, or, if you stayed in your Mode, return your real verdicts. Once you’re enforcing, wait about a minute. Then, in a chat on claude.ai, upload one file that your rules deny, and see it refused. Don’t use a plain text or code file, because it might get no file check. Check that your server’s records show the deny. If the file goes through, look at Recent errors, your rules, Enforce verdicts, Mode, Requests inspected (%), and Who is inspected.
Choose what to check
On the Inference hooks settings page, choose what goes to your AI security server. Enforce verdicts is the main control, so none of these switches sends anything while it’s off.
- Check prompts and tool calls: sends each prompt to your server. It’s on by default.
- Validate tool calls: also sends each tool call. It’s on by default, and it works only while Check prompts and tool calls is on.
- Check files: sends a file frame for each file that a file check covers, and waits for the verdict. It’s off by default.
- Send file content: adds the whole file to file frames, where the upload route can send it. The whole file can include parts that the app doesn’t show. It’s off by default, and you can turn it on only while Check files is on. See File content in the file frame.
Each switch asks you to confirm, then saves on its own.
Before you turn on Check files, update your server: one that allows unknown frames allows every file. The Turn on file checks (beta) step in Set up Inference hooks says how. A file check doesn’t cover every upload; see What a file check covers. Organizations on a HIPAA-ready Enterprise plan, and a few other organization types, can’t use the file settings, which don’t show for them, or turn off Check prompts and tool calls. An organization that moves to that plan loses its file checks, with no notice on the settings page.
You can set these values under Check files, even while that switch is off:
- File verdict timeout (ms): 1 to 10,000ms, with a default of 10,000ms. It covers the entire exchange, including sending the frame, and a slower verdict counts as an unreachable server.
- Largest file size (MB): whole numbers from 1 to 30, with a default of 30. You can lower the limit, and you can’t raise it above 30. A covered file over your limit is refused, except in the cases under What a file check doesn’t cover. Here 1 MB means 1,048,576 bytes.
To save a change to either one, click Save changes or press Enter. Discard drops your edit.
Turning Check files off also turns Send file content off, and your file size limit no longer applies. If you turn it back on, Send file content stays off until you turn it on again.
A change to a switch or value here takes about a minute to reach every Anthropic server.
Check Microsoft Purview sensitivity labels (MIP labels) without file content
Your AI security server can decide on a file from its sensitivity labels alone. With Send file content off, which is the default, a file frame holds none of the file’s bytes or text.
That’s true of file frames only. While Check prompts and tool calls is on, which is the default, Anthropic also sends your server prompt frames, and one can hold text extracted from a file that you allowed.
With that switch off, your server doesn’t get that text. It also gets no members’ prompts, no tool calls, and no text that an app puts in a message, so your server checks none of those.
Follow the Turn on file checks (beta) step in Set up Inference hooks. With your rules, add one that reads file.sensitivity_labels.type in each file frame. Anthropic reads Microsoft Purview Information Protection labels from Word, Excel, PowerPoint, and PDF files. It reads them from the file’s own bytes, whether Send file content is on or off. The frame gives one of four answers, in sensitivity_labels.type. What your rule does with each answer is your policy, and it must say what to do with not_checked and unreadable. Treat a value that you don’t know as not_checked.
| Answer | What it means | What to consider |
|---|---|---|
found | labels lists the labels that Anthropic found, up to 16. | Compare each label_id with the GUIDs of the labels that your rule blocks, and deny on a match. A file names only the label that was applied, so list each sublabel too. Microsoft’s Create and configure sensitivity labels and their policies shows how to list them. The list can be empty or incomplete, so no match doesn’t show that the file has none of your labels. If labels is empty, apply your policy for unlabeled files. |
unreadable | The file can hold a label, but Anthropic couldn’t read one. | If your rule denies this answer, it blocks old Office files with no label. It also blocks encrypted newer Office files and PDF files that need a password or key, if they have no readable label, and files with any other unreadable reason, such as damaged files. If it allows this answer, a file gets past a label rule, because a person can cause this answer, for example by encrypting the file. |
not_applicable | Anthropic doesn’t read labels from this kind of file, such as an image or a text file. | Labels tell you nothing about it. A person can cause this answer, for example by putting a labeled file in a ZIP file. Choose allow or deny from the frame’s other fields, and its content if you send it. |
not_checked | Anthropic didn’t read the labels, or the read didn’t finish. Label reads are part of the beta, and while Anthropic pauses them, files that can hold a label give this answer. | If your rule denies this answer, it blocks harmless files at times, because Anthropic can skip a read, and a read can be slow or fail. If it allows this answer, a labeled file gets through whenever a read is skipped or fails, as it does during a pause. A file can also be built to make the read fail. |
A rule that denies unreadable doesn’t block every encrypted file: a PDF file that opens with no password normally gives found, and an encrypted ZIP file normally gives not_applicable. For every answer, reason, and field, see Sensitivity labels in the file frame.
Before you rely on your rule, test it with files that your organization labeled.
A label is only text in the file. Anyone who can edit a file can change or remove its labels. So, a label rule catches mistakes, not a member who sets out to get around it. Don’t allow a file only because no label was found.
Shadow mode
Shadow mode runs your hook against live traffic so that you can see its verdicts. Your AI security server receives what you chose to check and returns verdicts exactly as it would when enforcing, but a deny blocks nothing: a request proceeds to the model, even when your server denies it or can’t be reached. Use it to tune your policy against your organization’s real traffic before you start enforcing. With Validate tool calls on, your server also receives tool call frames in shadow mode, and no tool call is blocked.
With Check files on, a few files are still refused in shadow mode, for example if Anthropic can’t read your organization’s settings.
To use shadow mode, set Mode to Shadow mode under Failure handling, then turn on Enforce verdicts so prompts flow to your AI security server. While it is active, the settings page shows a Shadow mode — not blocking badge. To leave shadow mode, set Mode back to Allow the request or Block the request; verdicts are enforced again once enforcement is on.
Exclusions
Under Who is inspected, with Limit by role turned on, select the roles to exclude from Inference hooks. A member who is assigned an excluded role is left out of inspection only if that member is set to Custom roles. With Check files on, a member who is left out also has no file check, and your size limit doesn’t apply to that member. Only custom roles your organization created can be excluded; the built-in roles aren’t offered. Select them in the role selector, whose placeholder reads Select roles to exclude, and manage who holds each role from the roles admin page (Manage roles); changing exclusions requires identity management permission. The list is empty by default, and with no roles excluded, every governed request is inspected, unless Inspect is set to Only selected roles.
Exclusion applies to a user’s interactive sessions. Changes to the exclusion list are recorded in your organization’s Activity Feed as role permission changes (rbac_role_permission_added and rbac_role_permission_removed).
Inspect only selected roles
Everything in the Who is inspected section sits behind one switch, Limit by role. When you turn the switch on, Inspect starts on Everyone except excluded roles, and the excluded roles are selected under it as described above.
To try Inference hooks on part of your organization first, turn on Limit by role, set Inspect to Only selected roles, and select the roles in the dialog box that opens. From then on, only members who are set to Custom roles and are assigned a selected role are inspected. Members set to any other role, such as User or Owner, are not inspected, even if they are assigned a selected role. That includes you if you are set to Owner or Primary owner. Remove every excluded role before you switch: an organization uses exclusions or selected roles, not both. After the switch, add or remove roles in the role selector under Inspect. To go back to inspecting everyone, turn Limit by role off: after you confirm, this removes every excluded role and turns Only selected roles off.
While Only selected roles is set:
- A custom role whose Capability access is All capabilities or All generally available counts only if you select it, like any other role.
- If no member set to Custom roles is assigned a selected role, no member is inspected.
- Requests with no member behind them are not inspected, such as requests made with API keys, and Claude Tag conversations in Slack.
Changes to Inspect and to the inspected roles are recorded in your organization’s Activity Feed.
Custom blocked prompt message
Under Custom blocked prompt message, set custom text of up to 500 characters that is appended to the error an end user sees when your AI security server denies a request or a file (typically who to contact or where to request an exception). The final message is your AI security server’s per-request deny_reason (when present), a blank line, then this text. With no custom text configured, a built-in default directs the user to contact their administrators; you can also switch the appended message off entirely so the user sees only the deny_reason.
Monitor your AI security server
The endpoint health area of the Inference hooks settings page shows:
- Endpoint status: Healthy, Tripped, Not enforcing, or Not configured before an endpoint is saved.
- Failures per minute: webhook failures over the last 2 minutes, averaged.
- Block rate: denials as a share of your AI security server’s verdicts, shown while the rollout percentage is below 100.
- Circuit breaker tripped: when the breaker last tripped, if it has.
- Recent errors: each entry shows when the failure occurred, an error type, and a category. The category is
webhook_errorfor a problem with your endpoint or the connection to it, orrelay_errorfor a failure inside Anthropic’s systems. ADlpWebhookStatusErrorentry can also show the HTTP status your AI security server returned and the size of the request body Anthropic sent, such asHTTP 413·1.3 MB. Entries never include request content or your endpoint URL. The list keeps the 10 most recent failures and clears an hour after the last one.
The error types in Recent errors mean:
| Error shown | What it means | Counts toward the circuit breaker |
|---|---|---|
DlpWebhookTimeoutError · webhook_error | Your AI security server didn’t return a verdict within the timeout you set. | Yes |
DlpWebhookStatusError · webhook_error | Your AI security server answered with an HTTP status other than 200, such as a redirect. | Yes |
DlpWebhookResponseError · webhook_error | Your AI security server answered 200, but the body isn’t a valid verdict or is larger than 64 KiB. | Yes |
DlpWebhookTransportError · webhook_error | The connection failed or dropped before a complete answer arrived: for example, the hostname didn’t resolve or resolved to a private address, the connection was refused or reset, or the TLS handshake failed. A network problem on Anthropic’s side can also show up this way. | No |
DlpWebhookDisallowedAddressError · webhook_error | The endpoint URL’s host is a private or internal IP address, an IPv6 address, or localhost. A hostname that resolves to such an address shows as a transport error instead. | Yes |
DlpWebhookBlockedError · webhook_error | The endpoint URL isn’t an https:// URL on port 443, or can’t be parsed, so no request was sent. | No |
DlpWebhookRelayError · relay_error | The failure was inside Anthropic’s systems, and your AI security server usually wasn’t contacted. | No |
In shadow mode, no error counts toward the circuit breaker.
The panel is best-effort: if Anthropic cannot read the counters it shows zero failures and no errors rather than an error of its own, so a healthy-looking panel is not by itself proof that your AI security server is healthy. Failures per minute counts every failure, including the network and DNS errors that never trip the circuit breaker, so it can be high while Circuit breaker tripped stays empty.
Circuit breaker
Sustained webhook failures attributable to your AI security server trip the circuit breaker, which stops enforcement: your server is no longer contacted, and your Failure handling choice applies to every inspected request. With Block the request selected, users in your organization are blocked until the breaker resets. When the breaker trips, administrators are also notified in the claude.ai notification center.
Failed file checks count toward the same breaker as failed prompt and tool call checks, and a trip stops checks of every kind. An HTTP 413 from your server is a failure. So, if Send file content is on and your server refuses large request bodies, repeated large uploads can trip the breaker. Prompts and files then fail or go uninspected, depending on your Failure handling setting. Make your server accept the full request size. If it can’t, lower Largest file size (MB) so that file frames stay under what it accepts.
Each trip is also recorded in your organization’s Activity Feed as an inference_hooks_circuit_breaker_tripped activity, so your security team or vendor can alert on trips from monitoring they already run, such as a SIEM that ingests the feed. One activity is recorded for each trip, not one for each affected request. Recording requires the Compliance API to be enabled for your organization; see Set up the Compliance API.
To recover, fix the server, then turn Enforce verdicts back on to reset the breaker.
The breaker can also reset on its own. Starting 3 minutes after the trip, Anthropic checks whether your server has recovered. At most about once per minute, it sends your server a test request in the background. No user request is involved. If your server responds with a valid verdict, allow or deny, the breaker resets and enforcement resumes. Otherwise, the breaker stays tripped and the checks continue. That request is a prompt, so a server that handles only files must answer it too; see the Turn on file checks (beta) step in Set up Inference hooks.
Automatic recovery runs only while your Inference hooks settings are unchanged since the trip. If you change any Inference hooks setting after a trip, including rotating the signing secret, the checks stop and the breaker no longer resets on its own; turn Enforce verdicts back on when your server is fixed. Automatic recovery applies only to trips: if you turn Enforce verdicts off yourself, enforcement stays off until you turn it back on.
Rotate your signing secret
Click Rotate secret under Request signing to replace your signing secret. If your organization has no secret yet, the same button reads Generate secret and creates the first one. Rotation is an immediate cutover: the new secret is generated and revealed once, the old secret can no longer be retrieved, and no request is ever signed with both secrets, so there is no overlap period to rely on.
Requests signed with the previous secret can still arrive briefly after rotation; Verify the signature covers how your AI security server should handle the switchover.
Audit trail
Inference hooks activity is recorded in your organization’s Activity Feed: configuration changes, denials, circuit breaker trips, and requests that proceeded without inspection because no verdict could be obtained. That last kind is recorded only while Enforce verdicts is on and Mode is Allow the request. Its reason is endpoint_timeout, endpoint_error for any other problem calling your AI security server, or internal_error for a failure on Anthropic’s side. Under Block the request or Shadow mode, failed requests aren’t recorded individually. The circuit breaker’s automatic recovery isn’t recorded in any mode. While the circuit breaker is tripped, no per-request Inference hooks activities are recorded; the trip activity is the feed’s record of that window. Denial records carry identifiers that let you join each denial to the matching record in your own system. File checks add the same records for denied files and for files that proceeded because no verdict could be obtained. Such a record says that it concerned a file and holds no other file data. A file refused for its size, or refused with no verdict, adds no record. Neither does a file that proceeds because Anthropic can’t read whether your organization may use Inference hooks.
Turn Inference hooks off
There are two levels of off:
- Enforce verdicts off, on the Inference hooks settings page: within about a minute, all checks stop and nothing more goes to your AI security server; requests already in flight complete under the old setting. The settings page stays available, so use this to pause enforcement while you work on your AI security server.
- Allow for your organization off, in Data and privacy settings: all checks stop, and the Inference hooks settings become unavailable until you turn it back on. Your endpoint configuration, custom headers, and signing secret are kept either way; turning it back on forces Enforce verdicts off and clears a tripped circuit breaker, so turn enforcement on again when you are ready.
Next steps
What a file check covers.
Build the AI security server: the request and verdict schemas, signature verification, and operational semantics.
What Inference hooks are, how the verdict round trip works, and what gets sent to your AI security server.
Was this page helpful?