Expand description
The SqlQueryGuard implementation.
The guard listens for ToolAction::DatabaseQuery { database, query } via
chio_guards::extract_action and enforces four knobs defined by
SqlGuardConfig: operation allowlist, table allowlist, per-table
column allowlist, and regex predicate denylist. Failures route through
SqlGuardDenyReason so downstream
callers can match on structured reasons.
Fail-closed semantics:
- parse errors deny (even when
allow_allis set); - empty configurations deny unless
allow_allis set; - any check that fails short-circuits to
Verdict::Deny; - the guard passes non-
DatabaseQueryactions through withVerdict::Allow(guards are additive).
Structsยง
- SqlQuery
Guard - Built-in SQL query guard (roadmap phase 7.1).