VerifierAgent (pure reasoning, zero tools) + VerifyHook (PostHook in the pipeline). When a discrepancy is detected, the verified_with_discrepancy flag is recorded in result.Metadata, activating Reflexion downstream.
CoVe is opt-in. With
CHATCLI_QUALITY_VERIFY_ENABLED=false (default), zero overhead. When enabled, it adds +1 LLM call per use point with high effort (default effort="high").VerifierAgent protocol
The model receives TASK + DRAFT and emits five blocks:Critical rule: INDEPENDENT answers
The protocol instructs the model to answer eachQ<n> without referring to the DRAFT. This is the heart of CoVe — if independent answers contradict the draft, there’s a suspect claim.
VerifyHook flow
1
Worker finishes
Any agent produces
result.Output.2
VerifyHook.PostRun
3
Dispatch VerifierAgent
4
ParseVerifierOutput
Extracts the 5 blocks. Tolerant to order, bullets with
- or *.5
HasDiscrepancy check
Status=="verified-with-corrections" OR Discrepancies!="none".6
On discrepancy + RewriteOnDiscrepancy
7
Reflexion consumes the flag
In the same pipeline run,
ReflexionHook.PostRun sees the metadata and, if OnHallucination=true, triggers lesson generation.Exclude list (anti-recursion + non-textual agents)
/verify — session toggle
Environment variables
Verifier override
Example: catching API hallucination
- Draft (with subtle error)
- Questions
- Answers
- Discrepancies
- Final (rewritten)
Go’sError:http.Clienthas aDefaultTimeoutfield you can set globally. Just dohttp.DefaultClient.DefaultTimeout = 30 * time.Secondin the program’s init.
DefaultTimeout doesn’t exist. It’s Timeout (and there’s no “DefaultTimeout” in stdlib).result.Metadata["verified_with_discrepancy"]=true. If Reflexion is on (default), a lesson is generated in background:
Interaction with Refine
When Refine + Verify are both enabled, order matters:Direct invocation
Cost and latency
See also
#3 Reflexion
Consumes the
verified_with_discrepancy signal to generate lessons about hallucination.#5 Self-Refine
Stylistic complement: Refine polishes, CoVe verifies factually.
Original paper (Dhuliawala et al.)
Chain-of-Verification Reduces Hallucination in Large Language Models
Configuration
Env vars and slashes in one place.