How do I gate Pydantic AI Agent tool use on a direct Montage read?
Attaching a toolset is not the same as proving an authorized account can execute it. Add a review stage before Agent execution that validates only status and leaves retained-workspace writes unavailable until the user has made a separate, specific approval decision. Readiness should require real execution through the intended user’s active client. A successful attachment to Agent toolsets proves an interface decision, not approved access to every advertised operation or permission for model-selected research writes.
Help me gate Pydantic AI Agent tool use on a direct Montage read. Ask whether the intended user can read Montage status through the configured client. Report real status or the exact blocking condition and leave broader tool use pending. No writes.Name the readiness question
Ask whether the intended user can read Montage status through the configured client. Do not combine this preliminary question with a full research objective or an Agent prompt that chooses tools freely. The readiness contract should require actual account-scoped execution, not merely successful toolset attachment or an Agent that can print the expected tool names.
Inspect exposed definitions
Review the discovered status tool and the toolset that would later be attached through Agent toolsets. Avoid assuming the entire advertised remote surface should become immediately available for model selection. Inspecting the status definition before attachment helps identify the intended preliminary operation without assuming every advertised remote effect belongs in the initial toolset.
Keep application control explicit
Separate the decision to expose tools from approval to mutate workspace records. The current MCPToolset wrapper carries an interface, not an independent grant of permission for its possible effects. The application can defer broad tool exposure while still reviewing a status-only diagnostic; this does not require asking a model to decide its own permissions.
Execute without an Agent run
Use the authorized underlying client for signals_status within its async lifetime. No model inference is needed to distinguish successful workspace access from mere metadata discovery. A direct client result avoids paid inference and separates server evidence from an Agent’s narrative about what it expects the workspace to contain.
Return a bounded readiness result
Report real status or the exact blocking condition and leave broader tool use pending. Passing the read gate does not authorize saved research changes or certify every future Agent-selected operation. A later research task should name its own permitted effects, because passing a status gate does not approve every callable surfaced through MCPToolset.
Keep the boundaries clear.
- The application can defer broad tool exposure while still reviewing a status-only diagnostic; this does not require asking a model to decide its own permissions.
- A later research task should name its own permitted effects, because passing a status gate does not approve every callable surfaced through MCPToolset.
Start with a read-only check: ask your agent to report actual source coverage before collecting records or exporting an audience.
Primary references
Documentation reviewed 2026-11-15. Product capabilities, client availability and plans can change. Third-party marks identify their products, not an affiliation.