Skip to main content

HaltSQL documentation

HaltSQL is a policy firewall for LLM-generated PostgreSQL. It checks whether an exact SQL string is allowed for a caller under a declarative policy, and returns a verdict with machine-readable reasons. It never rewrites SQL and never connects to the database.

These docs describe version 0.0.1 (pre-1.0). The verdict format and reason codes are stable; other interfaces may still change. See Versioning and upgrades.

Start here​

If you want toRead
See a denied query in five minutesQuickstart
Give Claude Desktop, Cursor or another MCP client safe Postgres accessReplace server-postgres, then Secure an MCP agent
Protect an agent you are building in Python, TypeScript, Go or JavaIntegrations
Understand the design before you evaluate itArchitecture and Threat model
Get answers to common evaluation questionsFAQ

Guides by role​

Application and agent developers​

Platform and SRE teams​

Security and compliance reviewers​

Data governance teams​

Integrations​

AreaCovered
MCP clientsClaude Desktop, Claude Code, Cursor, VS Code and any MCP client
Agent frameworksLangChain, LangGraph, OpenAI Agents SDK, Google ADK, LlamaIndex, CrewAI, Semantic Kernel, Vanna
SDKsPython, TypeScript, Go, Java, plus the HTTP API for any language
Data catalogsdbt, DataHub, Unity Catalog, Atlan, Collibra, OpenMetadata
Identity providersKeycloak, Microsoft Entra ID, Okta, Auth0 and any OIDC provider
Secrets managersHashiCorp Vault, AWS Secrets Manager, Google Secret Manager
Audit and observabilityS3, GCS, Kafka, Elasticsearch, OpenSearch, OpenTelemetry, Prometheus
Wire proxyAny PostgreSQL driver: psql, JDBC, pgx, psycopg and others

Features​

How it works​

Explainers with diagrams, from the big picture down to the code:

Reference​

Document kinds at a glance​

Everything HaltSQL reads is YAML or JSON with apiVersion: haltsql.dev/v1 and a kind:

KindPurposeReference
PolicyWhat SQL is allowedpolicy-reference.md
ConfigHow the CLI and server runconfig-reference.md
TestSuiteAllow/deny test cases for a policytesting.md
CatalogSchema snapshot (tables and column types)policy-reference.md
ScenarioEnterprise lab scenariotesting.md
ProxyConfigHow haltsql-proxy runsproxy.md
PolicyBundleSigned set of policies (canonical JSON + .sig)policy-bundles.md

haltsql validate FILE... checks Policy, Config, TestSuite, Catalog and Scenario documents; haltsql-proxy validate --config FILE checks a ProxyConfig, and haltsql bundle verify checks a PolicyBundle. haltsql schema export writes JSON Schemas for editor autocomplete.

Project​