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

# Dead Letter Policy Protocol • AI Agent SDK

> DeadLetterPolicyProtocol: Protocol for the durable-queue dead-letter decision.

# DeadLetterPolicyProtocol

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

AI Agent

Protocol for the durable-queue dead-letter decision.

Pure, import-free decision contract consumed by the outbound queue's
`drain` and the inbound journal's redelivery/replay paths. The runtime
supplies typed facts about a repeatedly-failing entry (its `attempts`,
the `first_seen_epoch` it was first received, the current `now_epoch`,
and a coarse `error_class`) and the policy returns a
:class:`DeadLetterDecision`. Concrete queue state and side effects (SQLite
rows, DLQ enqueue) stay in the implementation; this keeps the *policy*
injectable and testable in isolation, symmetric with
:class:`SendPolicyProtocol` / :class:`RateLimitPolicyProtocol`.

A config-driven default (:class:`AttemptAndAgeDeadLetterPolicy`) is
provided for the common "poison vs transient" case.

## Methods

> [card] [should\_dead\_letter()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/DeadLetterPolicyProtocol-should_dead_letter.md)
>
> Return a :class:`DeadLetterDecision` for the supplied facts.

## Source

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


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