AegisQuery treats the query as a structure to be validated rather than a string to be filtered. Every request passes an ordered nine-stage pipeline before a single row is returned: parse to an abstract syntax tree, enforce a single read-only statement, extract references, check them against a deny-by-default allowlist, mask personally identifiable columns, inject row-level policy predicates by rewriting the tree, estimate cost against the planner, execute on a read-only connection, truncate to a token budget, and write a structured audit record.
Structural validation is what actually closes the injection. Multiple statements parse to an array, and an array is rejected before anything reaches the database. The read-only connection stays in place behind it as defence in depth, so a parser gap still cannot mutate data.
The tools are workflow-shaped rather than endpoint mirrors. Curated metrics are preferred over model-authored SQL, and a cost-preview tool validates and prices a query without executing it, so an agent can find out that a query is too expensive without paying for the discovery.