Skip to main content

Configuration & Policy Overview

This section shows how declarative config controls gateway behavior. Use it to select policy types and set their sequence in policies.chain. It also shows runtime behavior.

Start here

Your taskStart with
Understand the supported top-level schemaDeclarative Config Reference
Browse supported controls before selecting onePolicy Controls Catalog
Define provider targets, routing, or fallbackProviders Configuration and data-routing-policy
Add tests before rolloutConfig Testing and verdictan policy test
Protect sensitive or controlled datapii-detector and dlp-filter
Defend the input boundaryprompt-injection

Follow this sequence

  1. Read the Declarative Config Reference to select the correct document shape.
  2. Select policy types from the Policy Controls Catalog.
  3. Add them to policies.chain and tune each block in policy.<kind>.
  4. Validate the config with lint and tests before rollout.
  5. Add the audit marker.
  6. Verify request results with verdictan events or the Events API.
  7. Add History only when capture is enabled and stored session context is necessary.

How policies work

Primary policy groups

Request and routing controls

Policy typePurpose
prompt-injectionBlock prompt-injection and jailbreak signals before upstream calls
pii-detectorDetect sensitive identifiers and redact or block request content
dlp-filterApply broader pattern-based filtering for sensitive or proprietary data
rbacApply role, identity, and sensitivity-based access rules
agent-firewallLimit agent tool use and dangerous action classes
data-routing-policyFilter provider targets by retention or training metadata

Output controls

Policy typePurpose
quality-scorerScore output quality and block or replace failed output
human-oversightReturn an escalated result and do not deliver output
citation-verifierVerify groundedness against context

Audit and evidence

Policy typePurpose
audit-loggerEmit an allow-only audit marker. Configure retention and storage through their owning workflows.

Example configuration

pack:
name: "my-project"
version: "0.1.0"
enabled: true

policies:
chain:
- audit-logger
- prompt-injection
- pii-detector
- quality-scorer

policy:
prompt-injection:
attack_patterns:
- "ignore.*previous.*instructions"
- "forget.*system.*prompt"
encoding:
decode_base64: true
normalize_unicode: true
detect_homoglyphs: true
boundaries:
enforce_delimiters: true
reject_fake_boundaries: true
response:
action: block

pii-detector:
action: redact
pci_mode: true

quality-scorer:
assertions:
- type: word-count
config:
min: 20
thresholds:
min_aggregate: 0.7

audit-logger: {}

Key rules

  • Chain sequence: Policies run in the sequence in policies.chain.
  • First block: After the gateway blocks a turn, subsequent policies do not run for that stage.
  • Audit marker position: Put audit-logger before blocking controls when each evaluated request must contain the marker.
  • Redaction and buffering: Some policies redact request text and also buffer and examine output.
  • Phase limits: human-oversight runs only on output. language-validator enforces input checks only.

See the Declarative Config Reference for the complete schema and the Policy Controls Catalog for the inventory of supported controls.

Next steps