fedbench tests how accurately an AI answers questions from policy documents. It is an open-source evaluation harness for grounded Q&A, where the model may only use the documents it retrieved. The agent reads federal documents and answers questions about them; the harness scores hallucination, citation accuracy, and refusal discipline as first-class metrics. 21 verified Q&A pairs across two side-by-side public document sets (Medicare and OSHA), ~$0.025 per pair, replay path that runs in 1 second with no API key.
How it's built
Bun + TypeScript strict, Anthropic SDK, BM25 retrieval over chunked PDFs. Three layered checks per question: a deterministic citation check (does the agent's claimed page actually contain the key words of its answer?), an LLM-as-judge run on Opus 4.7 (a stronger model than the agent's Sonnet 4.6, on purpose), and refusal correctness on a split of questions the documents can't answer. Every model call goes through a Sonnet → Haiku fallback ladder with full provenance attached to the response: which rung answered, latency, cost, attempts that bailed.
Files worth reading
- The agent prompt + system rules that enforce citation format and refusal phrasing
- The judge harness that grades whether a cited chunk supports the agent's claim
- The recordings file that powers the no-API-key replay path
The trade-offs
Custom evals over verified document sets are slower to author than vendor evals over synthetic data, but they catch the failures that actually break trust. The harness is opinionated on purpose: deterministic checks before LLM checks, recordings kept as audit files, provenance on every call.