Expand description
Skill-scoped tool filtering — hard enforcement of allowed_tools.
Skill-scoped tool filtering.
When a skill with allowed_tools is activated, only those tools
(plus meta-tools like ActivateSkill, ListSkills, ListAgents,
InvokeAgent) are sent to the LLM. This is the “hard enforcement”
counterpart to the prompt hint in activate_skill().
§How it works
- The inference loop creates a
SkillToolScope(initially empty). - After each tool dispatch round, if an
ActivateSkillcall was made, the loop callsupdate_from_tool_calls()with the tool call names and args. SkillToolScopeinspects the skill registry to check if the activated skill hasallowed_tools.- On the next iteration,
filter_tool_defs()returns only the in-scope tools.
§Meta-tools
These tools are always available regardless of scope, so the model can switch skills, delegate, ask the user for help, or manage its own background work even when scoped to a restricted tool set:
ActivateSkill,ListSkillsListAgents,InvokeAgentAskUserListBackgroundTasks,CancelTask,WaitTask(#996 Phase G)
§Lifecycle
- Activating a skill with
allowed_tools→ scope is set - Activating a skill without
allowed_tools→ scope is cleared - No
ActivateSkillcall → scope unchanged
Structs§
- Skill
Tool Scope - Tracks the active skill’s tool scope during an inference loop.