Skip to main content

chaos-agents

Chaos Monkey, but for AI agents.

chaos-agents injects controlled faults — latency, errors, corrupted / truncated / empty outputs — into your agent and tool functions, so you can find out how your system behaves before the real world does it for you.

⚠️ Early alpha (v0.1.0). The API is small on purpose and will grow.

Install

pip install chaos-agents

Usage

from chaos_agents import ChaosMonkey

# Roll the dice on every call.
monkey = ChaosMonkey(
    latency=0.3,      # 30% chance of an artificial delay
    errors=0.1,       # 10% chance of raising ChaosError
    corruption=0.1,   # 10% chance of scrambling the string output
    truncation=0.05,  # 5%  chance of truncating the output
    seed=42,          # reproducible chaos
)

@monkey.wrap
def my_agent(prompt: str) -> str:
    return call_llm(prompt)

my_agent("summarize this document")
print(monkey.report())   # {'latency': 1, 'errors': 0, ...}

You can also wrap inline:

result = monkey.run(call_llm, prompt)

Disable chaos in production without touching call sites:

monkey = ChaosMonkey(errors=0.1, enabled=False)

Built-in faults

Fault What it simulates
latency slow / hanging agents and tools
errors crashes and tool failures (raises ChaosError)
corruption hallucinated / garbled responses
truncation token-limit cutoffs and interrupted streams
empty silent / dropped responses

License

MIT

Metadata

Release files for chaos-agents 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chaos-agents 0.1.0
File Size Uploaded Provenance
chaos_agents-0.1.0.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for chaos-agents 0.1.0
File Interpreter ABI Platform
chaos_agents-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / chaos_agents-0.1.0.tar.gz

Download URL chaos_agents-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
787b24cfda6086549d63ca05c65e03e90883183b60c97358cd68b587facb4324
BLAKE2b-256 checksum
How to use checksums
007657902c03a975f49bfced4809418ee02df34404a0fc1ba1110284861a504d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / chaos_agents-0.1.0-py3-none-any.whl

Download URL chaos_agents-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41dedc8e87413e693792822546640661754f226b3676849d197a635f2ed4931c
BLAKE2b-256 checksum
How to use checksums
c343092c2c98162ce6ee3a9f604be8d318f6f95092233e82e18878df4c24e5f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for chaos-agents 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page