Skip to main content

querywarden

A CI gate for text-to-SQL features on PostgreSQL. Work in progress: the GitHub Action and a package release are not done yet.

Try the demo

The demo needs Docker and uv, and no API key. It replays hand-written answers against a small invented bookshop, with failures planted on purpose. Those answers are not the output of any model, so the result says nothing about model quality.

docker compose -f examples/bookshop/compose.yaml up -d --wait
export QUERYWARDEN_DATABASE_URL=postgresql://querywarden_reader:demo-only@127.0.0.1:55432/bookshop
uv run querywarden validate --config examples/bookshop/querywarden/querywarden.yaml
uv run querywarden run --config examples/bookshop/querywarden/querywarden.yaml
docker compose -f examples/bookshop/compose.yaml down

querywarden run exits with 1 because of the planted safety failures. Exit codes: 0 pass, 1 gate failed, 2 configuration or setup error.

Gates

  • Safety: any policy violation, blocked statement or answered refusal case fails the run. This has no tolerance setting.
  • No answer: any provider error fails the run, so an outage cannot look like a pass.
  • Accuracy: only gated when you pass --baseline, using a report saved earlier with --json-out. Add --allowed-drop 0.02 to tolerate a small drop. Only cases present in both runs count, so removing a failing case cannot raise the score.
  • --strict: also fails on any newly failing case, any case removed since the baseline, and any query whose lineage could not be analyzed.

Reports show a 95% interval, and whether a change against the baseline is statistically clear. They never contain rows returned by the database, but they do contain the generated SQL and error messages, so treat them as internal.

Run the tests

Docker is required, because the safety tests run against a real PostgreSQL server.

uv run pytest
QUERYWARDEN_PG_IMAGE=postgres:16-alpine uv run pytest

Known limits

  • The row and byte caps are checked after each batch reaches the client, so one enormous value can use a lot of client memory before the query is cut off.
  • Single-label hostnames are treated as local, so Docker service names work in CI. The role checks still apply.
  • The privacy checks catch direct uses of forbidden columns, including through views, and planted values in results. They do not judge what could be inferred from aggregates, and SQL that cannot be analyzed is reported as unknown, not as safe.
  • Do not point this tool at a production database.

GitHub Action

See docs/github-action.md for the inputs, outputs and a workflow example.

Metadata

Release files for querywarden-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for querywarden-cli 0.1.0
File Size Uploaded Provenance Actions
querywarden_cli-0.1.0.tar.gz 110.5 kB With provenance Details for querywarden_cli-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for querywarden-cli 0.1.0
File Interpreter ABI Platform Actions
querywarden_cli-0.1.0-py3-none-any.whl Python 3 none any Details for querywarden_cli-0.1.0-py3-none-any.whl

Total release size: 143.5 kB

Release files / querywarden_cli-0.1.0.tar.gz

Download URL querywarden_cli-0.1.0.tar.gz
Size 110.5 kB
Tags Source
SHA-256 checksum
How to use checksums
28b1a7ae3f1759632c941a46a85928dc528aaf1758565736adf9814b3521f474
BLAKE2b-256 checksum
How to use checksums
90440ee299bfcceed30e6ec8b23867a202e33ef9f411121151fa22b2a0e74514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / querywarden_cli-0.1.0-py3-none-any.whl

Download URL querywarden_cli-0.1.0-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aba9a6742408561a7d679338de09cc35c6fd4a7ac30d397626b69c78e419e6ab
BLAKE2b-256 checksum
How to use checksums
b4e8e74ab5956e2521fd6d081c99c80ad86526f38943f3f548c55826bb28b1eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for querywarden-cli 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for querywarden_cli-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page