A pre-generation gate that decides whether an LLM may speak — based on evidence coverage, freshness, and quality. The missing step between retrieve and generate.
LLMs answer confidently even when the data is missing, stale, or partial — inventing a quarter that doesn't exist, or quoting a cached source as authoritative. Content-safety guardrails (toxicity, PII) don't catch this. It's a grounding problem, and it needs a grounding gate.
// before you call the model: const gate = evidenceGate({ records: myRecords, rules: presets.FINANCE }); if (!gate.allowedActions.summarize) { return gate.caveats.join(" "); // "No financial statements available — the AI must not invent numbers." } // otherwise inject gate.caveats into your prompt and generate
Edit the records, pick a domain preset, and watch the gate decide. Runs entirely in your browser.
The engine is domain-agnostic. Finance, healthcare, support, legal — adding a vertical means adding a preset, never touching the core. Forbidden actions (diagnose, personalized_advice, claim_realtime) are always forced to false.
const HEALTH = { primaryLabel: "lab results", staleDays: 90, minRecords: 2, qualityThreshold: 80, forbiddenActions: ["diagnose", "prescribe"] };
npm install evidence-gate pip install evidence-gate
There's also an MCP server (npx evidence-gate-mcp) so an agent can call check_evidence on itself before it answers.