agent-harness-fault-injection
できること
このツールは、AIプログラムが障害にどう対処するかをテストするためのものです。プログラムの特定の部分でエラーを模擬的に発生させ、正しく回復できるか、重要な情報を失わないかを確認します。
使う場面
- ✓プログラムにエラーから回復する新しい仕組みを追加したとき。
- ✓ツールやメモリなど、プログラムの一部が故障するおそれがあるとき。
- ✓回復機能を公開する前に。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-harness-fault-injection/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“検索ツールでタイムアウトエラーを発生させて、障害からの回復をテストしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
まず特定の障害計画を定義すると、ツールは管理された環境でこれらのエラーを模擬的に発生させます。その後、プログラムが期待どおりに動作したかを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Agent Harness Fault Injection
Overview
Use a deterministic, non-production fault schedule to test whether an agent workflow preserves state, budgets, safety boundaries, and evidence when a dependency fails. The output is a small fault matrix, an event timeline, and a verdict that distinguishes recovered, contained, unrecoverable, and inconclusive runs.
When to Use This Skill
- Use when a multi-step agent, state machine, loop, or multi-agent workflow has a new recovery path.
- Use when sandbox execution, an MCP/tool call, a worker, a checkpoint store, or memory can time out or disappear.
- Use before claiming retry, resume, deadline, isolation, or partial-failure behavior is production-ready.
- Use when a regression needs reproducible failure evidence instead of a random chaos run.
Do not use this skill against a production target, real user data, live credentials, or an unbounded external service. Convert those cases to a local simulator or an authorized staging harness first.
Safety and Boundary Preconditions
- Freeze the workflow revision, model/prompt configuration, tool schemas, seed, input fixture, timeout, retry budget, deadline, and expected terminal states.
- Run in a disposable sandbox with synthetic inputs and stubbed tools. Keep network disabled unless the test explicitly needs a local test server.
- Make every injected failure an in-memory or fixture-controlled event. Never delete real data, revoke real credentials, kill an unrelated process, or mutate a live service to create a failure.
- Record the test scope and a run identifier before starting. A missing scope,
fixture, or recovery contract makes the verdict
inconclusive.
Recovery Contract
Write the invariant before injecting a fault. A useful contract names the state that must survive and the side effects that must not repeat:
After recovery, resume from the latest durable checkpoint, preserve the task
identity and safety policy, spend no more than the remaining retry/deadline
budget, and commit each externally visible effect at most once.
Model the workflow with explicit states. For example:
created -> running -> checkpointed -> waiting_for_tool
| |
v v
failed <--------- recovering -> resumed -> completed
For each transition, define the owner, durable fields, allowed retry count, and terminal behavior. In-memory values are not checkpoints unless the harness proves they survive the simulated restart.
Fault Matrix
Select the smallest set of faults that covers the new recovery logic. Do not randomize the schedule until a deterministic schedule has passed.
| Fault | Injection boundary | Required observation | Expected containment |
|---|---|---|---|
| sandbox denial | before a tool starts | no unsafe side effect; reason is retained | retry only when policy allows |
| MCP/tool timeout | after request id is assigned | timeout is attributed to that request | bounded retry with same idempotency key |
| worker restart | after checkpoint write | worker reloads the same task version | resume from latest checkpoint |
| missing/stale checkpoint | before resume | stale data is rejected or marked | stop safely; never invent progress |
| parallel branch failure | one branch after fan-out | sibling status is preserved | join policy decides retry, degrade, or stop |
| memory loss | clear ephemeral context | durable facts are reconstructed | ask or stop when required facts are absent |
| retry/deadline exhaustion | on the final attempt | no extra call is scheduled | terminal failed or timed_out |
Deterministic Injection Schedule
Use event numbers rather than wall-clock randomness. A schedule should be portable across harnesses:
{
"seed": "harness-fixture-07",
"faults": [
{"event": "tool.call", "ordinal": 2, "kind": "timeout", "tool": "search"},
{"event": "worker.start", "ordinal": 2, "kind": "restart"},
{"event": "branch.join", "ordinal": 1, "kind": "partial_failure", "branch": "summarize"}
]
}
The harness should emit the schedule, not merely the seed. Keep fault identity separate from the observed error so a wrapper cannot accidentally turn a timeout into a generic failure. Run the same schedule twice and compare the normalized timeline before trying a different schedule.
Recovery Rules by Boundary
Sandbox and MCP/tool failures
…
よくある質問
「模擬障害」とは何ですか?
ツールが意図的に発生させるエラーのことで、プログラムの耐性をテストするために使われます。ツールが停止したり、メモリが失われたりする状況を再現します。
実際に使われているプログラムにも使えますか?
いいえ。このツールは、安全で管理された環境でのテスト専用です。実データを使ったり、本番環境で使ったりすることはありません。
「決定的な回復」とは何を意味しますか?
障害と回復が常に同じ方法で起こることを意味します。そのためテストを繰り返せ、結果を確実に比較できます。
詳細
作者による元の説明
Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures.
人気
- GitHubのスター
- 48k
- ランキング
- #3659
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。