Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Agent Failure Recovery Protocol Skill

    1

    Detect, classify, and recover from AI agent tool failures and infinite loops with a structured safety protocol.

    $15.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Agent Failure Recovery Protocol Skill

    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

    1. Review Tool Contract: Check if the get_user_data API schema has changed.
    2. Manual Intervention: Provide the missing 'email' field or authorize a fallback.
    3. Resume Workflow: Once input is provided, the agent will transition from ESCALATED to VALIDATING.

    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

    1. Detect a failure in tool output, schema validation, or task progress thresholds.
    2. Classify the error type and assess whether a retry is safe or if the action is idempotent.
    3. Execute a recovery action like a bounded retry, state refresh, or local repair.
    4. 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.

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

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    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

    Listed14 days ago

    What's inside

    Frequently Asked Questions

    This skill implements a deterministic state machine that monitors tool outputs and task progress, identifying issues like transient network errors, schema mismatches, and repetitive logic loops before they deplete your token budget.

    It is designed to be framework-agnostic and works with any agentic system that uses function calling, including LangGraph, AutoGen, CrewAI, and custom-built LLM loops.

    You will receive the logic schemas, integration templates, and a implementation guide that outlines how to hook the protocol into your agent's execution loop and tool definitions.

    Yes, the protocol includes dedicated logic for idempotency checks and safe retry management, ensuring that non-idempotent actions—like processing payments—are never duplicated during a recovery attempt.

    No, this is a logic framework that integrates directly into your existing codebase; it does not require an external API or third-party hosting, keeping your agent's data flow local and secure.

    New in Agents & Orchestration