Rules are created and managed in the console at app.subnomic.com.
Create a rule
- Go to Guardrails → New rule.
- Give it a name and a regex pattern (matched case-insensitively against the statement).
- Choose an action and severity, and a priority (lower = checked first).
- Save. Toggle Enabled on/off any time.
Common rules (recipes)
Copy the pattern into a new rule and pick the action. Patterns are case-insensitive, so drop
also matches DROP.
SELECTs too (e.g. require approval to read a sensitive table). RBAC's read/write
split is separate and applies first.
SQL (Postgres / MySQL)
Block dropping tables, databases or schemas outright.
Block TRUNCATE (instant, irreversible data wipe).
Block DELETE / UPDATE that has no WHERE clause (whole-table change).
Require approval before any write (DELETE / UPDATE / INSERT).
Block privilege / user-management statements.
Require approval to read a sensitive table (e.g. payments / pii) — yes, this gates SELECTs.
Discourage unbounded SELECT * (gate it behind approval).
Aggressive: require approval for any read on this target.
Redis
Block wiping the whole keyspace.
Gate admin / expensive commands (CONFIG, SHUTDOWN, KEYS *).
Mongo
Block destructive Mongo commands (the query is a JSON command document).
Allow exceptions
Because the first matching rule wins, put a narrow allow rule at a lower priority (checked first) to carve an exception out of a broader deny:
# priority 10 — allow deletes on the scratch table pattern: \bdelete\s+from\s+scratch\b action: allow # priority 100 — deny every other delete pattern: \bdelete\b action: deny
\b marks a word boundary so \bdrop\b doesn't match "dropdown";
\s+ matches any whitespace; ^ anchors to the start (handy for Redis commands).
Patterns match the raw statement text, so they are a safety net, not a SQL parser — keep them simple and
layer deny + require_approval.
What happens
- deny — the query is blocked, recorded, and a critical system log is written.
- require_approval — the query is blocked unless the user holds an active just-in-time grant for that target (see Access requests). The console shows a "Request access" button.
Guardrails currently apply to the database console — the enforcement seam the rest of the control plane builds on.