The 3-tier engine architecture
A single verification request flows through the tiers: proof engines attempt a deterministic proof, policy enforcement engines apply runtime rules, and advisory engines contribute structured diagnostics. Only the proof tier can produce aVERIFIED status.
This is the target
DiagnosticResult architecture. SymbolicVerifier is the reference implementation; other engines are being migrated incrementally and some still return legacy types (e.g., Dict[str, Any] with a verified boolean, or ImageVerificationResult).Tier 1: Proof engines
Proof engines produce mathematical evidence using symbolic solvers and formal methods. They are the only tier that can emitVERIFIED, and VERIFIED always requires a proof_ref.
Guarantee. For supported proof domains, hallucinations cannot bypass deterministic verification — an answer either has a reproducible proof or it is not VERIFIED.
When to use. Any claim that can be reduced to arithmetic, algebra, a constraint system, an AST invariant, a SQL structure, or a schema check.
Example proof-engine output:
Tier 2: Policy enforcement engines
Policy enforcement engines apply deterministic policies to inputs, contexts, and tool calls at runtime. They produce enforcement decisions —BLOCK or UNVERIFIABLE — but never a mathematical proof.
Guarantee. Rule-based, reproducible enforcement. The same input against the same policy produces the same decision, with a full decision trace.
When to use. Runtime guardrails on agents, MCP tools, RAG contexts, configs, and processes — anywhere you need a deterministic gate but the underlying question is not a math problem.
Example policy-engine output:
Tier 3: Advisory engines
Advisory engines run structured heuristic analysis on inputs where a formal proof is not available. Heuristic and model-based paths emitAdvisoryCheck records only — they can never emit VERIFIED, and their signals are carried as advisory_checks in the diagnostic result.
Guarantee. Advisory outputs are transparent and inspectable, but not deterministic proofs. Treat them as inputs to audit and human review, not as verification statuses. An LLM or VLM fallback never overwrites a deterministic verdict.
When to use. Fact-similarity checks, knowledge-graph triples, reasoning traces, multi-model consensus, and image analysis — signals that inform a decision but should not gate execution on their own.
Some engines in this tier are hybrid: a deterministic sub-path (for example, the Fact TF-IDF verdict or an Image pixel check) can still emit
VERIFIED with a proof_ref or BLOCKED on a refutation. Only the heuristic or model fallback path is strictly advisory. Consensus is a status-preserving aggregator: it never invents a VERIFIED from disagreement, and math-translation failures fail closed.
Example advisory-only output (LLM fallback path):
Behavior by engine type
Compare engines by the output guarantee they provide, not by a single accuracy number — different tiers are answering different questions.
For comparison to other approaches:
Engine selection
QWED auto-detects the appropriate engine based on content, then routes through the tiers:
Or specify explicitly:
Deterministic-first philosophy
Across all tiers, QWED follows a deterministic-first approach:- Try deterministic methods first (100% reproducible).
- Fall back to advisory signals only when necessary.
- Never promote a heuristic signal to
VERIFIED— advisory outputs stay inadvisory_checks.
See Determinism guarantee for how to inspect whether a response isSYMBOLICorHEURISTIC, and the Verification Diagnostics guide for the fullDiagnosticResultmodel.
Engine documentation
Proof engines
- Math engine — calculus, matrix, financial
- Logic engine — quantifiers, theorem proving
- Schema engine — JSON structure and math
- Code engine — multi-language security
- SQL engine — complexity limits
- Stats engine — Pandera invariants, Wasm sandbox
- Taint engine — data-flow analysis
Advisory engines
- Fact engine — TF-IDF and citations
- Graph engine — knowledge-graph triples
- Image engine — metadata and VLM cross-check
- Reasoning engine — multi-LLM review
- Consensus engine — parallel execution
Policy enforcement
Policy enforcement engines ship as SDK guards — see that page forSystemGuard, ConfigGuard, RAGGuard, MCPPoisonGuard, ExfiltrationGuard, SelfInitiatedCoTGuard, SovereigntyGuard, StartupHookGuard, and ProcessVerifier.