> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic Inference hooks

> Inspect Claude prompts with Runlayer before Anthropic runs inference

Anthropic Inference hooks send each governed Claude prompt to Runlayer before
inference. Runlayer applies your input scanner policy and returns an allow or
deny verdict. When session scanning is enabled, supported transcripts also
appear in [Sessions](https://docs.runlayer.com/platform-sessions.md).

Inference hooks run in Anthropic's infrastructure, so one Claude organization
configuration covers Claude.ai, Claude Code, and other governed Claude
Enterprise surfaces. Nothing needs to be installed on each user's device.

## Requirements

* A Claude Enterprise organization with Anthropic Inference hooks enabled
* A Claude Owner or Primary owner role with `organization:manage` permission
* Runlayer organization-admin access
* An active Runlayer input scanner policy
* For self-hosted Runlayer, a publicly reachable `https://` endpoint on port
  443 with a publicly trusted certificate and no redirect

> [!NOTE]
>
> Inference hooks are an Anthropic beta feature. They do not cover requests made
> through Amazon Bedrock or Google Cloud Vertex AI.

## Where to get each value

| Value | Where it comes from |
| - | - |
| **Inference hooks endpoint** | Runlayer generates this URL. Copy it from **Settings → Agent session monitoring → Native inference hooks**. It ends in `/api/v1/hooks/anthropic/inference`. |
| **Claude Organization ID** | Use the **Organization ID** of the Claude organization you are configuring. In Claude, find it under **Settings → Account**, or under **Organization settings → Organization** at the bottom of the page. It is a UUID. |
| **Signing secret** | Anthropic generates it after the endpoint is saved for the first time and reveals it once. Copy the complete `whsec_...` value into Runlayer. |
| **Custom request headers** | Leave this empty. Runlayer verifies Anthropic's Standard Webhooks signature, so you do not need an API-key header. |

Anthropic documents the Organization ID locations in its
[tenant-restrictions guide](https://support.claude.com/en/articles/13198485-enforce-network-level-access-control-with-tenant-restrictions).
Use the ID for the Claude Enterprise organization, not an unrelated Anthropic
Console organization.

## Configure the integration

**1. Allow Inference hooks in Claude**

In Claude, open **Organization settings → Data and privacy**. Find
**Inference hooks** and turn on **Allow for your organization**.

Open the Inference hooks settings page. Allowing the feature does not send
prompts yet; **Enforce verdicts** remains off until the final rollout step.

**2. Save the Claude Organization ID in Runlayer**

In Runlayer, open **Settings → Agent session monitoring → Native inference
hooks**.

Enter the Claude **Organization ID** in **Claude Organization ID** and save.
Leave the Runlayer toggle off until you have stored the signing secret.

**3. Save the endpoint and copy the signing secret**

Copy **Inference hooks endpoint** from Runlayer.

In Claude's Inference hooks page, click **Configure** and paste it into
**Endpoint URL**. Click **Next** to save it.

Anthropic generates a webhook signing secret on the first save and reveals
it once. Copy the complete `whsec_...` value before continuing. Store it in
Runlayer before testing the connection: Anthropic signs connection tests
with this secret too.

**4. Store the secret and enable Runlayer**

Return to Runlayer. Paste the secret into **Signing secret**, turn on
**Anthropic Inference hooks**, and save.

Runlayer encrypts the secret and never displays it again. If you lose it,
rotate it in Claude and immediately enter the replacement in Runlayer.

**5. Test the connection in Claude**

Continue to Claude's endpoint dialog. Leave **Custom request headers** empty
and click **Test connection**, then **Save**.

Runlayer returns an allow verdict for a recognized, authenticated connection
test without scanning it or creating a Session. This checks endpoint
connectivity and request signing. Verify user identity and scanner policies
with live prompts in shadow mode in the following steps.

Claude also reports a successful connection when the endpoint returns a
deny verdict. See [connection-test troubleshooting](#troubleshooting) if
this happens.

**6. Start in shadow mode**

In Claude, set **Mode** to **Shadow mode**, choose the rollout percentage,
and turn on **Enforce verdicts**.

Despite its name, **Enforce verdicts** must be on for Claude to send live
prompts. Shadow mode sends prompts and records Runlayer's verdicts without
blocking users. Anthropic notes that configuration changes can take about a
minute to reach all servers.

**7. Verify live traffic**

Submit a new prompt in Claude.ai or Claude Code. Check **Audit Logs** in
Runlayer for the scanner decision.

To retain the transcript in **Sessions**, also enable **Full session
scanning APIs** and the **Claude.ai** hook client under **Settings → Agent
session monitoring**. Anthropic must include a session ID and a user email
that matches an active user in the Runlayer organization.

For Claude's current setup controls, see Anthropic's
[Inference hooks configuration guide](https://platform.claude.com/docs/en/manage-claude/inference-hooks-configuration).

## Move from shadow mode to enforcement

Review the Audit Logs and Sessions produced during the shadow period. Tune
scanner policies until expected prompts are allowed and genuine violations are
denied. Then choose Claude's failure behavior:

* **Allow the request** lets inference proceed when Runlayer cannot return a
  verdict in time.
* **Block the request** fails closed when Runlayer is unreachable or times out.

Change **Mode** from **Shadow mode** to the selected behavior when you are ready
to enforce Runlayer's deny verdicts. Use Claude's rollout percentage to expand
coverage gradually.

## Security and identity

Anthropic signs each saved-endpoint request with the configured signing secret.
Runlayer verifies that signature before using the tenant ID or actor data.
The tenant ID selects the stored secret; it is not authentication by itself.

For live prompts, Runlayer maps the signed actor email to an active user in the
same Runlayer organization. If no matching user exists, Runlayer denies the
request instead of assigning the prompt to an unverified identity.

## Troubleshooting

> [accordion] The connection succeeds but returns a deny verdict
>
> A successful connection means Claude received a valid verdict. Both allow
> and deny are valid verdicts; a deny does not mean the endpoint is unreachable.
>
> Older Runlayer versions can treat signed synthetic connection tests as live
> prompts and deny them because the test has no matching Runlayer user. Update
> Runlayer and retest. If the denial persists, contact Runlayer support with
> your organization and the test time.
>
> Before enforcing, verify a real prompt in shadow mode with an active user
> whose email matches in Claude and Runlayer, and check the scanner decision
> in **Audit Logs**.

> [accordion] Claude reports a 422 response mentioning tool\_name
>
> The endpoint points to a Runlayer tool hook instead of the Anthropic
> Inference hooks adapter. Copy the URL displayed in **Native inference
> hooks**. It must end in `/api/v1/hooks/anthropic/inference`.

> [accordion] Claude reports that the response is not a valid verdict
>
> Confirm the configured URL is the Runlayer Inference hooks endpoint and not
> a temporary test receiver. The endpoint must return HTTP 200 with an
> Anthropic verdict body.

> [accordion] Claude reports 401 or an invalid signature
>
> Confirm the Claude Organization ID matches **Claude Organization ID** in
> Runlayer and that the latest `whsec_...` secret is stored. If the secret was
> rotated in Claude, paste the replacement into Runlayer immediately.

> [accordion] The connection test works, but no live requests arrive
>
> Turn on **Enforce verdicts** in Claude. For a non-blocking test, keep the
> mode set to **Shadow mode**. Also confirm the rollout percentage is greater
> than zero and wait about a minute after changing the configuration.

> [accordion] Audit Logs appear, but Sessions are empty
>
> Enable **Full session scanning APIs** and the **Claude.ai** hook client in
> Runlayer. Sessions also require Anthropic to send a session ID and the
> actor email to match an active Runlayer user.

> [accordion] Runlayer cannot verify the Anthropic actor
>
> Confirm that the user's Claude email exactly matches an active user's email
> in the same Runlayer organization. The request is signed, but Runlayer still
> fails closed when it cannot bind that actor to an organization user.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.