Interceptors
An interceptor is a service that DIAL Core calls on the way to a model or application and on the way back, so it can inspect, change, or block requests and responses. Use interceptors for PII redaction, guardrails, safety checks, and audit logging. This reference covers registering interceptors in Core and attaching them to deployments; it is for platform engineers who know how DIAL Core is configured.
To build an interceptor, see Interceptors. For what interceptors can and cannot enforce, see Guardrails.
Where interceptors are defined
| Source | Location |
|---|---|
| Config file | interceptors.<name> |
| Configuration API | /v1/interceptors/platform/<name> |
An interceptor must be registered before any deployment can use it. Its name is a deployment ID, shared with models, applications, and toolsets; keep it URL-safe and lowercase with hyphens, for example pii-redaction. DIAL Admin manages interceptors in Interceptors.
Fields
| Field | Description |
|---|---|
endpoint | The URL of the interceptor service, used as is. Required unless interfaces is used. |
baseUrl | The root URL for every interfaces entry that declares no base_url. |
interfaces | A typed alternative to endpoint. Only openaiChatCompletions is supported. See Interfaces. |
displayName | The name shown in DIAL clients, tables, and logs. |
description | What the interceptor does and the parameters it uses. |
iconUrl | The URL of the icon shown for the interceptor. |
author | The interceptor's developer. |
createdAt, updatedAt | The dates the interceptor was created and last updated. |
overrideName | Rewrites the Chat Completions body's model field, and the X-DIAL-OVERRIDE-NAME header, to this value. Applied only when the interceptor runs for a Chat Completions request; the Responses API flow ignores it. It does not change routing. |
forwardAuthToken | Forwards the caller's Authorization header to the interceptor, for an interceptor service that needs its own authentication. |
features | Features of the interceptor, for example configurationEndpoint. |
configurationEndpoint | The URL that exposes the interceptor's configuration. |
defaults | Body parameters Core adds to a Chat Completions request that does not carry them, on the hop to this interceptor. |
defaultHeaders | Headers Core adds on the hop to this interceptor. See Default headers. |
Interfaces
An interfaces.openaiChatCompletions entry is served by a base URL. Core sends the request to the base URL plus the request path, with the {deployment-id} segment rewritten to the interceptor's name: /openai/deployments/<model>/chat/completions goes to <base_url>/openai/deployments/<interceptor-name>/chat/completions. When interfaces and endpoint are both set, interfaces wins.
Other interface types, including openaiResponses, are not supported and are dropped with a warning when Core reads the configuration.
| Field | Description |
|---|---|
base_url | The root URL the request path is appended to. Optional when the interceptor has a baseUrl. |
defaultHeaders | Headers for this interface, laid over the interceptor-level defaultHeaders. |
defaults | Body parameters for this interface. They replace the interceptor-level defaults; the two are not merged. |
overridePaths | Replaces the path for the hop to this interceptor, as for models. The applicable key is postAzureOpenaiChatCompletions, and {id} is the interceptor's name. |
Default headers
Core adds defaultHeaders on the hop that calls the interceptor, to a request without a header of that name. A header the client sends, or one Core sets itself, wins. A header Core strips on the way to the interceptor is stripped from the defaults too: hop-by-hop headers, Api-Key and x-api-key, and traceparent and tracestate.
The defaultHeaders of the model or application the interceptor fronts are applied at the first interceptor of the chain and travel down it. Where both declare the same name, the interceptor's value wins.
Categories
A registered interceptor runs where you attach it:
| Category | Applies to | Where you attach it |
|---|---|---|
| Global | Every deployment in DIAL | globalInterceptors in Global settings |
| Application type | Every application of one application type | dial:applicationTypeInterceptors in the application type schema |
| Local | One model or application | interceptors on the model or application |
Local interceptors on an application can be set by a DIAL administrator when the application is published or changed, or by its author through the API.
Execution order
When all three categories apply, Core runs them in this order:
- Request: global, then application type, then local.
- Response: local, then application type, then global.
Global interceptors see the original input first and the final response last, so they suit the strictest rules.
Example
{
"interceptors": {
"pii-redaction": {
"endpoint": "http://pii-interceptor:4088/api/v1/interceptor/handle",
"displayName": "PII redaction",
"features": { "configurationEndpoint": "http://pii-interceptor:4088/configuration" },
"defaults": {
"custom_fields": { "interceptor_configuration": { "<OPTION>": "<VALUE>" } }
}
},
"audit-logger": {
"interfaces": {
"openaiChatCompletions": { "base_url": "http://audit-interceptor:4089" }
}
}
},
"globalInterceptors": ["audit-logger"],
"applications": {
"forecast": {
"endpoint": "http://forecast-app:5000/openai/deployments/forecast/chat/completions",
"interceptors": ["pii-redaction"]
}
}
}
For more examples, see the DIAL Interceptors SDK.
Further reading
- Interceptor configuration and assignment — attach interceptors step by step
- Tutorial: PII interceptor — build and register an interceptor
- Global settings — set global interceptors
- Guardrails — what interceptor-based guardrails enforce and where they apply
- Manage interceptors — register interceptors and attach them in DIAL Admin