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

# Liveness Policy Protocol • AI Agent SDK

> LivenessPolicyProtocol: Protocol for application-level connection-liveness decisions.

# LivenessPolicyProtocol

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

AI Agent

Protocol for application-level connection-liveness decisions.

Pure, import-free decision contract consumed by the wrapper's gateway
(heartbeat-emit + reaper task) and the reference client (heartbeat-send +
silence watchdog). The caller supplies the connection's last-activity
timestamp and the current time; the policy returns a
:class:`LivenessDecision`. Concrete transport machinery (sending the
`PING` frame, closing the socket, forcing a reconnect) lives in the
implementations, since it needs the running event loop and live sockets;
this contract keeps the *decision* testable in isolation, symmetric with
:class:`GatewayDrainPolicyProtocol` / :class:`RateLimitPolicyProtocol`.

A config-driven default (:class:`LivenessPolicy`) is provided for the
common "heartbeat every `interval_ms`, reap after N missed beats" case.

## Properties

**interval\_ms** `int`

No description available.

**missed\_beats\_before\_reap** `int`

No description available.

## Methods

> [card] [evaluate()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/LivenessPolicyProtocol-evaluate.md)
>
> Return a :class:`LivenessDecision` for the supplied timestamps.

## Source

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


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