Configure and assign interceptors
After building an interceptor with the Interceptors SDK, you need to register it in DIAL Core and assign it to the deployments where it should run. This guide walks through declaration, scoping, and verification.
Prerequisites
- A running interceptor service with at least one endpoint (e.g.,
http://interceptor-service:5000/openai/deployments/my-interceptor/chat/completions) - Access to DIAL Core configuration (dynamic settings) or DIAL Admin
Configuration file locations
All interceptor configuration lives in DIAL Core's dynamic settings. The exact file depends on your deployment:
| Deployment method | Configuration file | Notes |
|---|---|---|
| Docker Compose | config.json mounted into the Core container | Path set via aidial.config.files env var |
| Kubernetes / Helm | values.yaml under core.config | Rendered into a ConfigMap |
| DIAL Admin UI | Managed via API | No file editing needed |
For Docker Compose setups, the config file is typically mounted at /opt/config/config.json inside the container:
volumes:
- ./config.json:/opt/config/config.json
Step 1: Declare the interceptor
Add the interceptor to the interceptors section in DIAL Core's config.json. Each interceptor needs a unique key and an endpoint pointing to the interceptor service.
{
"interceptors": {
"pii-redactor": {
"endpoint": "http://interceptor-service:5000/openai/deployments/pii-anonymizer/chat/completions",
"displayName": "PII Redaction",
"description": "Anonymizes personally identifiable information in requests and responses"
}
}
}
| Attribute | Required | Description |
|---|---|---|
endpoint | Yes | Full URL to the interceptor's chat completion or embeddings endpoint |
displayName | No | Human-readable name shown in DIAL Admin |
description | No | Interceptor purpose description |
The endpoint URL follows the standard DIAL endpoint pattern. It must match the deployment name used when registering the interceptor in the DIALApp:
http://<HOST>:<PORT>/openai/deployments/<DEPLOYMENT_NAME>/chat/completions
For example, if app.py registers the interceptor as app.add_chat_completion("pii-anonymizer", ...), the endpoint is:
http://interceptor-service:5000/openai/deployments/pii-anonymizer/chat/completions
Warning
Chat completion interceptors must only be assigned to chat completion deployments. Embeddings interceptors must only be assigned to embeddings deployments. Mixing them causes runtime errors.
Step 2: Choose the scope
Assign the declared interceptor at the appropriate level. You can combine levels — when all three are configured, the execution order is Global → Application type → Local.
Local scope
Apply to a specific model or application. Add the interceptor key to the deployment's interceptors array.
{
"models": {
"gpt-4o": {
"endpoint": "http://model-provider:5000/compat/openai/openai/deployments/gpt-4o/chat/completions",
"interceptors": ["pii-redactor"]
}
}
}
Global scope
Apply to every deployment in the DIAL instance. Add the interceptor key to the top-level globalInterceptors array.
{
"globalInterceptors": ["pii-redactor"]
}
Application type scope
Apply to all instances of a specific application type (e.g., all Quick Apps). Add the interceptor key to dial:applicationTypeInterceptors in the type schema.
{
"applicationTypeSchemas": [
{
"$id": "https://dial.epam.com/application_types/quick_app/v1",
"dial:applicationTypeDisplayName": "Quick App",
"dial:applicationTypeInterceptors": ["pii-redactor"]
}
]
}
Step 3: Verify the interceptor is active
Send a chat completion request to a deployment that has the interceptor assigned. Confirm the interceptor is processing requests by checking:
- Interceptor logs — the interceptor service should log incoming requests at
DEBUGlevel. - Response behavior — for observable interceptors (e.g., PII redaction, content filtering), verify the response reflects the interceptor's transformation.
- DIAL Admin — open the model or application and check its Interceptors grid. See Models › Interceptors.
Optional: Interceptor configuration
If an interceptor supports per-deployment configuration, it exposes a /configuration endpoint that returns a JSON Schema. Register the configuration endpoint and provide default values in the interceptor declaration:
{
"interceptors": {
"pii-redactor": {
"endpoint": "http://interceptor-service:5000/openai/deployments/pii-anonymizer/chat/completions",
"features": {
"configurationEndpoint": "http://interceptor-service:5000/openai/deployments/pii-anonymizer/configuration"
},
"defaults": {
"custom_fields": {
"interceptor_configuration": {
"labels_to_redact": ["PERSON", "ORG", "GPE"]
}
}
}
}
}
}
DIAL Core sends the configuration to the interceptor in the custom_fields.interceptor_configuration field of each chat completion request.
Managing interceptors via DIAL Admin
As an alternative to editing config.json directly, DIAL administrators can manage interceptors through the DIAL Admin UI:
- Interceptors — declare and configure interceptors
- Local scope — add interceptors to a model or an application
- Global scope — set global interceptors
- Application type scope — add interceptors to an application runner
- Interceptor containers — run the interceptor service itself, when the optional Deployment Manager is connected
Interceptor templates, under Builders, need the optional Admin Backend.
Further reading
- Interceptors configuration reference — full attribute reference for
config.jsoninterceptor settings - Manage interceptors — register interceptors and attach them in DIAL Admin
- SDK integration reference — build a custom interceptor with the Python SDK
- Interceptor examples — browse example implementations
- Register an app in DIAL Core — registering applications that use interceptors