Chuyển đến nội dung
Skillpedia
Agent48k · #3659

agent-harness-fault-injection

Skill này làm gì

Công cụ này giúp kiểm thử cách một chương trình AI xử lý lỗi. Nó mô phỏng lỗi ở những phần cụ thể của chương trình để đảm bảo chương trình phục hồi đúng cách và không mất thông tin quan trọng.

Khi nào nên dùng

  • ✓Khi thêm một cách mới để chương trình phục hồi sau lỗi.
  • ✓Khi các phần của chương trình (như công cụ hoặc bộ nhớ) có thể gặp sự cố.
  • ✓Trước khi đưa một tính năng phục hồi ra công chúng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-harness-fault-injection/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-harness-fault-injection/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm thử khả năng phục hồi lỗi bằng cách mô phỏng lỗi hết thời gian chờ trong công cụ tìm kiếm.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn định nghĩa một kế hoạch lỗi cụ thể, và công cụ mô phỏng các lỗi này trong môi trường có kiểm soát. Sau đó nó kiểm tra xem chương trình có hoạt động như mong đợi không.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. Freeze the workflow revision, model/prompt configuration, tool schemas, seed, input fixture, timeout, retry budget, deadline, and expected terminal states.
  2. Run in a disposable sandbox with synthetic inputs and stubbed tools. Keep network disabled unless the test explicitly needs a local test server.
  3. 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.
  4. 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

…

Câu hỏi thường gặp

“Lỗi mô phỏng” là gì?

Đó là lỗi do công cụ cố ý tạo ra để kiểm tra khả năng chịu đựng của chương trình, như một công cụ ngừng hoạt động hoặc bộ nhớ bị mất.

Tôi có thể dùng công cụ này cho chương trình đang được sử dụng thật không?

Không, công cụ này chỉ dùng để kiểm thử trong môi trường an toàn có kiểm soát, không bao giờ dùng với dữ liệu thật hoặc môi trường sản xuất.

“Deterministic recovery” nghĩa là gì?

Nghĩa là lỗi và quá trình phục hồi luôn diễn ra theo cùng một cách, giúp các bài kiểm thử có thể lặp lại và kết quả có thể so sánh đáng tin cậy.

Chi tiết

Mô tả gốc của tác giả

Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3659
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự