Repository navigation
Done
Description
What is missing today
- Approval stops at the agent boundary. A tool registered with
.RequireApproval()asks the user in an AG-UI chat run when it is on the assistant's own profile. Inside an agent (a profile of type Agent withAllowToolInvocation) the same tool runs without asking.AgentProxyTool.RunWithToolsAsyncbuilds a new orchestration context for the agent and reads only text from its stream,AICompletionContextKeys.ToolApprovalSupportedis set only for the top-level turn, andDefaultToolMaterializerwraps a tool for approval only when it is set. - A registration does not say what a tool does.
AIToolDefinitionEntryknowsRequiresApprovaland nothing else, so a host cannot tell from data which tools read, write, delete, send something outside the application or change access.ExposeAllToolsof the MCP server and of WebMCP hands out every selectable tool, the deleting ones included. - A tool cannot be renamed. Tool names are stored on profiles, templates and chat interactions, in the
Toolslists of the MCP server and WebMCP settings, and in what hosts derive from them (a permission for each tool). After a rename a stored name finds no tool.
Why it matters
A site assistant with several hundred tools has to group them into agents, because one profile cannot carry them (the orchestrator trims a tool list above 30 entries). Today that grouping removes every approval: a tool that deletes runs unasked as soon as it sits inside an agent. This came out of the AI tool coverage plan for CrestApps.OrchardCore (CrestApps/CrestApps.OrchardCore#1334), which lists it as the framework work that has to land before tools are grouped into agents.
What the change does
- Approval inside agents. The agent's run inherits whether its caller can ask. A tool call that needs approval pauses the agent, the assistant's run ends with an interrupt that names the agent, the tool and its arguments, approve continues the agent where it stopped, and reject gives the agent a refusal it can report. Nothing the agent did before the pause is done again. When nobody can be asked, the tool does not run inside an agent and the agent is told why.
- Kind.
Read,Write,Destructive,External,Securityon the registration. Destructive, External and Security imply approval;.RequireApproval()stays for exceptions.ExposeAllToolsleaves Destructive and Security tools out unless they are named. - Aliases.
.WithAlias("oldName"). A stored old name resolves to the tool wherever names are resolved; listings show the tool once.
Existing registrations and stored data keep working.
Metadata
Metadata
Assignees
Labels
No labels
Activity