Pure policy for the Tier 2 execute tools (BOU-102): read-only SQL classification, row-limit clamping, and migration-direction validation.
No I/O and no throwing — the shell executors (boundary.mcp.shell.tools) call these to decide, then run the side effect and enforce the decision. These are defense-in-depth: the real guards are the security gate (only :full context reaches Tier 2) and, for query-db, a read-only database role. The SQL classifier is a coarse keyword check, not a parser; it can be fooled by a write keyword used as an identifier, which is why the read-only role is the primary control.
Pure policy for the Tier 2 execute tools (BOU-102): read-only SQL classification, row-limit clamping, and migration-direction validation. No I/O and no throwing — the shell executors (boundary.mcp.shell.tools) call these to decide, then run the side effect and enforce the decision. These are defense-in-depth: the real guards are the security gate (only :full context reaches Tier 2) and, for query-db, a read-only database role. The SQL classifier is a coarse keyword check, not a parser; it can be fooled by a write keyword used as an identifier, which is why the read-only role is the primary control.
(clamp-limit requested)Clamp a requested row limit into [1, max-row-limit]; nil/non-numeric falls back to default-row-limit.
Clamp a requested row limit into [1, max-row-limit]; nil/non-numeric falls back to default-row-limit.
Rows returned when the caller gives no limit.
Rows returned when the caller gives no limit.
Hard ceiling on rows returned, regardless of the requested limit.
Hard ceiling on rows returned, regardless of the requested limit.
Migration actions the tool exposes. Deliberately conservative: up applies
pending migrations, status reports state. Destructive rollbacks are not
exposed through the MCP surface.
Migration actions the tool exposes. Deliberately conservative: `up` applies pending migrations, `status` reports state. Destructive rollbacks are not exposed through the MCP surface.
(read-only-sql? sql)True when sql is a single read-only statement.
True when `sql` is a single read-only statement.
(sql-violation sql)Why sql is not an acceptable read-only single statement, or nil if it is.
Reasons: :empty | :multiple-statements | :not-read-only.
Why `sql` is not an acceptable read-only single statement, or nil if it is. Reasons: :empty | :multiple-statements | :not-read-only.
(valid-direction? direction)True when direction is a supported migration action.
True when `direction` is a supported migration action.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |