Citation Verifier
The citation-verifier policy runs in the output phase. It extracts supported citation patterns, optionally checks RAG context overlap, and records verification details. It blocks only when the output is unverified and output_action.unverified_action is set to block.
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 | Requires extracted citations when verification runs. |
require_source_match | boolean | true | May also be supplied under verification.require_source_match. |
min_confidence | number | 0.8 | Used for claim-confidence checks. |
min_groundedness | number | 0.8 | Also serves as a compatibility fallback for rag_context.min_context_overlap. |
extract_patterns | string[] | ['case_law','academic','url','quote','statistic'] | May also be supplied under verification.extract_patterns. |
rag_context.verify_against_context | boolean | true | Enables groundedness evaluation against provided context documents. |
rag_context.min_context_overlap | number | 0.7 | Governs the context-overlap threshold. |
output_action.unverified_action | flag | redact | block | flag | block is the only setting that changes the verdict; redact does not rewrite output today. |
output_action.hallucination_action | block | block | Accepted by the schema but not used by the current evaluator. |
external_resolver.endpoint | string | — | Accepted by the schema but not called by the current evaluator. |
external_resolver.api_key | string | — | Literal credential metadata for the inactive external resolver path. |
external_resolver.timeout_ms | integer | 2000 | Accepted timeout metadata for the inactive resolver path. |
response.include_verification_report | boolean | true | When false, result details are reduced to a minimal payload. |
How it works
- The gateway extracts assistant text from the upstream response.
- It reads context documents from the request payload when
rag_context.verify_against_contextis enabled. - It extracts supported citation patterns from the configured public set.
- It computes groundedness and claim-confidence details.
- The output is considered 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
- The policy does not enforce a separate
hallucination_actionfield. - The policy also ignores
external_resolverconfig. Do not rely on it for verification behavior today. - Values other than
blockforoutput_action.unverified_actiondo not redact the response body; they keep the verdict asallowand surface verification details. - 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 regulated or citation-sensitive outputs. - Provide request-side context documents if you expect context grounding to be part of verification.
- Keep
extract_patternsto the documented public values and rely on request-side context when groundedness matters.
Next steps
- Quality Assertions Configuration — response quality checks alongside grounding
- Policy templates — browse available starter packs
- Policies overview — policy chain architecture