Platform

Hallucination Blocker

Reduce AI hallucinations with five research-backed verification strategies — from zero-latency prompt scaffolds to multi-agent fact checking. Manage filters from the dashboard, CLI, or SDK.

How it activates
A hallucination filter does nothing until it is attached to a proxy key. Create the filter, attach it to a key, and every request through that key is protected.

Strategies

Each filter combines a built-in heuristic detector (fabricated citations, suspicious statistics, fake DOIs/URLs, overconfident claims) with any of five active strategies:

Request-time — modify the prompt, add no latency

reactstrategy

ReAct (Yao et al. 2022) — injects a Thought/Action/Observation reasoning scaffold into the system prompt so the model reasons about certainty before answering.

toolformerstrategy

Toolformer (Schick et al. 2023) — injects verify_calculation and flag_uncertain_claim tools; the model self-verifies math and flags claims it cannot confirm.

Response-time — call a verification LLM, add latency

covestrategy

Chain of Verification (Dhuliawala et al. 2023) — extracts claims, answers verification questions independently, and rewrites the response if discrepancies are found.

self_ragstrategy

Self-RAG (Asai et al. 2023) — scores each claim with ISREL/ISSUP/ISUSE reflection tokens; revises the response when overall confidence falls below your threshold.

marchstrategy

MARCH (2025) — runs up to 5 specialist agents in parallel (fact-checker, consistency, completeness, source evaluation, bias), then synthesizes a corrected response.

Picking strategies
Start with react + toolformer (free, zero latency). Add cove or self_rag for factual workloads. Reserve march for high-stakes content — it makes N+1 verification calls per response.

Dashboard

1Open Anti-Halluc

Navigate to Dashboard → Anti-Halluc in the sidebar. You'll see every hallucination filter on your account with its status, sensitivity, and active strategies.

2Create a filter

Click New Filter. Name it, pick a heuristic sensitivity (low / medium / high), and check the strategies you want — each one is labeled request-time or response-time.

3Configure verification

Selecting CoVe, Self-RAG, or MARCH reveals the verification model settings. Defaults to gpt-4o-mini via OpenAI; leave the API key blank to reuse your agent's own provider key. The Advanced panel exposes per-strategy knobs.

4Attach to an agent

Select the filter when creating an agent, or attach it to an existing key with the CLI or SDK (see below). A filter that isn't attached to any key does nothing.

What you'll see

Filter row — live preview
prod-hallucination-guardmedium
ReActCoVevia gpt-4o-mini

Status dot

green = enabled, gray = disabled

Sensitivity tag

heuristic detection threshold

Strategy chips

active strategies on this filter

Toggle

enable / disable without deleting

Create a Filter

POST/v1/user/filters

Body Parameters

namestringrequired

Filter name

filter_typestringrequired

Must be HALLUCINATION_BLOCKER

actionstringrequired

What to do on detection

Options: WARN, BLOCK, REDACT

apply_tostringrequired

Use RESPONSE for hallucination filters

configobjectrequired

Strategy configuration — see Config Reference below

cURL
curl -X POST https://api.metriqual.com/v1/user/filters \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "prod-hallucination-guard",
    "filter_type": "HALLUCINATION_BLOCKER",
    "action": "WARN",
    "apply_to": "RESPONSE",
    "config": {
      "sensitivity": "medium",
      "strategies": ["react", "cove"],
      "verification_model": "gpt-4o-mini",
      "verification_provider": "openai"
    }
  }'
TypeScript SDK
import { MQL } from '@metriqual/sdk';
const mql = new MQL({ token: 'YOUR_JWT' });

const filter = await mql.hallucination.create({
  name: 'prod-hallucination-guard',
  config: {
    sensitivity: 'medium',
    strategies: ['react', 'cove'],
    verificationModel: 'gpt-4o-mini',
    verificationProvider: 'openai',
  },
  // optional: attach immediately
  proxyKeyId: 'mql-your-proxy-key',
});
CLI
# Interactive (prompts for strategies & model)
mql hallucination create

# One-shot, attached to a key
mql hallucination create -n "prod-guard" \
  -s react,cove --key mql-your-proxy-key

Presets

Available presets

strictpreset

All 5 strategies, high sensitivity, 5 MARCH agents. Maximum protection, maximum latency.

balancedpreset

CoVe + Self-RAG, medium sensitivity. Good default for factual workloads.

fastpreset

ReAct + Toolformer only. Zero added latency, no verification LLM calls.

heuristicpreset

Pattern detection and disclaimers only — no active strategies.

TypeScript SDK
// Create directly from a preset
await mql.hallucination.createFromPreset('balanced', {
  name: 'balanced-guard',
  proxyKeyId: 'mql-your-proxy-key',
});

// Or inspect & customize a preset first
const cfg = mql.hallucination.getPreset('balanced');
cfg.verificationModel = 'claude-3-5-haiku-20241022';
cfg.verificationProvider = 'anthropic';
await mql.hallucination.create({ name: 'custom', config: cfg });
CLI
mql hallucination from-template
# → pick strict / balanced / fast / heuristic

Attach to a Proxy Key

PATCH/v1/proxy-keys/:proxy_key/filters
Required step
Filters are linked to keys through an association table. The PATCH endpoint replaces the full list of filter IDs for the key — the SDK and CLI handle the read-modify-write for you.

Pass the proxy key string (mql-...), not the filter ID, in the URL. Detaching works the same way with the filter removed from the list.

TypeScript SDK
await mql.hallucination.attach('filter-id', 'mql-your-proxy-key');
await mql.hallucination.detach('filter-id', 'mql-your-proxy-key');
CLI
mql hallucination attach FILTER_ID mql-your-proxy-key
mql hallucination detach FILTER_ID mql-your-proxy-key
cURL
# Replaces ALL filter associations for the key
curl -X PATCH https://api.metriqual.com/v1/proxy-keys/mql-your-key/filters \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{ "filter_ids": ["filter-uuid-1", "filter-uuid-2"] }'

List, Update, Toggle, Delete

Hallucination filters live alongside your other content filters; the SDK's hallucination namespace pre-filters to HALLUCINATION_BLOCKER type. Updates merge into the existing config on the CLI; the SDK replaces the config object you pass.

TypeScript SDK
const { filters } = await mql.hallucination.list();

await mql.hallucination.update('filter-id', {
  sensitivity: 'high',
  strategies: ['react', 'cove', 'march'],
  marchNumAgents: 5,
});

await mql.hallucination.toggle('filter-id');
await mql.hallucination.delete('filter-id');
CLI
mql hallucination list

mql hallucination update FILTER_ID \
  --sensitivity high -s react,cove,march

mql hallucination toggle FILTER_ID
mql hallucination delete FILTER_ID -y

Test Detection

POST/v1/filters/test

Run the heuristic detector against sample text without creating a filter — useful for tuning sensitivity before deploying. Returns a risk level, score, and the individual signals found.

TypeScript SDK
const result = await mql.hallucination.test(
  'Smith et al. (2019) showed 87.3% improvement.',
  { sensitivity: 'medium' }
);
console.log(result.riskLevel);   // 'Medium'
result.signals.forEach(s =>
  console.log(s.category, s.score, s.excerpt));
CLI
mql hallucination test \
  -c "Smith et al. (2019) showed 87.3% improvement."

Config Reference

config object (REST uses snake_case, TS SDK uses camelCase)

sensitivitystring

Heuristic detection threshold

Default: medium

Options: low, medium, high

strategiesstring[]

Active strategies to run

Default: []

Options: react, toolformer, cove, self_rag, march

verification_providerstring

Provider for verification LLM calls

Default: openai

Options: openai, anthropic, gemini, mistral

verification_modelstring

Model for verification passes

Default: gpt-4o-mini

verification_api_keystring

Key for the verification model. Falls back to the agent’s own provider key when omitted.

timeout_secsnumber

Per-strategy timeout. On timeout the original response is returned unmodified.

Default: 30

cove_max_questionsnumber

CoVe: max verification questions generated

Default: 5

self_rag_confidence_thresholdnumber

Self-RAG: 0–1; responses scoring below this are revised

Default: 0.7

self_rag_mark_uncertainboolean

Self-RAG: mark claims [UNCERTAIN] instead of removing them

Default: true

march_num_agentsnumber

MARCH: parallel specialist agents (1–5)

Default: 3

Failure behavior
Verification is fail-open: if a verification call errors or times out, the original response is returned untouched and the failure is logged. Your traffic is never blocked by a flaky verification model.