---
title: "Give each sub-agent no more power than the · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-features/agents-in-products/sub-agent-limits
id: AIF-72
level: Recommended
applies: ai-features
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1121
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Give each sub-agent no more power than the agent that started it

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Agents in products](https://agentwranglers.se/playbook/ai-features/agents-in-products.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: AIF-72
- Level: Recommended
- Chapter: [Agents in products](https://agentwranglers.se/playbook/ai-features/agents-in-products.md)
- Rule: When one agent hands work to another, pass on the user and the run's remaining steps and budget. Pass a tool list that is a subset of its own. Record the parent run ID on every step.
- Check: A test starts a helper that asks for a tool the lead does not hold, and the call is refused. A test where the helper spends past the lead's remaining budget ends the whole run with the budget status. Every helper step row has a parent run ID.
- Applies when: The project uses AI models.
- How: Systems with a lead agent and helper agents can widen access by accident. A helper started with default tools may hold more power than the lead, or spend outside its budget. Start each helper through one function that takes the parent run and copies its limits down. Count the helper's steps and cost against the parent's [run limits](https://agentwranglers.se/playbook/ai-features/agents-in-products/agent-run-limits.md). Actions that need approval still go back to the user, never to the lead agent. Link the traces, as [record every step of every run](https://agentwranglers.se/playbook/ai-features/agents-in-products/agent-run-trace.md) shows, so one view shows the whole tree. Coding agents split work the same way in [split work between agents by files](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/multi-agent-split.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### TypeScript example

```ts
export function startSubAgent(parent: AgentRun, task: string, toolNames: string[]): AgentRun {
  const allowed = toolNames.filter(name => parent.toolNames.includes(name));
  return AgentRun.create({ parentRunId: parent.id, user: parent.user, task, toolNames: allowed,
    budget: parent.remainingBudget(), stepsLeft: parent.stepsLeft() });
}
```

### Python example

```python
def start_sub_agent(parent: AgentRun, task: str, tool_names: list[str]) -> AgentRun:
    allowed = [name for name in tool_names if name in parent.tool_names]
    return AgentRun.create(parent_run_id=parent.id, user=parent.user, task=task, tool_names=allowed,
                           budget=parent.remaining_budget(), steps_left=parent.steps_left())
```

## Sources

- [OWASP LLM03:2026 Excessive Agency](https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/final/LLM03_ExcessiveAgency.md)
- [OpenTelemetry semantic conventions for GenAI agent spans](https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/gen-ai-agent-spans.md)

## Related rules

- AIF-71 [Stop every agent run at fixed limits set in code](https://agentwranglers.se/playbook/ai-features/agents-in-products/agent-run-limits.md) in AI features
- AIF-54 [Record every step of every run](https://agentwranglers.se/playbook/ai-features/agents-in-products/agent-run-trace.md) in AI features
- AID-67 [Split work between agents by files and merge through one lead](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/multi-agent-split.md) in AI-assisted development

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/ai-features/agents-in-products/sub-agent-limits">Agent Wranglers AI features playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Test agents by the end state](https://agentwranglers.se/playbook/ai-features/agents-in-products/agent-scenario-tests.md)
- Next: [Connect product agents only to tools and servers on a reviewed list](https://agentwranglers.se/playbook/ai-features/agents-in-products/reviewed-agent-tools.md)
- [Agents in products](https://agentwranglers.se/playbook/ai-features/agents-in-products.md)
