Skip to main content

Data Routing Policy

data-routing-policy controls provider selection. It does not examine prompt text. It filters providers.targets[] by customer-declared data_policy metadata. This metadata is not a provider attestation or an automatic check of provider terms.

Example configuration

pack:
name: regulated-routing
version: 1.0.0
enabled: true
providers:
targets:
- id: openai-zdr
provider: openai
model: your-openai-model
secret_key_ref:
env: VERDICTAN_OPENAI_API_KEY
data_policy:
zero_data_retention: true
training_opt_out: true
retention_days: 0
- id: azure-standard
provider: azure
provider_type: azure-openai
format: openai
model: your-azure-openai-model
base_url: https://replace-with-resource-name.openai.azure.com
secret_key_ref:
env: VERDICTAN_AZURE_OPENAI_API_KEY
azure_api_version: your-supported-api-version
azure_deployment: your-azure-deployment
data_policy:
zero_data_retention: false
training_opt_out: true
retention_days: 30
policies:
chain:
- data-routing-policy
policy:
data-routing-policy:
require_zero_data_retention: true
require_no_training: true
max_retention_days: 0
on_no_compliant_provider: block
log_provider_selection: true

Before you run the gateway, replace each model placeholder with an enabled value. Also replace the Azure deployment, resource name, and API version.

Provider metadata that this policy examines

Each target can declare a data_policy block with these fields:

FieldTypeMeaning
zero_data_retentionbooleanCustomer-declared metadata records zero request and response retention.
training_opt_outbooleanCustomer-declared metadata records that traffic is not used for training.
retention_daysintegerCustomer-declared retention period in days.

Policy fields

FieldTypeNotes
require_zero_data_retentionbooleanKeep only targets with data_policy.zero_data_retention: true.
require_no_trainingbooleanKeep only targets with data_policy.training_opt_out: true.
max_retention_daysintegerExclude targets with declared retention that is more than this value.
on_no_compliant_providerstringblock stops dispatch. warn continues with all targets when none match.
log_provider_selectionbooleanEmit routing diagnostics for excluded targets.
require_in_memory_onlybooleanKeep only targets with data_policy.in_memory_only: true.
sanitize_before_providerbooleanKeep only targets with data_policy.sanitized: true. This field does not sanitize request content.
tokenize_sensitive_fieldsbooleanKeep only targets with data_policy.accepts_tokenized_input: true.
allow_internet_egressbooleanWhen false, exclude targets that allow internet egress.
local_only_processingbooleanKeep only targets with data_policy.local_only_processing: true.

More routing constraints

The fields above must have matching data_policy metadata on each provider target. They filter declared target properties. They do not transform input or verify an upstream provider contract.

Best practices

  • Add a data_policy block to each target that the selector must compare.
  • Keep retention_days specified so routing behavior stays predictable during reviews.
  • Use on_no_compliant_provider: block when dispatch must not continue without a matching target.
  • Use warn only when dispatch to all targets is an approved result.

Next steps