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

Method

> This is a method of the [**LivenessConfig**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/LivenessConfig.md) class in the [**config**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/config.md) 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

**Returns** `Any`

The result of the operation.

## Uses

* `LivenessPolicy`

## Source

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


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