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

# Is Supervised • AI Agent SDK

> is_supervised: Return whether the process appears to run under a service manager.

# is\_supervised

Function

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

Return whether the process appears to run under a service manager.

Pure predicate. A process is considered supervised when either:

* its parent is PID 1 (`ppid == 1` — reparented to init / the container
  entrypoint), or
* the systemd `INVOCATION_ID` environment variable is present (the unit
  was started by systemd).

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def is_supervised(ppid: Optional[int], invocation_id: Optional[str]) -> bool
```

## Parameters

**ppid** `Optional[int]` *required*

The parent PID, or `None` when unavailable.

**invocation\_id** `Optional[str]` *required*

The value of `$INVOCATION_ID`, or `None`/empty.

### Returns

**Returns** `bool`

`True` when either supervision signal is present.

## Source

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


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