Repository navigation
Done
Labels
area:coreParsing, rules and the Guard APIlang:pythonPython package and the enginep1Prioridad 1: altasize:l3-5 daystype:featureNew capability
Description
Goal
Let data teams publish approved, read-only business queries for MCP agents. A generated query can pass policy checks and still calculate the wrong metric, such as gross sales in place of net sales. A reviewed query gives the team one definition to maintain, test and audit.
First release
- Git-managed YAML or JSON catalog with a version, stable query IDs, descriptions, PostgreSQL SQL templates, typed parameters and allowed roles.
- Opt-in MCP discovery and execution tools. Discovery lists the query IDs, descriptions and parameter schemas available to the authenticated role. Execution accepts a query ID and typed values. The server owns the template.
- Use bound parameters and the existing policy, trusted tenant context, read-only connection, timeout, row limits and configured masks. Catalog approval grants no extra privileges. Audit the query ID, catalog version and decision while excluding parameter values and rows.
- Start with three runnable PostgreSQL examples, including net sales by month. Preserve the existing MCP
querycontract.
Acceptance criteria
- Reject invalid catalog definitions and duplicate IDs at startup. Refuse invalid, missing or extra parameters before execution.
- PostgreSQL integration tests show that an allowed role receives the correct result, unauthorized roles cannot discover or invoke the query, and tenants receive only their authorized rows.
- Tests verify configured masks and row limits and check that catalog audit events omit parameter values and rows.
- CI validates expected business results on fixture data and detects a changed metric definition.
- English and Spanish docs include setup, an example catalog and the commands to run the fixtures.
References
Snowflake verified queries · Databricks Genie trusted assets
Likely entry points are src/sqlguardllm/mcp_server.py, policy_set.py, audit.py and tests/engines/. This complements #217, which measures remediation hints for generated SQL.
Size estimate: L.
Metadata
Metadata
Assignees
Labels
area:coreParsing, rules and the Guard APIlang:pythonPython package and the enginep1Prioridad 1: altasize:l3-5 daystype:featureNew capability
Activity
Add verified queries: a catalog of approved queries an agent runs by …