Repository navigation
fix(macos): hold Read-Only Safe Mode at the server, bound MCP and assistant answers, narrow the assistant's tools and refuse MCP file access - #4219
Merged
Conversation
…istant answers, narrow the assistant's tools and refuse MCP file access
…ne's read-only mode and bound the error redactor
datlechin
enabled auto-merge (squash)
November 12, 2026 05:27
# Conflicts: # apple/Plugins/PostgreSQLDriverTests/LibPQScriptedServer.swift
# Conflicts: # apple/TablePro/Core/AI/CLI/AgentCLIProcess.swift # apple/TablePro/Core/Coordinators/QueryExecutionCoordinator+Parameters.swift # apple/TablePro/Core/Database/Access/DatabaseAccessBridge+Scripts.swift # apple/TablePro/Core/LSP/LSPTransport.swift # apple/TablePro/Core/Process/PipeReader.swift # apple/TablePro/Models/AI/AgentSession.swift # apple/TablePro/ViewModels/AIChatViewModel+Persistence.swift # apple/TablePro/ViewModels/AIChatViewModel.swift # apple/TablePro/Views/Main/Extensions/MainContentCoordinator+Explain.swift # apple/TablePro/Views/Main/MainContentCoordinator.swift # apple/TableProTests/Core/AI/AgentCLIProcessTests.swift
# Conflicts: # apple/Plugins/MySQLDriverPlugin/MySQLPluginDriver.swift # apple/Plugins/TableProPluginKit/PluginStatementContext.swift # apple/TablePro/Core/ObjectCopy/ObjectCopyRunner.swift
# Conflicts: # apple/Plugins/SQLiteDriverPlugin/SQLitePlugin.swift # apple/TablePro/Core/Compare/CompareRowService.swift
# Conflicts: # apple/TablePro/Core/AI/ClaudeAgent/ClaudeAgentMCPBridge.swift # apple/TablePro/Core/AI/ClaudeAgent/ClaudeAgentProvider.swift # apple/TablePro/Core/MCP/MCPTokenStore.swift # apple/TableProTests/Core/AI/ClaudeAgentConnectionScopeTests.swift
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
Audit 2026-11-12, lane ai-security. Every MCP and AI change narrows what a client or the assistant can do; none widens it.
search_query_history,list_recent_tabsandfocus_query_tabwithoutconnection_idcover only already-approved connections;focus_query_tabasks about the tab's connection; a call that names one asks once.initializeadvertises resources, prompts and completions only withresources:read.list_connectionsreturns only the conversation's connection.notessays why. PostgreSQL, MySQL, SQLite, DuckDB and ClickHouse stop reading at the byte limit; SQL Server and ClickHouse stop at the row cap.data.outcome: "unknown".PluginStatementContext.enforcesReadOnlyandresultByteLimit,PluginCapabilities.enforcesReadOnlyMode,executeBoundedQuery(query:rowCap:context:).explain_querylands in history.Tests changed on purpose:
ProtectedWriteDeadlineTests.inDriverAtCancelFinishes,LibPQReadOnlyTransactionTests.wrapsOnlyExternalAndSafeModeReads,LibPQBoundedReadOnlyTests(drainsWhereNoCancelIsTakenreplaced),ReadOnlySafeModeEntryPointTests.plainBrowseCarriesTheMode,WritePolicyMatrix(focus_query_tab), MySQLwrapsOnlyEnforcingFlavors,capabilityFollowsFlavor,refusalIsReported,declaresReadOnlyStatements.Docs: TableProApp/docs#210
Needs the maintainer
Left open
executeBatchis decoded whole, and its single statements stop at the row cap but not at bytes; Snowflake, Oracle and drivers on the PluginKit default read the whole result.Test plan
ConnectionFormPortTLSTests,ResultRowsBuildOffMainTests,SessionRecoveryLoopTests).package TableProCore(grammar, PluginKit),core tablepro-core,core tablepro-mcp, clippy and rustfmt on both crates,plugins,abi.apple/scripts/probes/check-postgresql-read-only-functions.sh.