xonecas.io
64875
Mc

mini-coder / commit 6735a03

Prevent subagents from accessing subagent tool

Sean2026-03-02 6735a03bf36aa1f314cf635b5d55b967c0fa6028 parent 9e5ac49

2 files changed

src/agent/subagent-runner.ts+1−1
@@ -47,7 +47,7 @@ export function createSubagentRunner(
4747 onHook: (tool, path, ok) => reporter.renderHook(tool, path, ok),
4848 availableAgents: allAgents,
4949 parentLabel: laneLabel,
50- });
50+ }).filter((tool) => tool.name !== "subagent");
5151
5252 const subLlm = resolveModel(model);
5353
src/tools/subagent.ts+1−1
@@ -40,7 +40,7 @@ export function createSubagentTool(
4040 : "";
4141 return {
4242 name: "subagent",
43- description: `Spawn a sub-agent to handle a focused subtask. Use this for parallel exploration, specialised analysis, or tasks that benefit from a fresh context window. The subagent has access to all the same tools.${agentSection}`,
43+ description: `Spawn a sub-agent to handle a focused subtask. Use this for parallel exploration, specialised analysis, or tasks that benefit from a fresh context window. ${agentSection}`,
4444 schema: SubagentInput,
4545 execute: async (input) => {
4646 return runSubagent(input.prompt, input.agentName, parentLabel);