docs + feat: sub-agent tool scoping plan and Phase 1 implementation (#4042)#4096
docs + feat: sub-agent tool scoping plan and Phase 1 implementation (#4042)#4096JayBeest wants to merge 2 commits into
Conversation
|
Thanks @JayBeest for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
|
Quick note on dependencies:
Plan: Phase 1 → watch #3969 → Phase 2 → watch MCP → Phase 3 → 🐋. |
Implements Phase 1 of the sub-agent tool scoping plan: - SpawnRequest gains disallowed_tools and inherit_disallowed_tools fields - parse_spawn_request reads them from JSON - SubAgentRuntime carries denied_tools via WorkerRuntimeProfile - SubAgentToolRegistry filters deny list in is_tool_allowed(), tools_for_model(), execute() - 23 new tests covering inheritance, wildcards, opt‑out, and execution gates Closes Hmbown#4042 (environment‑level tool sandboxing) – Phase 1 only.
ec2b44d to
95872b9
Compare
v0.8.68 triage noteThanks @JayBeest for the Phase 1 write-up and implementation work here. This is still draft and DIRTY against current The useful slice is the Phase 1 idea: parent
Not merging this branch whole. Next step is either a narrow fresh PR for Phase 1 only against current |
Implement parent --disallowed-tools inheritance into sub-agents: - SpawnRequest carries disallowed_tools + inherit_disallowed_tools (default true) - WorkerRuntimeProfile gains denied_tools with derive_child() union semantics - SubAgentToolRegistry applies deny filtering in is_tool_allowed(), tools_for_model(), and execute() — restricted tools never reach the model - Wildcard matching: exact, prefix *, case-insensitive - Fleet worker_runtime threads disallowed_tools into WorkerRuntimeProfile 22 new tests: inheritance flows down, opt-out works, two-generation inheritance, wildcards, case-insensitive, deny-wins-over-allow, catalog filtering, execution gates, background runtime propagation. Harvested from PR #4096 by @JayBeest (rebased onto current main; the original PR was dirty against main after #4262 landed). Refs #4042 Signed-off-by: Hunter B <hmbown@gmail.com> Co-authored-by: JayBeest <67948678+JayBeest@users.noreply.github.com>
|
Thanks @JayBeest — your contribution landed in
Closing this PR now that the code is on If you want to land more work and would prefer your future PRs merge cleanly without a harvest step, the |
Summary
Adds three documentation files and implements Phase 1 of the sub-agent tool
scoping plan for issue #4042:
SUBAGENT_TOOL_SCOPING_PANL.md— Phased implementation plan with evidenceSUBAGENT_TOOL_SCOPING_CODEBASE_GUIDE.md— Onboarding guide for developersSUBAGENT_TOOL_SCOPING_PHASE1_STATE.md— Implementation state and test coverage summaryPhase 1 Implementation
Implements parent
--disallowed-toolsinheritance into sub‑agents:SpawnRequest+disallowed_tools/inherit_disallowed_toolsWorkerRuntimeProfile+denied_toolswithderive_child()unionSubAgentToolRegistrydeny filtering inis_tool_allowed(),tools_for_model(),execute()*, case‑insensitive23 new tests – inheritance, wildcards, opt‑out, catalog filtering, execution gates.
All tests pass. Lint passes. CI should be green.
This is Phase 1 of the three‑phase plan. Later phases will build on this foundation.
Scope
Builds on
mainbranch architecture (v0.8.67)filter_tool_catalog_for_gates,--disallowed-tools)customrole semantics fromSUBAGENTS.mdRelated Issues
Validation
cargo fmtandcargo clippycleanFeedback Welcome
I'm learning the workflow and the codebase—happy to adjust based on maintainer feedback.
This is the first of three phases; later phases will build on this foundation.
All Fine. 🐋