- Home
- Skills
- Agents & Orchestration
- Agent Failure Recovery Protocol Skill
Works with the AI Agents you already use
Agent Failure Recovery Protocol Skill
Detect, classify, and recover from AI agent tool failures and infinite loops with a structured safety protocol.
$15.99
Agent Failure Recovery Protocol Skill
Example session with this skill installed
The agent is receiving a malformed JSON response from the 'get_user_data' tool for the third time in a row. How should it handle this?
- Read your context and instructions
- Compiled the agent failure recovery
The agent has identified a persistent MALFORMED_OUTPUT failure. Following the protocol, it has logged the error, assessed the retry budget, and triggered a human escalation package because the repair attempt thresholds were exceeded.
Recovery Status Record
{
"run_id": "usr-9928-ax",
"step": "get_user_data",
"status": "ESCALATED",
"failure_type": "MALFORMED_OUTPUT",
"retryable": false,
"attempt_count": 3,
"error_summary": "Required field 'email' was missing in tool response",
"recovery_actions": [
"schema_validation_failed",
"bounded_requery_attempted"
],
"progress_made": false,
"human_action_required": true
}
Next steps
- Review Tool Contract: Check if the
get_user_dataAPI schema has changed. - Manual Intervention: Provide the missing 'email' field or authorize a fallback.
- Resume Workflow: Once input is provided, the agent will transition from
ESCALATEDtoVALIDATING.
Connects securely to your tools. The creator never sees your data.
About this skill
Your agents are getting stuck in infinite loops, burning tokens on malformed tool outputs, or blindly retrying non-idempotent actions. This skill provides a structured protocol to detect, classify, and recover from these failures without manual intervention or unsafe behavior.
What it does
- Failure classification identifies if errors are transient, permanent, or malformed tool outputs.
- Loop detection monitors for repeated identical tool calls or lack of progress to break cycles.
- Retry management implements bounded exponential backoff with jitter and idempotency checks.
- Output validation enforces schema checks on all tool results before they reach downstream tasks.
- Escalation handling packages error context, attempts, and impacts for safe human handoff.
How it works
- Detect a failure in tool output, schema validation, or task progress thresholds.
- Classify the error type and assess whether a retry is safe or if the action is idempotent.
- Execute a recovery action like a bounded retry, state refresh, or local repair.
- Validate the recovery result against the original task criteria before resuming.
Frameworks & tools
This protocol is implementation-agnostic and designed for any agentic framework using tool-calling (function calling), including LangGraph, AutoGen, CrewAI, or custom LLM loops.
Why this beats prompting it yourself
Prompting an agent to "fix itself" often leads to hallucinated data or deeper loops. This skill uses a deterministic state machine to ensure recovery is bounded, validated, and logged, preventing the agent from silently failing or repeating costly mistakes.
Use cases
- API integration handling rate limits and transient network timeouts.
- Data extraction validating JSON schemas from LLM-generated tool arguments.
- Financial workflows preventing duplicate transactions through idempotency checks.
- Long-running tasks interrupting agents that repeat the same sub-task without progress.
Known limitations
This is a protocol and logic framework, not a standalone library. It requires integration into your agent's execution loop and existing tool definitions.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Requires manual integration into agent execution loops. Does not provide pre-built code for every specific language. Idempotency must be supported by the underlying tools.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 14 days ago
Permissions
No special permissions declared or detected