Skip to main content

Chaos proxy for testing LLM agents. Supports OpenAI, Anthropic, and MCP.

Project description

AgentBreak

Your agent works great — until the LLM times out, returns garbage, or an MCP tool fails. AgentBreak lets you test for that before production.

It's a chaos proxy that sits between your agent and the real API, injecting faults like latency spikes, HTTP errors, and malformed responses so you can see how your agent actually handles failure.

Agent  -->  AgentBreak (localhost:5005)  -->  Real LLM / MCP server
                     ^
          injects faults based on your scenarios

Get started

pip install agentbreak
agentbreak init       # creates .agentbreak/ with default configs
agentbreak serve      # start the chaos proxy on port 5005

Point your agent at http://localhost:5005 instead of the real API:

# OpenAI
export OPENAI_BASE_URL=http://localhost:5005/v1

# Anthropic
export ANTHROPIC_BASE_URL=http://localhost:5005

Run your agent, then check how it did:

curl localhost:5005/_agentbreak/scorecard

That's it. No code changes needed — just swap the base URL.

How it works

AgentBreak reads two files from .agentbreak/:

  • application.yaml — what to proxy (LLM mode, MCP upstream, port)
  • scenarios.yaml — what faults to inject

A scenario is just a target + a fault + a schedule:

scenarios:
  - name: slow-llm
    summary: Latency spike on completions
    target: llm_chat          # what to hit (llm_chat or mcp_tool)
    fault:
      kind: latency           # what goes wrong
      min_ms: 2000
      max_ms: 5000
    schedule:
      mode: random            # when it happens
      probability: 0.3

Don't want to write YAML? Use a preset:

preset: brownout

Available presets: brownout, mcp-slow-tools, mcp-tool-failures, mcp-mixed-transient.

MCP testing

agentbreak inspect    # discover tools from your MCP server
agentbreak serve      # proxy both LLM and MCP traffic

Track resilience over time

# in .agentbreak/application.yaml
history:
  enabled: true
agentbreak serve --label "added retry logic"
agentbreak history compare 1 2    # diff two runs

Claude Code

If you use Claude Code, AgentBreak has a guided skill that scans your codebase, generates scenarios, and walks you through results:

npx skills add mnvsk97/agentbreak

Then type /agentbreak in Claude Code.

Full reference

For the full list of fault kinds, schedule modes, match filters, and config options, see the docs.

Examples

See examples/ for sample agents and MCP servers you can test against.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentbreak-0.3.3.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentbreak-0.3.3-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file agentbreak-0.3.3.tar.gz.

File metadata

  • Download URL: agentbreak-0.3.3.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentbreak-0.3.3.tar.gz
Algorithm Hash digest
SHA256 af6ad70822153ab0986cd60038eb421dfb9fc61f84abcaecfd3e59891322c134
MD5 88938c4c00bf0946cb67e8e74466b262
BLAKE2b-256 522474591841a87b4b977b4820445f9650776022464f72425dd860fc0bce4afe

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbreak-0.3.3.tar.gz:

Publisher: ci.yml on mnvsk97/agentbreak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentbreak-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: agentbreak-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentbreak-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 336894ee4fa45f22aa41b466a0b02176f8dbf5ad0b7ae1f0b6e0837e220f922f
MD5 01e79e457c54ac8a2c395fe98a539cbd
BLAKE2b-256 bef15800d2282df0b077f75ef8d7ba7bea41fbd7702cfa4c53f5b20dd8f9178a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbreak-0.3.3-py3-none-any.whl:

Publisher: ci.yml on mnvsk97/agentbreak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page