Repository navigation
sqlguardllm 0.5.0a1
Pre-release
Pre-release
Everything that was planned for other languages and tooling: an HTTP server, official Node.js and .NET clients checked against the same 148-case corpus, a documentation site and a browser playground, plus Policy.from_database, a cost guard for the MCP server and the rest of the warehouse denylists.
Added
- In-browser playground "Try to break it" in
playground/(static site, Pyodide, demo SQLite, gallery presets, two roles, editable policy, shareable URL-fragment links, English/Spanish) with a Playwright test and CI workflow. Not deployed yet (#18). - Documentation site (mkdocs-material, https://jmmana.github.io/sqlguardllm/): quickstart in English and Spanish, rules, a policy reference generated from
schema/policy.schema.json, an API reference from docstrings, threat model, attack gallery and integrations; built with--strictand link-checked on every pull request, deployed to GitHub Pages from main (#14). - Optional cost guard for
sqlguardllm mcp(--max-cost,--max-plan-rows;max_cost/max_plan_rowsincreate_server): runsEXPLAIN(JSON, neverANALYZE) on PostgreSQL and MySQL before a query and refuses plans over the threshold, failing closed if the estimate can't be read; ignored with a warning on other engines.explain_queryreports the estimate (#33). - Cross-language conformance: every attack-corpus case runs through the HTTP server, the Node.js client and the .NET client and must equal the in-process
Guard.checkanswer (conformance/cases.json, aConformanceworkflow,docs/CONFORMANCE.md). The .NET client now sends aContent-Lengthbody, which the server requires (#37). sqlguardllm serve: an HTTP server (GET /v1/health,POST /v1/check,POST /v1/explain) so any language can use the engine as a sidecar, standard library only, optional bearer token, plus aDockerfile; install withsqlguardllm[serve]. Seedocs/SERVER.md(#34).- Official .NET client
SqlGuardLlm(clients/dotnet/, NuGet):CheckAsync,EnforceAsync,ExplainAsyncandHealthAsyncagainstsqlguardllm serve, multi-targeting net8.0 and net10.0, with no dependencies and fail-closed errors. Not published yet (#36). - Official Node.js/TypeScript client in
clients/node(sqlguardllmon npm, not yet published):SqlGuardwithcheck,enforce,explain,healthandwrapfor thesqlguardllm serveHTTP API; zero runtime dependencies, ESM + CJS, fails closed on network errors, timeouts and malformed responses (#35). Policy.from_database(url, include=…, exclude=…, schemas=…, **options): fillstablesandschemaby reading a live database with the SQLAlchemy inspector (new optional extrasqlguardllm[db]). Only names are read, never rows; errors never include the URL (#28).- Denied functions for Snowflake, BigQuery, ClickHouse and Trino, each list linked to the vendor documentation, with a corpus case for every entry (#16). Contributed by @shiwng in #42.
- Integration recipes in
docs/RECIPES.mdwith runnable code inexamples/: a generic DB-API wrapper, SQLAlchemy, LangChain (create_agenttool and langchain-community's toolkit), LlamaIndex, Vanna 2.0 and a pointer to the MCP server. Each is tested with fake model output on SQLite; a Recipes workflow runs them against the framework versions they target. No framework is a dependency (#17). - Performance budget:
benchmarks/bench_check.pytimesGuard.check()on 21 representative queries (median and p95), and a Benchmark workflow fails when a typical query's median is over budget (2 ms on a laptop, 4 ms on GitHub's slower shared runner, where five joins take 3.2–3.4 ms) or a pull request makes a query more than 25 % slower than its base branch (#19).