agent-resilience

agent-resilience is a skill for Claude Code, Codex from MLOps-Courses/agentops-open-course. It costs 64 tokens per session (592 once invoked), scanned A, original, MIT.

Failure-handling guidance for software agents that call tools and remote AI models.

In plain words
What is it for?
Use it to add time limits, safe retries for read-only requests, circuit breakers for failing services, and a checked fallback model.
Why use it?
It prevents slow or unavailable services from hanging an agent, being overwhelmed by repeated requests, or causing a full outage when the main model is down.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add time limits, safe retries for read-only requests, circuit…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mlops-courses/agentops-open-course/agent-resilience
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MLOps-Courses/agentops-open-course --skill agent-resilience
Clone the repo
git clone --depth 1 https://github.com/MLOps-Courses/agentops-open-course

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-resilience

README.md
[![agentmods](https://agentmods.dev/badge/skills/mlops-courses/agentops-open-course/agent-resilience.svg)](https://agentmods.dev/skills/mlops-courses/agentops-open-course/agent-resilience)
Your own site
<a href="https://agentmods.dev/skills/mlops-courses/agentops-open-course/agent-resilience"><img src="https://agentmods.dev/badge/skills/mlops-courses/agentops-open-course/agent-resilience.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 592 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.00592
Opus 5 $0.00032 $0.00296
Sonnet 5 $0.00013 $0.00118
Haiku 4.5 $0.00006 $0.00059

Measured 6d ago against content hash 3d238775b7c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agent-resilience scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agent-resilience/SKILL.md · 36 lines

How it starts

The opening of the file, as written. The whole thing — 36 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Resilience

Give an agent's outbound calls three layers of failure handling, applied in the right place. The rule that generalizes: retry only where the call is idempotent, and only where a replica exists to retry against.

When to use

  • A slow tool or model call can hang a whole turn instead of failing on a deadline.
  • A hard-down dependency is hammered with the full retry budget on every turn.
  • The primary model endpoint has no failover, so its outage is a total outage.
  • You are about to add a retry to a write — stop and read step 2 first.

Steps

  1. Bound every call with a deadline. Pass a context deadline through each tool and model call so a slow dependency returns a clear error instead of hanging the turn.
  2. Retry only idempotent reads, never writes. Retrying a non-idempotent action (restart, resolve, charge) can apply it twice. Retry reads with bounded, exponential backoff; leave writes to run exactly once behind human confirmation.
  3. Add a circuit breaker for dead dependencies. After N consecutive failures, open the breaker and fail fast (shed load) until a cooldown elapses, then let one trial call test recovery. Keep it opt-in so default behavior stays retry-only, and emit a metric each time it opens.
  4. Fail over the model only to a validated fallback. Try a primary model; on a failure before any response, fall back to a secondary you have evaluated. Never switch mid-stream (it splices two answers), and prefer a smaller same-provider model so failover keeps your cost and privacy properties.

Reference implementation

From the AgentOps Open Course, installable with npx skills add MLOps-Courses/agentops-open-course:

  • agents/go/resilience/ — context deadlines, bounded retries, and circuit state.
  • agents/go/resilience/circuit_test.go — deterministic virtual-time checks with testing/synctest.
  • agents/go/model/fallback.go — same-provider fallback before any response is yielded.
  • Course chapters 4.5. Guardrails and 5.4. Model Gateway.

Read the full file on GitHub · 36 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 36 lines · 64 tokens per session scan A 3d238775b7c5

Subscribe to this mod's changes

agent-resilience is a skill published in the GitHub repository MLOps-Courses/agentops-open-course (2 stars, last pushed 5d ago), licensed MIT. It adds 64 tokens to every session and 592 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

skill-release-gate

Evaluate an Agent Skill bundle for structural integrity, trigger quality, artifact improvement, script correctness, safety, installed-tree integrity, and target-host portability before release.

rohitg00/ai-engineering-from-scratch · 36 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

routing-policy-change

Modifies routing policy after signal extraction, including matched-decision logic, candidate-model selection, and downstream looper behavior. Use when changing decision predicates, thresholds, priorities, model ranking, cost or latency routing, or other post-signal routing policy.

vllm-project/semantic-router · 54 tokens

project-change

Handles a focused repository change when no specialized primary skill applies. Use when changed-file routing selects this fallback for a feature, fix, refactor, documentation update, or subsystem-local task.

vllm-project/semantic-router · 40 tokens

deck-course-module

A course or workshop slide template with persistent learning goals, teaching pages, multiple-choice self-tests, and a wrap-up.

nexu-io/html-anything · 25 tokens

detecting-container-drift-at-runtime

Detect unauthorized modifications to running containers by monitoring for binary execution drift, file system changes, and configuration deviations from the original container image.

xalgorix/xalgorix · 34 tokens