Skip to content

Commit 4d85821

Browse files
Durakclaude
andcommitted
oraclemcp P1-1: fail-closed engine-aware statement classifier (SAFETY-CRITICAL)
Beads oracle-qmwz.2.1 + .2.1.1..6 (P1-1 / a-f). Replaces the fail-OPEN is_read_only_sql string predicate with a staged, fail-CLOSED classifier in oraclemcp-guard (plan §5.3). - Stage A (P1-1a): allow-list (SHA-256 normalized) -> block-list (regex) -> PL/SQL-block + side-effect-marker detector. - Stage B (P1-1b): sqlparser OracleDialect -> DangerLevel + required OperatingLevel; no-WHERE DELETE/UPDATE -> Destructive; EXPLAIN -> Guarded. - Lexer splitter (P1-1c): the Oracle tokenizer makes '..'/q'[..]'/N'..'/".." single tokens, so embedded ;/BEGIN/END can't desync the counter (closes the q'{..END;..}' fail-open); a BEGIN/END desync makes the whole batch Forbidden. - SideEffectOracle port (P1-1d): in the engine-free guard, default Unknown (fail-closed); the engine binds the real impl from the consumer side. - Purity verdict (P1-1e): ProvenReadOnly is the ONLY clear-to-Safe; a UDF in a SELECT consults the port (default Unknown -> Guarded, R15); statement_purity is the trigger/VPD-walk seam. - GuardDecision.gate(session) wires classify -> the P0-7 level gate (P1-1f). - 33 guard tests incl SELECT billing.purge_old_rows() -> Guarded (not Safe). clippy -D warnings + fmt clean. Adversarial corpus + fuzz -> T-CORPUS (6.2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fbf367e commit 4d85821

6 files changed

Lines changed: 1030 additions & 8 deletions

File tree

.beads/issues.jsonl

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/oraclemcp-guard/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ oraclemcp-audit = { path = "../oraclemcp-audit" }
1313
serde.workspace = true
1414
serde_json.workspace = true
1515
sha2.workspace = true
16+
sqlparser = "0.62"
17+
regex = "1"
1618
thiserror.workspace = true
1719

1820
[lints]

0 commit comments

Comments
 (0)