Repository navigation
test(mcp): run every MCP and Agent mode write against every connection policy - #3704
Merged
Merged
Conversation
…n policy create_database, run_maintenance and stop_server_session now ask at Safe Mode Silent too, as developers/mcp-tools.mdx documents.
datlechin
enabled auto-merge (squash)
October 20, 2026 16:05
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
apple/TableProTests/Core/WritePolicy/runs every write path against every policy and checks one expected-outcome table: refused, or runs after a given list of prompts.tools:writetool, plusexecute_query,explain_query(analyze) andexport_data(query), each throughtools/callwith a saved connection and a recording driver. Cells: token tier x External Clients x AI policy x the six Safe Mode levels.execute_query,confirm_destructive_operationand an outside MCP server tool, as a full turn (AI policy, card, tool, Safe Mode). Cells: AI policy x Safe Mode x External Clients x Always Allow.tools:writetool, a tool taking a SQLquery, or a writing chat tool has no row.MCPAuthPolicytakes its execution gate by injection, so a test can state the Safe Mode level and answer its dialogs.create_database,run_maintenanceandstop_server_sessionran at Safe Mode Silent with no prompt for a client that does not elicit.developers/mcp-tools.mdxsays each asks the user whatever Safe Mode says. Forced consent now also asks the Safe Mode dialog (.confirmsWrites). Nothing is widened: an admin token's elicited answer still stands in for the dialog, as documented.Test plan
GlobalStateSuites/MCPWritePolicyMatrixTestsfails forstop_server_sessionat Silent: no prompt, and a declined run still sendsSELECT pg_cancel_backend(4242). Passes here.verify.sh test: both matrix suites plus MCPAuthPolicyTests, MCPStatementGate*, MCPStatementConsentGuardTests, MCPToolConsentTests, ExecuteQueryToolTests, MCPScriptResultTests, ChatToolTargetTests, ExecutionGateTests, ToolsCallHandlerTests, ConfirmDestructiveOperationToolTests, MCPToolRegistryGuardTests, MCPConnectionApprovalTests, MCPEnumeratedArgumentTests, InsertRowsToolTests, FocusQueryTab*: PASS.verify.sh lint: PASS.Fixes #3663