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

# Last Guardrail Error • AI Agent SDK

> last_guardrail_error: The most recent rejection message a guardrail sent back to the model.

# last\_guardrail\_error

Method

> This is a method of the [**Agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Agent.md) class in the [**agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/agent.md) module.

The most recent rejection message a guardrail sent back to the model.

## Signature

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

### Returns

**Returns** `Any`

The result of the operation.

## Source

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

***

## Related Documentation

> [card] [Guardrails Concept](https://praison.ai/docs/docs/concepts/guardrails)

> [card] [Guardrails Feature](https://praison.ai/docs/docs/features/guardrails)

> [card] [Approval](https://praison.ai/docs/docs/features/approval)


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