feat: add tool-scoping for fork-mode skills#3260
Merged
Merged
Conversation
…rtable A readonly agent could previously gain mutating tools via a fork skill's assistive toolset; forkSkillToolSets now applies toolset.ReadOnly || a.ReadOnly. Each toolset is also wrapped in tools.NewStartable for lazy single-flight start semantics, since skillSubSessionTools calls Start() on every run-loop iteration. Assisted-By: Claude
aheritier
approved these changes
Jun 26, 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.
Fork-mode skills run in an isolated sub-session, but until now they inherited every tool available to the parent agent with no way to restrict or augment that set. This made it impossible to write a skill that only needs a small, safe subset of tools, or one that requires a dedicated toolset not part of the main agent's config.
Two new fields address this.
allowed_tools(frontmatter keyallowed-toolsinSKILL.mdfiles) is an allow-list of glob or exact patterns applied to the parent agent's inherited tools — the Claude Code-compatible field was previously parsed but never enforced; it is now enforced in the fork sub-session.toolsetsis a list of top-leveltoolsetsnames that are injected into the sub-session in addition to the filtered inherited tools, bypassing the allow-list. Both fields are validated at load time: toolset references must exist in the top-level config, and both fields are rejected on non-fork skills. The agent-levelreadonlyflag is honored for assistive toolsets, and assistive toolsets are wrapped with lazy single-flight start semantics viaNewStartable.Both fields work for inline skills defined in YAML and for file-based skills loaded from
SKILL.mdfrontmatter. An example demonstrating the feature is inexamples/skills_fork_toolsets.yaml, and the skills documentation indocs/features/skills/index.mdhas been updated accordingly.