Citation Verifier
The citation-verifier policy runs in the output phase. It gets supported citation patterns. It can examine RAG context overlap. It also records verification details. It blocks only unverified output when output_action.unverified_action is block.
Use stream: false for this control. The active SSE path does not run this
verifier against buffered output.
Phase and verdicts
- Phase:
output - Possible verdicts:
allow,block
Configuration
pack:
name: citation-verifier-example
version: 1.0.0
enabled: true
policies:
chain:
- citation-verifier
policy:
citation-verifier:
require_sources: true
require_source_match: true
min_confidence: 0.8
min_groundedness: 0.8
extract_patterns:
- case_law
- academic
- url
- quote
- statistic
rag_context:
verify_against_context: true
min_context_overlap: 0.7
output_action:
unverified_action: block
response:
include_verification_report: true
Supported fields
| Field | Type | Default | Notes |
|---|---|---|---|
require_sources | boolean | true | Citations that the policy finds are necessary when verification runs. |
require_source_match | boolean | true | Can also be supplied in verification.require_source_match. |
min_confidence | number | 0.8 | Used for claim-confidence checks. |
min_groundedness | number | 0.8 | Is also a compatibility fallback for rag_context.min_context_overlap. |
extract_patterns | string[] | ['case_law','academic','url','quote','statistic'] | Can also be supplied in verification.extract_patterns. |
rag_context.verify_against_context | boolean | true | Enables groundedness evaluation against the given context documents. |
rag_context.min_context_overlap | number | 0.7 | Governs the context-overlap threshold. |
output_action.unverified_action | flag | redact | block | flag | Only block changes the verdict. redact does not change output. |
response.include_verification_report | boolean | true | When false, result details contain only a minimum payload. |
How it works
- The gateway gets assistant text from the upstream response.
- If
rag_context.verify_against_contextis enabled, it reads context documents from the request. - It gets supported citation patterns from the configured public set.
- It calculates groundedness and claim-confidence details.
- The output is verified only when the configured citation/context requirements pass.
- The gateway blocks only when the output is unverified and
output_action.unverified_actionisblock.
Important behavior notes
- Other
output_action.unverified_actionvalues keep the verdict asallow. They do not redact the response body. - Verified responses include a
verification_reportunlessresponse.include_verification_reportis disabled.
Example scenarios
Block unverified outputs
policy:
citation-verifier:
require_sources: true
require_source_match: true
output_action:
unverified_action: block
Context-only verification with minimal details
policy:
citation-verifier:
require_sources: false
rag_context:
verify_against_context: true
min_context_overlap: 0.7
response:
include_verification_report: false
Best practices
- Use
output_action.unverified_action: blockwhen groundedness is mandatory. - Keep
require_source_match: truefor controlled or citation-sensitive outputs. - Give request-side context documents if context grounding must be part of verification.
- Keep
extract_patternsto the documented public values and rely on request-side context when groundedness is necessary.
Next steps
- Quality Assertions Configuration — response quality checks alongside grounding
- Policy templates — browse available starter packs
- Policies overview — policy chain architecture