agent-harness-fault-injection
Lets your agent recover from failures in a controlled way. It's useful for ensuring the agent can handle unexpected errors and keep working.
What it does
This tool helps test how an AI program handles failures. It simulates errors in specific parts of the program to ensure it recovers correctly and doesn't lose important information.
When to use it
- ✓When adding a new way for the program to recover from errors.
- ✓When parts of the program (like tools or memory) might fail.
- ✓Before releasing a recovery feature to the public.
Example of what to ask your AI
“Test fault recovery by simulating a timeout error in the search tool.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
You define a specific fault plan, and the tool simulates these errors in a controlled environment. It then checks if the program behaved as expected.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill agent-harness-fault-injectionOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/agent-harness-fault-injection/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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
…
FAQ
What is a 'simulated fault'?
It's an error intentionally created by the tool to test the program's resilience, such as a tool stopping working or memory being lost.
Can I use this on programs in real use?
No, this tool is only for testing in safe, controlled environments, never with real data or in production.
What does 'deterministic recovery' mean?
It means that failures and recovery always happen in the same way, allowing tests to be repeated and results to be compared reliably.
Details
Original description by the author
Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2045
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC