Catalog PyPI
PACKAGE EXPLORERView in registry

agentchaos-tools

PyPI

Chaos testing for agentic AI — fault injection hooks for openai-agents-python

agentsaichaosllmopenaitesting
Versions collected1
Direct dependencies1From release 0.1.1
Last observed20 Oct, 21:37 UTC

README

Version 0.1.1 documentation

agentchaos-tools

PyPI version

Chaos testing for agentic AI — fault injection hooks for openai-agents-python.

Simulate tool failures, latency, and corrupted outputs to verify your agent handles real-world conditions gracefully.

Install

pip install agentchaos-tools

Usage

from agents import Agent, Runner, function_tool
from agentchaos import FaultInjectionHooks, ToolFault, FaultType

@function_tool
def web_search(query: str) -> str:
    return f"Results for {query}"

agent = Agent(name="assistant", tools=[web_search])

hooks = FaultInjectionHooks(
    faults=[
        ToolFault(tool_name="web_search", fault_type=FaultType.EXCEPTION, rate=0.5),
        ToolFault(tool_name="calculator", fault_type=FaultType.LATENCY, latency_seconds=2.0),
    ],
    seed=42,  # optional: reproducible fault patterns
)

result = await Runner.run(agent, "Search for something", hooks=hooks)
hooks.report()
# agentchaos-tools report — 1 fault(s) triggered:
#   1. [EXCEPTION] tool='web_search'

Fault types

TypeWhat it does
EXCEPTIONRaises RuntimeError before the tool runs
LATENCYInjects asyncio.sleep delay before the tool runs
CORRUPTIONRecords that output was corrupted (visible in report)

Parameters

ParameterTypeDefaultDescription
tool_namestrrequiredName of the tool to target
fault_typeFaultTyperequiredType of fault to inject
ratefloat1.0Probability (0.0–1.0) that the fault fires
latency_secondsfloat1.0Delay in seconds (LATENCY only)
seedintNoneRandom seed for reproducible tests

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.121 Mar 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
nithin-1808/agentchaos

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0203650dcf01610b132303274c696c3a7d2091f05d3af477b5049c8a47e0fef0