Open-source runtime verification for AI, licensed under Apache-2.0.
QWED
Contact

Type to search pages, engines and advisories.

    Looking for API details?Search the docs

    Install

    QWED runs in your own environment. Install the library for your language, then run qwed init to check the engines and connect a model provider.

    pip install qwedPython 3.10+

    Python

    Python 3.10 or newer. One command installs the core engines (Math, Logic with Z3, SQL with SQLGlot, Code, Schema, Fact and Stats) and the qwed command line tool.

    shell
    pip install qwed

    Optional extras

    • qwed[server]The FastAPI server and its dependencies
    • qwed[symbolic]CrossHair, for the Symbolic engine
    • qwed[pii]PII masking with Microsoft Presidio
    • qwed[langchain], qwed[crewai], qwed[llamaindex]Framework integrations (experimental, not covered by CI)
    shell
    pip install "qwed[server]"

    Other languages and runtimes

    • TypeScript

      npm install @qwed-ai/sdk

      Latest on npm: 7.3.0.

    • Go

      go get github.com/QWED-AI/qwed-verification/sdk-go/v7

      Releases are tagged sdk-go/vX.Y.Z; the module path ends in /v7.

    • Rust

      cargo add qwed
    • Docker

      docker pull qwedai/qwed-verification

      The API server. It needs API_KEY_SECRET and QWED_CORS_ORIGINS.

      Self-hosting guide

    From source

    shell
    git clone https://github.com/QWED-AI/qwed-verification.gitcd qwed-verificationpip install -e ".[server,dev]"

    First run

    Three commands take you from a fresh install to a working setup.

    • qwed initChecks the engines, sets up a model provider and creates a local API key.
    • qwed doctorHealth check for the engines, provider, server and database.
    • qwed testRuns twelve deterministic checks. Needs no model and no server.
    qwed init, shortened
    qwed init[QWED] Initializing verification engines...  [ok] SymPy    math engine ready  [ok] Z3       logic engine ready  [ok] AST      code engine ready  [ok] SQLGlot  sql engine readyRunning verification suite...  [ok] 2+2=5                    -> BLOCKED  [ok] x>5 AND x<3              -> UNVERIFIABLE  [ok] SELECT * WHERE 1=1       -> BLOCKED  [ok] eval(user_input)         -> VERIFIED (unsafe)All engines verified. QWED is operational.Step 1/3: LLM Provider SetupStep 2/3: API KeyStep 3/3: Generate QWED API Key  Starting local server...  Warning: Save this key. It is shown only once.QWED is ready.

    The suite feeds each engine a known-bad input, and every case must come back denied. This is the CLI’s output today, and two of its labels are out of date: 2+2=5 was checked and proven false, which the protocol records as VERIFIED · DENY rather than BLOCKED, and “All engines verified” means the engines are ready. Both are being fixed in qwed-verification#438.

    Model providers

    QWED uses a model only to translate natural language into a formal statement, and treats it as an untrusted translator. Pick a provider with --provider. Any OpenAI-compatible API works through custom.

    • nvidia
    • openai
    • anthropic
    • gemini
    • custom

    To run against a local model such as Ollama, see LLM configuration in the docs.

    shell
    qwed init --provider anthropic# In CI, skip the promptsqwed init --non-interactive --provider nvidia

    Your data stays where you run QWED. QWED does not send data anywhere by itself. Checks that use a model send the prompt to the provider you configure; with a self-hosted model, nothing leaves your infrastructure. Optional PII masking (qwed[pii]) redacts card numbers, social security numbers and email addresses before the model call.

    In CI with GitHub Actions

    Scan for secrets, unsafe code or unsafe shell commands on every push. With output_format: sarif the action writes qwed-results.sarif; upload it with codeql-action/upload-sarif to see findings in the Security tab.

    For pull request checks without writing a workflow, install the QWED Security GitHub App.

    .github/workflows/qwed.yml
    - uses: QWED-AI/qwed-verification@v7.3.0  with:    action: scan-secrets        # or scan-code, verify-shell    paths: "**/*.py,**/*.env"    output_format: sarif

    Domain packages

    Each domain package adds checks for one field and installs on its own.

    • qwed-financeBanking, payments and financial calculations
      v3.0.1pip install qwed-finance
    • qwed-legalDeadlines, amounts and legal claims
      v0.5.1pip install qwed-legal
    • qwed-taxTax compliance and withholding
      v0.2.1pip install qwed-tax
    • qwed-infraTerraform, IAM and cloud cost
      v0.3.0pip install qwed-infra
    • qwed-open-responsesAgent tool calls, checked before they run
      v0.6.1pip install qwed-open-responses
    • qwed-mcpMCP server for any MCP client
      v0.2.2pip install qwed-mcp
    • qwed-a2aAgent-to-agent verification
      v0.3.0pip install qwed-a2a
    • qwed-ucpUniversal Commerce Protocol transactions
      v0.3.0pip install qwed-ucp
    Next: the quickstartHow the engines work Install problem? Open an issue