Guardrail Retry Count • AI Agent SDK
guardrail_retry_count: How many times output validation has sent the model back for a retry.
guardrail_retry_count
Method
</div>
How many times output validation has sent the model back for a retry.
Cumulative over the agent’s lifetime, incremented once per rejected answer that was handed back to the model (see `_apply_guardrail_with_retry). Read it to confirm a run converged in one correction rather than burning max_guardrail_retries`.
Signature
def guardrail_retry_count() -> intReturns
ResponseField
intThe result of the operation.
Source
View on GitHubpraisonaiagents/agent/agent.py at line 7210