# Delegation

[Documentation index](../README.md)

Delegation is bounded, direct, and ownership-local.

## Root supervisor

The root supervisor may assign any discovered effective agent definition.

The root retains architecture, global scope, acceptance, integration, and final
decision authority.

## Managed parent

A root-launched worker becomes a delegation-enabled parent when its effective
definition has a non-empty `subagents` list and its tool policy does not
explicitly deny the `subagent` tool. A parent-launched child is always a leaf:
its effective metadata and launch policy remove the child allowlist and
`subagent` capability.

A parent:

- may assign only the names in its effective `subagents`;
- owns only its direct children;
- integrates child results into its own assignment;
- remains subordinate to the root's approved objective.

## Child workers

A child assigned by a managed parent does not delegate further.

This keeps the supported structure bounded:

```text
root
└── parent
    └── child
```

A root may have many direct workers, and each delegation-enabled direct worker
may have its own direct children.

## Inferred `subagent` capability

A non-empty `subagents` field implies the `subagent` tool when the definition
already uses an explicit non-empty `tools` allowlist.

Inference does not turn an omitted tool allowlist into a `subagent`-only list;
Pi defaults remain intact.

Explicit denial wins:

- `excludeTools: ["subagent"]` prevents inference.
- `noTools: true` prevents inferred `subagent` unless `subagent` is explicitly
  present in `tools`.
- An explicit exclusion still wins over an explicit allow.

The exact field semantics live in the
[agent-definition schema](../reference/agent-definition-schema.md).

## Parallelism

Parallelize only genuinely independent work.

Do not:

- assign overlapping writers to one worktree;
- start review before the writer finishes;
- duplicate supplied reconnaissance;
- continue dependent work while a required child is active.

A useful pattern is:

```text
parent
├── scout: bounded reconnaissance
└── local independent analysis

child result arrives
↓
parent integrates both
```

## Clarification across ownership edges

A child may ask its direct parent through `ask_owner`.

A parent may itself ask its direct owner when the unresolved direct-child work
is already validly blocked waiting for owner decisions. The system does not
automatically route a question through an owner chain.

Ordinary active child work or an undelivered child result still blocks parent
escalation.

## Closing

Closing a parent cascades through its directly owned children first.

Cleanup remains ownership-safe. If a required child cannot be proved or closed,
the parent is preserved rather than destructively guessing.

## See also

- [`ask_owner` API](../reference/ask-owner.md)
- [Lifecycle](lifecycle.md)
- [Handoffs and files](../guides/handoffs.md)
