> ## 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.

# Lifecycle

> Add application resources, invocation hooks, output policy, and native integrations.

Lifecycle hooks and resource factories manage behavior around the agent without turning that behavior into tools. Author them in root `lifecycle/`, or package reusable functionality as a [Harnest Extension](/docs/harnest/build/extensions) with its own `lifecycle/` folder.

| Need                                                             | Use                  |
| ---------------------------------------------------------------- | -------------------- |
| Start and close a dependency                                     | Application resource |
| Publish a value to agent code                                    | Context resource     |
| Observe or transform execution                                   | Invocation hook      |
| Control public narration, tool activity, reasoning, and metadata | Output policy        |
| Add framework-specific behavior                                  | Native integration   |
| Add application HTTP routes                                      | HTTP route factory   |
| Store sessions or checkpoints                                    | Storage factory      |
| Store session-owned media                                        | Asset store          |
| Authenticate or resolve credentials                              | Security factory     |
| Export traces or logs                                            | Telemetry exporter   |
| Package reusable SDK and lifecycle behavior                      | Harnest Extension    |

Lifecycle is root-owned. SubAgents cannot add private lifecycle hooks and factories.

<CardGroup cols={2}>
  <Card title="Application resources" icon="boxes-stacked" href="/docs/harnest/runtime/lifecycle/application-resources">
    Start, publish, share, and close application dependencies.
  </Card>

  <Card title="Invocation hooks" icon="arrows-rotate" href="/docs/harnest/runtime/lifecycle/invocation-hooks">
    Observe or transform agent, model, and tool execution.
  </Card>

  <Card title="Output policy" icon="message" href="/docs/harnest/runtime/lifecycle/output-policy">
    Select public narration, tool activity, provider reasoning, and model metadata.
  </Card>

  <Card title="Native integrations" icon="code" href="/docs/harnest/runtime/lifecycle/native-integrations">
    Add ADK plugins or LangGraph middleware when portable hooks are not enough.
  </Card>

  <Card title="Harnest Extensions" icon="boxes-stacked" href="/docs/harnest/build/extensions">
    Package typed SDK access and declared runtime contributions.
  </Card>
</CardGroup>

## Related runtime boundaries

| Boundary                                                    | Page                                                                                     |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Committed conversation history and application session data | [Sessions and application storage](/docs/harnest/runtime/session-storage)                     |
| In-progress execution and recovery                          | [Checkpoints](/docs/harnest/runtime/checkpoints)                                              |
| Caller identity and downstream tokens                       | [Authentication and credentials](/docs/harnest/runtime/authentication-and-credentials)        |
| Logs, traces, and audit events                              | [Telemetry](/docs/harnest/runtime/telemetry)                                                  |
| Application-specific HTTP contracts                         | [Custom HTTP endpoints](/docs/harnest/runtime/custom-http-endpoints)                          |
| Typed media input and output                                | [Accept multimodal data](/docs/harnest/build/models-and-libraries/typed-multimodal-contracts) |
| Decorator signatures and cardinality                        | [Lifecycle reference](/docs/harnest/reference/lifecycle)                                      |
