QWED is not a conventional application. It is a deterministic verification and enforcement boundary.
These rules are non-negotiable for contributors, reviewers, and automation tools operating on this repository.
No execution path may bypass verification. Every operation that produces output or triggers a side effect must first pass a deterministic verification gate. No exceptions for "safe enough" shortcuts.
If verification or enforcement fails—for any reason—the operation must block. Availability is secondary to correctness and containment. A false positive (rejecting a valid request) is always preferable to a false negative (passing an invalid one).
All enforcement decisions must be based on deterministic rules—not scoring, confidence thresholds, heuristics, or probabilistic models. If two independent runs of the enforcement logic on the same input could produce different results, the design is wrong.
Every security or verification boundary must be explicitly defined at the architectural level. Implicit boundaries (e.g., "the LLM will not output X because we prompted it not to") are not boundaries. A boundary must be testable, measurable, and auditable.
Sensitive operations (code execution, shell commands, database mutation) must
be routed through explicit, pre-approved wrapper functions. Direct calls to
eval, exec, os.system, subprocess.Popen, or raw parse_expr are
forbidden outside the approved wrappers.
If a component cannot fulfill its enforcement responsibility, it must fail loudly. Do not suppress errors. Do not auto-correct, auto-retry, or continue execution in a degraded mode. Silent degradation is a vulnerability in waiting.
Security and verification boundaries are not optional features. They must be on by default, server-side, and not configurable or bypassable by user input. The user cannot opt out of enforcement. Admission boundaries must be server-side and mandatory. Observation surfaces (e.g., read-only verification endpoints) must never silently become admission authorities — the role of each surface is an explicit architectural decision.
Claims must be verified by deterministic computation (SymPy, Z3, pgTAP, SQLGlot), not by the source of the claim. LLM outputs, confidence scores, reasoning chains, and metadata are inputs to the verification pipeline—they are not proof. Trust comes from deterministic verification, not from origin. Proof is established by deterministic evidence, not by successful execution, agreement, confidence, or provenance.
QWED rules apply regardless of the model provider, framework, or deployment environment. No LLM-specific behavior may be relied upon for enforcement - only documented, deterministic behaviors.
Hardening, boundary enforcement, and vulnerability mitigation take priority over feature velocity. Treat security debt as functional debt. Do not trade long-term safety for short-term convenience.
Do not patch individual symptoms; fix the vulnerability family. When a single
eval-like pattern is found, assume the entire category of similar bypasses
is exploitable until proven otherwise by an explicit, deterministic guard.
Introducing a new boundary or security layer must not reduce the severity of existing, unfixed security issues. All existing vulnerabilities retain their priority until resolved. New enforcement layers are additive, not substitutional.
Verification and enforcement are distinct architectural responsibilities.
Verification produces deterministic evidence (DiagnosticResult). Enforcement
consumes verified evidence to make admission decisions. Components must not
combine these responsibilities unless explicitly designed as an admission
boundary.
VERIFIED is a protocol guarantee, not a confidence level. VERIFIED may only be
emitted when a non-empty proof_ref exists and is bound to the deterministic
evidence that produced the verdict. Heuristic, probabilistic, or advisory
analysis must never be promoted to VERIFIED — it must be reported as
UNVERIFIABLE with structured advisory evidence.
Verification reports truth. Policy decides action. Evidence must never be
modified to satisfy policy. Admission is a separate decision produced by
enforce_trust_decision, distinct from the DiagnosticResult the engine
emitted: a policy denial is represented by that admission decision, and the
original DiagnosticResult and its evidence remain unchanged. Enforcement must
consume the verified result as produced; it must not reinterpret, downgrade, or
upgrade the verdict to fit a policy outcome. The control plane consumes the
admission decision and the preserved diagnostic separately.
- "Add fallback for reliability"
- "Gracefully handle failure by continuing execution"
- "Use eval/exec as backup"
- "Trust model output if confidence is high"
- "Retry automatically until success"
- "Allow temporary bypass until the verifier is available"
- "Score LLM outputs and accept if above N% confidence"
- "Rely on system prompt to prevent X from happening"
If a change improves usability, convenience, or availability but weakens enforcement, reject the change.
Priority order:
- Determinism
- Safety
- Control
- Everything else