> ## Documentation Index
> Fetch the complete documentation index at: https://usefused.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Folder-owned SubAgents

> Give a SubAgent its own instructions, tools, MCP connections, skills, and sandbox.

A folder SubAgent is a separate composition boundary.

```text theme={null}
subagents/researcher/
├── agent.py
├── instructions.md
├── tools/
├── mcp/
├── skills/
├── sandbox/
└── subagents/       ADK-only recursive discovery
```

## Ownership properties

| Resource                                  |           Child can own it? |                                      Inherited from parent? |
| ----------------------------------------- | --------------------------: | ----------------------------------------------------------: |
| `instructions.md`                         |                         Yes |                                                          No |
| `tools/`                                  |                         Yes |                                                          No |
| `mcp/`                                    |                         Yes |                                                          No |
| `skills/`                                 |                         Yes |                                                          No |
| [`sandbox/`](/docs/harnest/build/sandboxing)   | Yes, additional local names | Ancestor names are available; permissions are not inherited |
| Agent `plugins/` or Harnest `extensions/` |                          No |                                                          No |
| `lifecycle/`                              |                          No |                                                  Root-owned |
| `models/` and `lib/`                      |                          No |                                              Root namespace |

The child's private capabilities are not exposed to the parent merely because the directory is nested.

Every SubAgent must explicitly assign its allowed sandbox names with `Agent(sandboxes=[...])`, even when a parent already uses those names. Its authored tools then call `context.sandboxes["<name>"].execute(code)` or async `aexecute(code)`. Assignments do not create model tools. Child-local sandbox names cannot duplicate an ancestor's names. Adding files alone does not enable sandbox execution.

## Discovery rules

| Rule                                               | Result                                                           |
| -------------------------------------------------- | ---------------------------------------------------------------- |
| `agent.py` export matches the folder name          | Stable SubAgent identity                                         |
| Supported child folders are discovered by location | Sandbox names additionally require explicit per-agent assignment |
| Unsupported root-only folder is populated          | Compilation fails                                                |
| Parent references the child                        | Harnest wires the composition                                    |

<Card title="Framework behavior" icon="code-branch" href="/docs/harnest/build/subagents/framework-behavior">
  Check recursive discovery and portable graph behavior before choosing the layout.
</Card>
