Agent security suite. QueryShield is the lead product: a secure SQL proxy and a named credential vault, one qs_ API key, one Stripe customer, and this docs site.
Agents call a single endpoint in plain English (or structured SQL). QueryShield:
Translates natural language → SQL via Claude with prompt caching.
Secure SQL proxy for AI agents — NL→SQL, AST safety, per-agent RLS, audit log.
QUERYSHIELD_API_KEY, QUERYSHIELD_BASE_URL
Zuletzt geprüft
2026-11-09
Sterne
—
Tools
—
Uptime
—
Validates every query at the AST level — only SELECT is allowed, no
stacked statements, no forbidden functions, LIMIT required.
Applies per-agent row-level security: schema/table whitelists and
WHERE clause injection.
Executes against the customer DB and returns rows.
Logs every attempt to an append-only audit table — metadata only,
never row contents.
Agents never see connection strings.
The credential vault stores other secrets (API tokens the agent is allowed to use). It is the AgentVault product, folded into this service. Permission patterns decide which names an agent can read. Database connection strings stay in a separate encrypted store and are not readable through the vault.
Free tier / funnel:InjectShield scans untrusted text for prompt injection. It stays in its own repository (bch1212/injectshield) and its own API (api.injectshield.dev). Start there, then create one QueryShield workspace when an agent needs a database or a vault. Docs: injectshield.dev/docs. Suite page on this service: /suite.
Quickstart
pip install -r requirements.txt
cp .env.example .env
# Set ANTHROPIC_API_KEY, DATABASE_URL, and VAULT_KEY in .env (see below).
# Do not commit .env. QueryShield reads secrets from the environment only.
python -m queryshield.start
Generate a Fernet key for VAULT_KEY once and never lose it. Credential
encryption and session signing both require VAULT_KEY (or SESSION_KEY
for cookies). If it is unset, those operations fail instead of using a
built-in key:
Source for the standalone PyPI package lives in packages/queryshield-mcp/.
For MCP directory evaluators such as Glama, the repository root also includes a slim Dockerfile that launches the published queryshield-mcp stdio server for tool introspection. The container does not need QUERYSHIELD_API_KEY for MCP initialization/tool discovery; the key is only required when a discovered tool is actually invoked against a QueryShield API tenant.
MCP integration (legacy)
Drop this into any MCP-aware client (Claude Desktop, Cursor, custom agents):
get_credential(name, cost) — one permitted secret, same API key
get_audit_log(limit) — recent attempts for the calling agent
The PyPI package queryshield-mcp picks up the vault tools on its next release. Until then, python -m queryshield.mcp_server from this repo already exposes them.
Security model
Threat
Defense
Agent crafts a DROP TABLE
sqlglot AST refuses non-SELECT
Agent sneaks ; and a second statement
parser rejects len(statements) > 1
Agent uses pg_sleep, xp_cmdshell, ...
function deny-list at the AST node level
Agent reads tables outside its scope
RLS schema + table whitelist
Agent reads other tenants' rows
row_filters injected via AST .where()
Connection string leaks via stack traces
Fernet-encrypted, never returned in any API
Agent reads a secret it was not granted
fnmatch permissions; empty list fails closed
Vault audit becomes the secret
credential access log stores metadata only
Audit log becomes the data exfil vector
only metadata is stored — never rows
VAULT_KEY rotation
re-encrypt rows under new key (script-driven)
safety.py is the single most important module. Every additional check
that lands there should ship with a test in tests/test_safety.py.
Pricing
Tier
Monthly
Databases
Credentials
Queries / month
Notes
InjectShield
free
—
—
—
prompt-injection funnel, separate site
Starter
$500
3
25
1,000,000
Pro
$1,500
10
100
10,000,000
audit export
Enterprise
$3,500
unlimited
unlimited
unlimited
SSO, SIEM webhook
QueryShield tiers are one Stripe customer. InjectShield sign-up stays on injectshield.dev until that billing is folded in. Targets $32.5K MRR @ 15 customers (10 Pro + 5 Enterprise).
Deploy
The repo is Railway-ready. python -m queryshield.start is the entrypoint
(reads PORT via os.getenv, since Railway exec's the start command without
a shell). Provision Postgres + (optionally) Redis from Railway's marketplace
and the rest is env vars.
railway up
/health is the liveness check. /ready returns 503 if the control-plane
DB is unreachable.
Tests
pip install pytest
python -m pytest tests/
102 tests cover the original safety, RLS, proxy, and HTTP suites plus the credential vault (encryption, qs_ key hashing, permission checks, budgets, tenant isolation, and the column migration for existing databases) and fail-closed VAULT_KEY / SESSION_KEY checks. The original cases:
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Fragen
Wie installiere ich Queryshield?
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
Benötigt Queryshield einen API-Schlüssel?
Der Herausgeber nennt diese Umgebungsvariablen: QUERYSHIELD_API_KEY, QUERYSHIELD_BASE_URL.
Welchen Transport verwendet Queryshield?
Queryshield läuft lokal über stdio.
Wann wurde Queryshield zuletzt geprüft?
Zuletzt geprüft: 2026-11-09. Secure SQL proxy for AI agents — NL→SQL, AST safety, per-agent RLS, audit log.