Input Controls
Data Routing Policy
data-routing-policy sends a request only to provider targets whose declared data handling meets your rules. For example, it can exclude every target that keeps data longer than you allow, and block the request if none is left.
You declare each target's data handling in its data_policy block. These values are your statements about the provider terms. Verdictan does not check them against the provider or create an agreement.
Configuration
Check the terms of the provider, record them in the target's data_policy, and add the control with its rules. Use this example only if its declarations are true for your approved target:
pack:
name: approved-provider-routing
version: 1.0.0
enabled: true
providers:
targets:
- id: approved-openai
provider: openai
model: gpt-4o-mini
secret_key_ref:
env: OPENAI_API_KEY
data_policy:
zero_data_retention: true
training_opt_out: true
retention_days: 0
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: blockApply it to a test agent with the config-first workflow. on_no_compliant_provider: block stops fallback to a target that fails the rules.
Verify provider exclusion
- Run
verdictan policy lint --file policy-config.yaml, and apply the file to a test agent. - Send a request with the agent's application token. The eligible target receives it.
- In a local copy, set the target's
retention_daysto30andzero_data_retentiontofalse. - Lint the copy. Lint reports that the rules exclude every target. Do not deploy the copy.
Lint catches an empty pool before rollout. At runtime, when no target passes, the gateway returns HTTP 403 with error.code: no_compliant_provider.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
require_zero_data_retention | boolean | false | Keeps only targets with zero_data_retention: true |
require_no_training | boolean | false | Keeps only targets with training_opt_out: true |
max_retention_days | integer | Excludes targets with a higher retention_days, and targets without retention_days | |
on_no_compliant_provider | string | block | block rejects the request when no target is left. warn logs a warning and sends it to all targets. |
log_provider_selection | boolean | true | Logs one line for each excluded target |
require_in_memory_only | boolean | false | Keeps only targets with in_memory_only: true |
sanitize_before_provider | boolean | false | Keeps only targets with sanitized: true. The control does not sanitize anything. |
tokenize_sensitive_fields | boolean | false | Keeps only targets with accepts_tokenized_input: true. The control does not tokenize anything. |
allow_internet_egress | boolean | true | With false, excludes targets with allow_internet_egress: true |
local_only_processing | boolean | false | Keeps only targets with local_only_processing: true |
Target metadata
The rules compare against these keys in providers.targets[].data_policy:
| Field | Type | Default | Declares that the provider |
|---|---|---|---|
zero_data_retention | boolean | false | Stores no request or response data |
training_opt_out | boolean | false | Does not train models on the traffic |
retention_days | integer | Keeps data for this many days. 0 means not at all. | |
in_memory_only | boolean | false | Processes payloads in memory only |
sanitized | boolean | false | Sanitizes sensitive content at its endpoint |
accepts_tokenized_input | boolean | false | Accepts tokenized input |
allow_internet_egress | boolean | true | Uses internet egress for inference |
local_only_processing | boolean | false | Processes requests without external network calls |
How it works
- The control is active when it is in the chain and at least one rule is set.
- In the input stage, the chain entry returns
allowwithdata-routing-policy.pre_routing_gate. The details contain a copy of the configured block. - Before dispatch, the gateway orders the targets by the routing strategy and any provider pin.
- The control checks each target. A target without
data_policy, or that fails a rule, is excluded, and the reason is recorded. - With
log_provider_selection, the gateway logsdata-routing-policy excluded providerwith the target ID and reason. - If targets remain, the gateway uses them in routing order.
- If none remain and the action is
block, the gateway returns HTTP403with error typedata_routing_policy_violationand codeno_compliant_provider. - If none remain and the action is
warn, the gateway logs a warning and uses all ordered targets.
Phase and verdicts
| Item | Value |
|---|---|
| Phase | input for the chain entry, provider selection for the filter |
| Request families | Chat Completions, Completions, Responses, Messages, Embeddings, Audio transcriptions, Moderation |
| Verdicts | allow |
| Reason codes | data-routing-policy.pre_routing_gate |
The filter itself emits no policy verdict. A blocked client receives the 403 body with no_compliant_provider and no verdictan.decision object.
Fallback respects the filter
A fallback target must pass the same rules as the first target. With a maximum retention of zero, a target that declares 30 days is excluded and can never be the fallback.
Set the order of the passing targets with provider routing. data_policy metadata alone filters nothing: the chain must contain data-routing-policy with at least one rule.
Limits and failure behavior
- The control filters on declarations. It does not verify provider terms, transform the request, sanitize content, or tokenize fields.
- With an active rule, a target without
data_policyis always excluded. Give every target that must stay eligible adata_policyblock. - With
max_retention_days, a target withoutretention_daysis excluded. - A block without any rule does nothing.
on_no_compliant_providerandlog_provider_selectionare not rules. warnsends requests to targets that fail the rules. Use it only when that is acceptable.- The control does not filter by region. For region pinning, use
providers.routing.require_regionwithdata_residencyon each target. See Data residency. - The filter applies to buffered and streaming requests alike.
Next steps
- Zero-Retention Routing: a complete zero-retention setup with tests.
- Connect your model provider: targets and credentials.
- Provider Configuration:
require_regionanddata_residency.