Chaos Testing for Agentic AI

A standalone fault-injection toolkit that deliberately breaks your LLM calls and agent workflows—
and reports exactly what failed.

0
Required Dependencies
7
Fault Types (v0.1-0.3)
2
Testing Layers
v1.0
Roadmap Ready

Why Chaos Testing for Agents?

Agentic AI systems are brittle. Your agent works fine in the lab, but what happens when the LLM times out, a tool fails, or shared memory gets corrupted? Most teams don't know until production breaks.

🤐

Silent Failures Invisible to Monitoring

Your LLM returns garbage, but latency and tokens look normal. No alert fires. Chaos testing catches this.

⛓️

Cascade Failures in Multi-Agent Systems

One tool fails → Agent A fails → Agent B cascades. Without topology tracking, you miss the link.

🔄

No Recovery Testing

Your retry logic might fail under rate limits. Your turn limits might not prevent infinite loops. Prove it works.

📊

Resilience Unproven

Observability shows cost/latency. Chaos shows recovery. Together, they prove your agent is production-ready.

🚀

Framework-Agnostic

Works with any Python callable. LLM frameworks, agent frameworks, your custom code—no lock-in.

Zero Setup Overhead

pip install agentic-chaos. Wrap your calls. Run under chaos. No framework modifications needed.

How It Works

agentic-chaos operates in three layers: LLM calls, agent workflows, and agent-to-agent handoffs.

Three-Layer Testing

🔌

LLM Layer (v0.1)

Test individual LLM calls — timeouts, rate limits, silent degradation. Works against any LLM, any provider.

🤖

Agent Layer (v0.2)

Test multi-agent workflows — tool failures, memory corruption, infinite loops. Tracks topology and cascades.

⚖️

Fidelity & Handoff Layer (v0.3)

Score whether corruption actually mattered and break the edge between two agents — LLM-as-judge fidelity scoring plus edge-scoped handoff corruption/drop/delay.

All Fault Types

7 fault types across LLM, agent, and handoff layers. Extensible—add your own.

⏱️ TokenTimeout LLM

Simulates a hung/slow completion. Hangs for N seconds then times out (or succeeds late).

Modes
raise, delay
CLI
token_timeout
🌪️ RateLimitStorm LLM

Simulates a burst of 429 errors, then recovery. Tests retry logic and backoff behavior.

Stateful
Yes (counts firings)
CLI
rate_limit_storm
🤐 SilentDegradation LLM

Real latency, garbage output. Monitoring-blind failure—the hardest to detect.

Detection
Very hard
CLI
silent_degradation
🔧 ToolCallFailure Agent

Force a tool to fail—error, timeout, or return empty. Tests tool unavailability.

Modes
error, timeout, empty
CLI
tool_failure
💾 MemoryCorruption Agent

Corrupt shared agent state—truncate to 50%, inject garbage, or garble text.

Modes
truncate, inject, garble
CLI
memory_corruption
♻️ InfiniteLoop Agent

Force agent to loop past termination. Tests turn-limit safeguards.

Stateful
Yes (tracks turns)
CLI
infinite_loop
🔗 HandoffCorruption Agent

Targets the edge between two agents instead of a node — corrupt, drop, or delay a handoff payload in transit.

Modes
corrupt, drop, delay
CLI
handoff_corruption

🔍 Try Interactive Fault Explorer

Quick Start (5 minutes)

Install, wrap your calls, run under chaos.

1. Install

bash
pip install agentic-chaos

2. Wrap Your LLM Calls

Python
from agentic_chaos.chaos import chaos_call, chaos_session, TokenTimeoutError

with chaos_session(["token_timeout"]):
    try:
        result = chaos_call(
            llm.complete,
            "What is the weather?",
            faults=["token_timeout"]
        )
    except TokenTimeoutError:
        print("LLM timed out—handled gracefully")

3. Run from CLI

bash
agentic-chaos chaos run my_app.py \
  --inject token_timeout,rate_limit_storm,silent_degradation \
  --save chaos_report.json

Learn More

→ Full Documentation→ Case Studies→ Examples

Ready to Build Resilient Agentic AI?

Start testing your agents today. Zero setup required.

⭐ Star on GitHub 📖 Read Docs