zero-dependency · MIT · npm · PyPI · MCP

Stop your AI from making up facts
about your own data

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.

The problem

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.

How it looks in code

// 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

Live demo

Edit the records, pick a domain preset, and watch the gate decide. Runs entirely in your browser.

Examples:

Input

Preset: records (JSON)

Gate output

A domain is just a preset

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"]
};

Install

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.