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

# To Policy • AI Agent SDK

> to_policy: Build the pure core ``LivenessPolicy`` this config describes.

# to\_policy

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**LivenessConfig**](../classes/LivenessConfig) class in the [**config**](../modules/config) module.

Build the pure core `LivenessPolicy` this config describes.

When `enabled` is False the policy is constructed with
`interval_ms=0` so its `evaluate` always returns `KEEP` —
reaping is a no-op, preserving today's behaviour.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def to_policy() -> Any
```

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `LivenessPolicy`

## Source

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