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

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**protocols**](../modules/protocols) 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

<ParamField query="ppid" type="Optional[int]" required={true}>
  The parent PID, or `None` when unavailable.
</ParamField>

<ParamField query="invocation_id" type="Optional[str]" required={true}>
  The value of `$INVOCATION_ID`, or `None`/empty.
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  `True` when either supervision signal is present.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L4202">
  `praisonaiagents/gateway/protocols.py` at line 4202
</Card>
