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

# Shutdown Forensics Protocol • AI Agent SDK

> ShutdownForensicsProtocol: Protocol for capturing forensics when a gateway dies unexpectedly.

# ShutdownForensicsProtocol

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Protocol for capturing forensics when a gateway dies unexpectedly.

Pure contract consumed by the wrapper's signal handlers. `snapshot`
must be fast (\<10ms), never raise, and never block the asyncio teardown;
`spawn_diagnostic` is fire-and-forget and must run the diagnostic in a
*detached* session so a `SIGKILL` on the process group does not also kill
the diagnostic. Concrete OS I/O (`/proc` reads, `os.getrusage`,
`os.getloadavg`, subprocess spawn) lives in the wrapper implementation.

## Methods

> [card] [snapshot()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ShutdownForensicsProtocol-snapshot.md)
>
> Return a small, JSON-serialisable forensic context.

> [card] [spawn\_diagnostic()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ShutdownForensicsProtocol-spawn_diagnostic.md)
>
> Fire-and-forget a detached diagnostic into `log_dir`.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L5737)
>
> `praisonaiagents/gateway/protocols.py` at line 5737


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.