Agent instructions
AuraScore 83/100

Autonomous Tool Calling Recovery and Self-Correction System Design

Formulate runtime reflection directives, dynamic retry loops, and parameter self-correction protocols for failing tool invocations.

Use this template when designing self-healing instructions for autonomous agents that frequently encounter API errors or parsing failures. It establishes automated diagnostic routines and deterministic fallbacks.

Template

Role: Senior Agent Safety and Reliability Specialist specializing in automated fault tolerance, runtime reflection, and boundary guardrails.

Context

  • Agent Runtime Architecture: {{agent_runtime_stack}}
  • Critical Tools & Endpoints: {{critical_tool_registry}}
  • Upstream Rate & Concurrency Limits: {{rate_limit_parameters}}
  • Observability and Telemetry Sink: {{telemetry_sink}}
  • Safe Fallback Directives: {{safe_fallback_actions}}
  • Adversarial / Malformed Input Vectors: {{adversarial_injection_surface}}

Task

Develop an Autonomous Recovery and Self-Correction System Report providing dynamic prompt instructions, error interpretation logic, reflection steps, and safe degradation actions for {{agent_runtime_stack}}.

Method

  1. Categorize failure modes across {{critical_tool_registry}} into schema violations, transport timeouts, rate-limit throttles, and semantic response anomalies.
  2. Design in-context self-correction instructions guiding the LLM to inspect tool execution errors, diagnose parameter discrepancies, and rewrite payloads without losing task state.
  3. Formulate backoff and jitter protocols adhering strictly to {{rate_limit_parameters}} to prevent cascading API degradation.
  4. Specify structural reflection prompts the agent executes prior to retrying a failed call, preventing repetitive identical queries.
  5. Map deterministic degradation routes leveraging {{safe_fallback_actions}} when self-healing attempts exceed predefined thresholds.
  6. Integrate audit logging instructions that emit diagnostic events to {{telemetry_sink}} on each correction attempt.
  7. Construct validation guardrails ensuring self-correction reasoning is shielded against {{adversarial_injection_surface}}.
  8. Build terminal response strategies ensuring graceful user communication upon unrecoverable tool collapse.

Constraints

  • MUST limit self-correction loops to a maximum of two automated iterations per tool call.
  • MUST NOT allow the agent to guess or hallucinate missing authentication keys or schema fields.
  • All error handling prompts MUST mandate explicit error code inspection.
  • Fallback actions MUST preserve user data integrity across all failure states.

Output format

A comprehensive resilience and recovery report containing:

  1. Tool Failure Taxonomy Matrix (covering all items in {{critical_tool_registry}})
  2. Agent Self-Correction Prompt Template Block (verbatim system instructions)
  3. Reflection & Parameter Rewriting Algorithm
  4. Rate Limiting & Throttling Mitigation Table (aligned with {{rate_limit_parameters}})
  5. Graceful Degradation & Telemetry Logging Plan

Self-review

  • Does the self-correction prompt contain explicit stopping criteria?
  • Are fallback workflows aligned with {{safe_fallback_actions}} for every critical endpoint?
  • Does the error taxonomy cover both structural and semantic failures?
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-instructions
autonomous-agents-workflows
agent-instructions
self-correction
reliability