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

# Delegation

> A grant created at runtime by a principal who already holds one (SPEC-v0.3 §5.1).

`ctrlrun.Delegation` — class, defined at `src/ctrlrun/authority.py:417`

```python theme={null}
from ctrlrun import Delegation
```

```python theme={null}
class Delegation
    def __init__(delegation_id: str, parent_id: str, depth: int, grant: Grant, created_by: Principal, created_via: Literal['api', 'cli'], created_at: datetime, revoked_at: datetime | None = None, revoked_by: str | None = None)
```

A grant created at runtime by a principal who already holds one (SPEC-v0.3 §5.1).

The parsed form of a `DelegationRecord`: `state.py` persists rows with `grant_json` as a
string, and this module is what parses a `Grant` out of one. `grant.id` **is** the
`delegation_id` — one namespace addresses root grants and delegations, and `--parent`
takes either (§5.2).

## Next

* [Python API index](/reference/api/index).
* [Get started](/get-started/quickstart) · [Why](/why).


## Related topics

- [Authority YAML reference](/reference/authority-yaml.md)
- [Authority and delegation](/concepts/authority-and-delegation.md)
- [DelegationRecord](/reference/api/DelegationRecord.md)
- [A payout agent with maker/checker via delegation](/cookbook/payout-maker-checker.md)
