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

# Gateway Idle Policy Protocol • AI Agent SDK

> GatewayIdlePolicyProtocol: Protocol for gateway-process idle/scale-to-zero decisions.

# GatewayIdlePolicyProtocol

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

AI Agent

Protocol for gateway-process idle/scale-to-zero decisions.

Pure, import-free decision contract consumed by the wrapper's
`BotOS` run-loop. The wrapper supplies live facts (running turns,
last inbound timestamp, background-work flag) and the policy decides
whether the whole gateway may safely stand down. Concrete drivers
(suspend the compute host, stand transports down, register a wake
URL) live in the wrapper; this contract keeps the *decision* testable
in isolation without a live gateway.

A config-driven default (:class:`ScaleToZeroPolicy`) is provided for
the common "idle for N minutes with nothing in flight" case.

## Methods

> [card] [should\_arm()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/GatewayIdlePolicyProtocol-should_arm.md)
>
> Return whether dormancy may be armed at all.

> [card] [is\_idle()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/GatewayIdlePolicyProtocol-is_idle.md)
>
> Return an :class:`IdleDecision` for the supplied facts.

## Source

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

***

## Related Documentation

> [card] [Gateway Feature](https://praison.ai/docs/docs/features/gateway)


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