Conversation
…ors, OAP authorization (#2479, #2406) Implements three missing MCP production primitives (arXiv:2603.13417) and OAP declarative pre-action authorization (arXiv:2603.20953). MCP primitives (#2479): - Add McpErrorCode enum (Transient/RateLimited/InvalidInput/AuthFailure/ ServerError/NotFound/PolicyBlocked) with is_retryable(); McpError::code() maps all variants including SsrfBlocked/CommandNotAllowed/EnvVarBlocked (PolicyBlocked), InvalidUrl/ToolListLocked (InvalidInput), Embedding (ServerError) - Add caller_id: Option<String> to ToolCall and AuditEntry for identity propagation - Add max_tool_calls_per_session: Option<u32> to [tools] config; counter in ToolOrchestrator incremented once per logical batch (not per retry) OAP authorization (#2406): - Add [tools.authorization] config section (AuthorizationConfig) with enabled flag and per-tool allow/deny rules; capabilities: Vec<String> field present, matching deferred (M4) - Authorization rules appended after policy.rules at startup in runner.rs (policy takes precedence, documented) - PolicyGateExecutor::execute()/execute_confirmed() return Err(ToolError::Blocked) when policy is enabled — no silent passthrough - Add policy_match: Option<String> to AuditEntry, populated from PolicyDecision::trace on allow and deny branches
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
Implements three missing MCP production primitives (arXiv:2603.13417, #2479) and OAP declarative pre-action authorization (arXiv:2603.20953, #2406).
MCP primitives (#2479)
McpErrorCodeenum (Transient/RateLimited/InvalidInput/AuthFailure/ServerError/NotFound/PolicyBlocked) withis_retryable();McpError::code()covers all variants including security variants (SsrfBlocked/CommandNotAllowed/EnvVarBlocked→PolicyBlocked)caller_id: Option<String>added toToolCallandAuditEntry; channel provides identity when availablemax_tool_calls_per_session: Option<u32>in[tools]config;ToolOrchestratorcounter incremented once per logical batch (not per retry)OAP authorization (#2406)
[tools.authorization]config:AuthorizationConfigwithenabledflag and per-tool allow/deny rules;capabilities: Vec<String>field present (matching deferred per MVP scope)policy.rulesat startup (policy takes precedence);PolicyGateExecutor::execute()/execute_confirmed()returnErr(ToolError::Blocked)when policy enabled — no silent passthroughpolicy_match: Option<String>inAuditEntry, populated fromPolicyDecision::traceon both allow and deny branchesTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— 0 warningscargo nextest run --workspace --lib --bins— 7663/7663 PASS (4 new tests forcheck_quota())[tools.authorization]config parses correctly intesting.tomlmax_tool_calls_per_sessionexceededpolicy_matchappears in audit log when authorization rule firesCloses #2479
Closes #2406