# Agent trees

> A parent agent spawns children with narrower capabilities and stricter approval.

A bundle's `agents` block lets it spawn **children**: other bundles it supervises. A child can only be
made weaker than its own bundle, never stronger.

```yaml
agents:
  max_depth: 2
  max_children: 2
  children:
    triage:
      kind: bundle
      bundle: "bundle.fleet.yaml"
      deny: ["restart_host"]              # removed from the child's capabilities
      approval:
        cordon_host: deny                 # raises the child's floor, never lowers it
      extra_condition: "m.disk_pct_avg < 90"
      instructions:
        - "Only triage incidents tagged for this release."
      ttl: "2h"
      on_parent_exit: reap
      persistence: ephemeral
```

- **Restriction only.** `deny`, `approval` and `extra_condition` can only narrow what the child's own
  bundle allows. An `extra_condition` is ANDed with the child's conditions.
- **`parent` approval.** A child's capability can be gated on its parent: the parent decides, and the
  decision is recorded like any other.
- **Bounded.** `max_depth` and `max_children` cap the tree. `ttl` ends a child; `on_parent_exit` says
  whether it is reaped or keeps running, and `persistence` whether its state survives.
- **Checked at load.** Children are dry-spawned when the parent loads, so a bad child fails early.

Example: [`bundle.supervisor.yaml`](https://github.com/benja0rtzzz/loom/blob/main/tests/bundles/bundle.supervisor.yaml).