Improve sandboxing, MCP errors, and cached approvals (#41196)

Expand Windows deny-read globs robustly across protected directories while preserving filesystem enforcement. Preserve structured MCP tool and resource errors through app-server responses. Bind cached Guardian classifications to current local and root authorization state so stale scores cannot approve actions.

Add regression coverage for the sandbox resolver, structured protocol errors, and authorization changes.

GitOrigin-RevId: 4b80ed724d869afeca79204222d8465fa99d3a24
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-27 20:05:08 +00:00
1 parent 0182ff3480
commit 035295b46e
18 files changed
+1285 -81

No files matched your search

+2
View File
@@ -20,6 +20,7 @@ mod perform_oauth_login;
mod program_resolver;
mod protocol_mode;
mod rmcp_client;
mod service_error;
mod startup_error;
mod stdio_server_launcher;
mod utils;
@@ -72,6 +73,7 @@ pub use rmcp_client::RmcpClient;
pub use rmcp_client::SendElicitation;
pub use rmcp_client::StreamableHttpBearerToken;
pub use rmcp_client::ToolWithConnectorId;
pub use service_error::mcp_error;
pub use startup_error::is_authentication_required_error;
pub use stdio_server_launcher::ExecutorStdioServerLauncher;
pub use stdio_server_launcher::LocalStdioServerLauncher;
+15
View File
@@ -0,0 +1,15 @@
//! Access structured MCP errors without dropping their original protocol data.
use anyhow::Error;
use rmcp::ErrorData;
use rmcp::service::ServiceError;
use crate::rmcp_client::ClientOperationError;
/// Returns the server's structured protocol error, including its original data.
pub fn mcp_error(error: &Error) -> Option<&ErrorData> {
let ClientOperationError::Service(ServiceError::McpError(error)) = error.downcast_ref()? else {
return None;
};
Some(error)
}