Where does the term come from?
Runtime verification is an established area of formal methods. It checks whether a run of a system satisfies or violates a stated property while the system runs, instead of proving the whole program correct in advance, as model checking does, or trying sample inputs before release, as testing does. Leucker and Schallhart, 2009
Applied to AI, each model output or tool call is one run. The property is a formal statement about it: a total that must equal its inputs, a constraint, a schema, a rule about what a query may do. The check happens on the live output, before anything uses it, and the statement either holds or does not. Software that does this between a model and the system that acts is often called a verification layer.
How is it different from evals, guardrails and monitoring?
Guardrails and runtime verification both run in the window, on live traffic. The difference is what decides. A model-based guardrail gives a judgement, which can change with a new model or prompt. A deterministic check gives the same decision for the same input, and a proof engine shows its work. Deterministic guardrails
The four, side by sideWhen each runs, and what it returns
| Kind of check | When | Looks at | Returns | Can stop a bad action |
|---|---|---|---|---|
| Evals | Before release | A fixed test set | A score | No |
| Model-based guardrails | As each output is produced | One input or output | A label or a score | Yes, when enforced; the decision is a judgement |
| Runtime verification | As each output is produced | One output or tool call | A decision, with a proof reference when VERIFIED | Yes, when the application acts on the decision |
| Monitoring | After the action | Logs and traces | Alerts and dashboards | No |
What does a runtime check return?
Here are six of the twelve lines qwed test prints. It runs deterministic checks with no model and no server. Each line gives the result, then the decision on whether to act:
- Math
2+2=4Proven to holdVERIFIED | ADMIT - Math
2+2=5Proven falseVERIFIED (false) | DENY - Logic
x>5 => x>10Proven falseVERIFIED (false) | DENY - Logic
x>5 AND x<3Could not be provenUNVERIFIABLE (contradiction) | DENY - SQL
OR 1=1 injectionProven unsafeVERIFIED (unsafe) | DENY - Code
eval(input)Proven unsafeVERIFIED (unsafe, critical) | DENY
The two parts are independent. 2+2=5 is decided, so its status is VERIFIED, and it is false, so the decision is DENY. VERIFIED means the engine decided the claim, not that the claim is true or safe, and it always carries a proof_ref, a SHA-256 commitment to the evidence. What each decision record holds
Through the API, every route returns the status: VERIFIED, UNVERIFIABLE or BLOCKED. Six routes also return the decision as a separate admission, ADMIT or BLOCKED (written DENY in a Verification Context record): math, code, SQL, logic, natural language and agent verification. The others do not yet (#581). In Python, admission_decision(result) applies the rule of the math, code and SQL routes. How a result reads
What can be verified at runtime?
Claims that can be written as a formal statement. QWED has 13 engines and 9 policy guards. Of its 6 proof engines, these 5 can return VERIFIED, always with a proof reference:
The rest never decide on their own
Symbolic searches for counterexamples and returns
UNVERIFIABLEorBLOCKED, not proofs. Stats runs code in a sandbox and returnsUNVERIFIABLE: running is not verifying. The advisory engines (Fact, Graph, Image, Reasoning, Consensus) add signals for review; Graph and Image can returnVERIFIEDonly on a deterministic sub-path with aproof_ref, which is evidence, not proof, and Consensus never does. Policy guards return block or hold decisions.
Each kind of claim, with what comes back for it: How to verify LLM output. All of them: Engines.
What happens when the check cannot decide?
The output is not admitted. QWED is designed to fail closed: a claim no engine can check, input an engine cannot read or a check that does not finish is not reported as VERIFIED. That is the point of verifying at runtime: an unchecked output does not slip through because a check broke. What fail-closed means
One known exception, stated in the README: the logic route can report VERIFIED for a claim it proves from the constraints a model translated the question into. That result is not admitted, and the fix is tracked in #581.
Where does runtime verification run?
In your own environment: as a Python library, a CLI, a self-hosted API or a Docker image, with SDKs for TypeScript, Go and Rust. Checks on a figure, a query, code or JSON need no model call. The natural-language routes do: they ask the model you configure to turn text into a formal statement, and that text goes to its provider unless you run a local model. Install
How do other tools decide?
Six tools that check AI input, output or actions, each set beside QWED on its own page and checked against a pinned release or the provider's documentation:
NeMo Guardrails
Decides with Each rail’s own setup: models, rules, schema
Made for Content safety, jailbreaks, topics
QWED vs NeMo GuardrailsGuardrails AI
Decides with Validators you pick: rules, ML models, LLM calls
Made for Output shape, PII, toxic language
QWED vs Guardrails AILlamaFirewall
Decides with A classifier, an LLM judge, code rules
Made for Prompt injection, agents going off task, insecure code
QWED vs LlamaFirewallOpenAI Guardrails
Decides with Models, the Moderation API, rules, Presidio
Made for Jailbreaks, moderation, PII, off-topic text
QWED vs OpenAI GuardrailsAgent Governance Toolkit
Decides with Policies: Rego, Cedar or YAML rules
Made for Which actions an agent may take, and which agent took them
QWED vs Agent Governance ToolkitBedrock Automated Reasoning
Decides with Formal logic over rules from your document; models translate the text
Made for Answers checked against your written policies
QWED vs Bedrock Automated Reasoning
What does it not do?
- It does not check intent. It verifies the formal statement it is given or extracts, not whether that statement is what the user meant.
- It does not cover every domain. A claim outside every engine comes back
UNVERIFIABLE. - It does not verify the translation. When a model turns text into a formal statement, that step is not itself checked.
- It is only as sound as its engines. Past soundness bugs are published as advisories. Each one in which an engine returned
VERIFIEDfor a false claim is reproduced in an eval that runs at every release. Evidence
Everything QWED does not verify
Sources and further reading
- Leucker and Schallhart, “A brief account of runtime verification”, Journal of Logic and Algebraic Programming 78(5), 2009. A short survey of runtime verification in formal methods, set beside model checking and testing.
- OWASP Top 10 for LLM Applications 2025: LLM05 Improper Output Handling. Why model output should be validated before another system uses it.
- qwed-verification 12.0.0 README. What qwed test prints, how a result reads, the engines and guards, and what QWED does not do.
Written and reviewed by the QWED maintainers under the project's governance model. Found an error? Contact us.
