Skip to main content

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:

policy-config.yaml
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: block

Apply 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​

  1. Run verdictan policy lint --file policy-config.yaml, and apply the file to a test agent.
  2. Send a request with the agent's application token. The eligible target receives it.
  3. In a local copy, set the target's retention_days to 30 and zero_data_retention to false.
  4. 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​

FieldTypeDefaultDescription
require_zero_data_retentionbooleanfalseKeeps only targets with zero_data_retention: true
require_no_trainingbooleanfalseKeeps only targets with training_opt_out: true
max_retention_daysintegerExcludes targets with a higher retention_days, and targets without retention_days
on_no_compliant_providerstringblockblock rejects the request when no target is left. warn logs a warning and sends it to all targets.
log_provider_selectionbooleantrueLogs one line for each excluded target
require_in_memory_onlybooleanfalseKeeps only targets with in_memory_only: true
sanitize_before_providerbooleanfalseKeeps only targets with sanitized: true. The control does not sanitize anything.
tokenize_sensitive_fieldsbooleanfalseKeeps only targets with accepts_tokenized_input: true. The control does not tokenize anything.
allow_internet_egressbooleantrueWith false, excludes targets with allow_internet_egress: true
local_only_processingbooleanfalseKeeps only targets with local_only_processing: true

Target metadata​

The rules compare against these keys in providers.targets[].data_policy:

FieldTypeDefaultDeclares that the provider
zero_data_retentionbooleanfalseStores no request or response data
training_opt_outbooleanfalseDoes not train models on the traffic
retention_daysintegerKeeps data for this many days. 0 means not at all.
in_memory_onlybooleanfalseProcesses payloads in memory only
sanitizedbooleanfalseSanitizes sensitive content at its endpoint
accepts_tokenized_inputbooleanfalseAccepts tokenized input
allow_internet_egressbooleantrueUses internet egress for inference
local_only_processingbooleanfalseProcesses requests without external network calls

How it works​

  1. The control is active when it is in the chain and at least one rule is set.
  2. In the input stage, the chain entry returns allow with data-routing-policy.pre_routing_gate. The details contain a copy of the configured block.
  3. Before dispatch, the gateway orders the targets by the routing strategy and any provider pin.
  4. The control checks each target. A target without data_policy, or that fails a rule, is excluded, and the reason is recorded.
  5. With log_provider_selection, the gateway logs data-routing-policy excluded provider with the target ID and reason.
  6. If targets remain, the gateway uses them in routing order.
  7. If none remain and the action is block, the gateway returns HTTP 403 with error type data_routing_policy_violation and code no_compliant_provider.
  8. If none remain and the action is warn, the gateway logs a warning and uses all ordered targets.

Phase and verdicts​

ItemValue
Phaseinput for the chain entry, provider selection for the filter
Request familiesChat Completions, Completions, Responses, Messages, Embeddings, Audio transcriptions, Moderation
Verdictsallow
Reason codesdata-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_policy is always excluded. Give every target that must stay eligible a data_policy block.
  • With max_retention_days, a target without retention_days is excluded.
  • A block without any rule does nothing. on_no_compliant_provider and log_provider_selection are not rules.
  • warn sends 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_region with data_residency on each target. See Data residency.
  • The filter applies to buffered and streaming requests alike.

Next steps​