Repository navigation
Done
Description
Objective
Tell operators and models more than allow or deny: how wasteful a legitimate query is, what the database plans to do with it, what a policy change would change, which kinds of personal data a query returns, and exactly what the guard did to a result.
Principles
- The decision stays deterministic and AST-based (sqlglot). No LLM in the decision path, fail closed (same as EPIC — Agent safety beyond read-only #165 and EPIC — Growth: guard what people already run #214).
- Everything new is opt-in and ships as experimental in 1.x (STABILITY). Existing outputs only gain fields.
- No context values, production literals or sampled data in any new report.
- New fields reach
Guard.explain(), HTTP/v1/explain, the engine stdio protocol and the Node.js and .NET clients, covered by conformance (Cross-language conformance: the corpus through every client #37).
Where we start (main @ 74c7b88)
| Area | Already on main | Gap this epic closes |
|---|---|---|
| Query quality | Opt-in complexity limits refuse (max_joins, max_subquery_depth, forbid_cartesian), required_filters |
No signal for allowed but wasteful queries |
| Plan checks | Cost guard in sqlguardllm mcp for PostgreSQL and MySQL (#33) |
Library API, SQL Server, DuckDB, SQLite, full scans, warn mode |
| Policy changes | sqlguardllm shadow counts (#222), test (#66), lint (#67) |
Per-case diff and a CI gate |
| Personal data | Hidden and masked columns enforced through aliases, functions, casts and subqueries | Classification by data class, classify |
| MCP results | readOnlyHint and the other annotations, limit_reached, fix hints (#217) |
Rewrite and truncation fields, output schemas, proxy annotations |
Children
- FEAT-012 — Query advice: stable findings and a 1–100 score for allowed but wasteful queries #291 FEAT-012 (closed: Query advice: findings and a 1-100 score for allowed but wasteful queries (#291, first slice) #306, Advice per table, and advice/data_classes in the Node.js and .NET clients (#291, #294) #313) — Query advice: stable findings and a 1–100 score
- FEAT-013 — Plan checks: library API, SQL Server, DuckDB, SQLite and full-scan rules #292 FEAT-013 (closed: Plan checks: PlanGuard, five engines, full-scan rule and warn mode (#292) #319) — Plan checks: library API, SQL Server, DuckDB, SQLite and full-scan rules
- FEAT-014 — sqlguardllm diff: per-case policy changes and a CI gate #293 FEAT-014 (closed: sqlguardllm diff: per-case policy changes and a CI gate (#293) #310, Run the policy-diff example in CI and write its report to the job summary (#293) #312) —
sqlguardllm diff: per-case policy changes and a CI gate - FEAT-015 — Sensitive data classes: classify columns once, enforce by class #294 FEAT-015 (closed: Sensitive data classes and sqlguardllm classify (#294, first slice) #309, Advice per table, and advice/data_classes in the Node.js and .NET clients (#291, #294) #313, Finish #294: value sampling, validators, Spanish names, corpus, roles, threat model #315, Test classify on the demo database (#294) #317, Threat model in Spanish (#294) #318) — Sensitive data classes: classify columns once, enforce by class
- FEAT-016 — MCP results that say what the guard did: rewrites, exact truncation, output schemas #295 FEAT-016 (closed: MCP results that say what the guard did: exact truncation, status, rewrites (#295) #307, Close the open parts of #295: PostgreSQL, cost guard, refusal text, stdio, accuracy, Spanish #311) — MCP results that say what the guard did
No child blocks another. #295 and #293 show the #291 score when it is enabled, and #295 shows #292 warnings. Recommended order: #291 → #295 → #294 → #293 → #292.
Bugs found while planning (fix first, size S)
- MCP: explain_query description promises the rewritten SQL, which it never returns #296 MCP:
explain_querydescription promises the rewritten SQL, which it never returns - Docs: shipped features still marked unreleased or missing after 1.0.0 #297 Docs: shipped features still marked unreleased or missing after 1.0.0
Activity