Repository navigation
Conversation
added 5 commits
August 11, 2026 19:28
nevlate
marked this pull request as ready for review
August 12, 2026 11:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UNKNOWNas a sticky analysis signal and fail closed withUNCLASSIFIED_SQL_BLOCKED, while reusingNUBASE_ALLOW_DANGEROUS_SQLas the explicit overrideDANGEROUS/UNKNOWNgate in the Java MCPexecuteSqlpath so direct server calls cannot bypass the CLI policyDO,EXPLAIN ANALYZE, full-tableDELETE ... RETURNING, parenthesized reads, maintenance commands, andPREPARE/EXECUTERoot cause
The previous implementation split statements on raw semicolons and classified mostly from the first keyword. That made dollar-quoted bodies unreliable, hid writes behind wrappers such as CTEs and
EXPLAIN ANALYZE, and allowedUNKNOWNstatements to disappear when multi-statement risk was folded to a single maximum severity. The Java execution path also returned a risk label without enforcing it.Behavior
DO $$ BEGIN DELETE ...; END $$->DANGEROUSEXPLAIN ANALYZE DELETE ...->DANGEROUSDELETE FROM ... RETURNING *->DANGEROUS(SELECT 1)->READSELECT ... INTO ...->SCHEMA_WRITEDROP POLICY IF EXISTS ...remainDANGEROUS; both CLI and direct MCP execution require the explicitNUBASE_ALLOW_DANGEROUS_SQL=trueoverrideValidation
git diff --checkpassedFollow-up boundary
This PR keeps static classification as the policy authority. A follow-up PR can make PostgreSQL transaction probing (
BEGIN READ ONLY/ existing dry-run rollback flow) authoritative, including the required asynchronous CLI call-chain changes.