Repository navigation
feat(agent-vault): read allowedTools on a session's MCP servers - #71
Merged
Merged
Conversation
An MCP server sent with a session can now be limited to some of its tools (Infisical/infisical#9418). AgentVaultInlineService keeps allowedTools, which from_dict used to drop as an unknown field, and the sessions.create docs say how to send it instead of saying inline MCP servers can't be limited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
💬 Discussion in Slack: #pr-review-python-sdk-official-71-feat-agent-vault-read-allowedtools-on-a-session Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
6 of 11 tasks
Contributor
[Low impact] This PR appears safe to merge.
|
saifsmailbox98
approved these changes
Nov 13, 2026
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.
Context
Infisical/infisical#9418 lets an MCP server sent with a session (
servicesonsessions.create) takeallowedTools, the same as an MCP server in an access bundle.Sending the field already works, because
servicestakes dicts with the API's field names. Reading it back didn't:AgentVaultInlineServicehad noallowedToolsfield, andBaseModel.from_dictdrops keys it doesn't know, so every session the SDK returned was missing the tool list. This change:allowedTools: Optional[List[str]]toAgentVaultInlineService. It'sNonewhen the server allows every tool, or when the Infisical version doesn't return it.sessions.createdocstring, which said an inline MCP server can't be limited to some of its tools, to say how to sendallowedTools.It's safe to release before or after the server. If a caller sends
allowedToolsto an Infisical version without #9418, that version refuses the session with a 400 that names the field. The new field defaults toNone.Steps to verify the change
allowedToolsand reads it back, both as a list and asNone.main's model, the new test fails at the read-back (created.services[0].allowedToolsisNone), which is the dropped field.tools/listshowed only the listed tool, and the proxy refused calls to the other tools.🤖 Generated with Claude Code