Skip to main content

Bendex Resilience

Tests whether an AI agent (or any stateful system) recovers or cascades after a perturbation, like a corrupted memory entry, a failed tool call, or a config change, using twin-trajectory divergence analysis.

What makes this different

Most AI agent testing tools inject a failure and check one thing: did the task still complete? That's a pass/fail light switch. It can't tell the difference between "acting weird but fine" and "acting weird and actually breaking."

This tool instead:

  1. Clones your system into two copies.
  2. Applies a small, controlled perturbation to one copy.
  3. Runs both copies through the same real workload.
  4. Watches whether their behavior stays in sync (recovers) or drifts apart (cascades).

No historical baseline required before you can test it. No model of your system's internals needed. It works by comparing the two live copies to each other, not by comparing to weeks of past data.

Validated results

Tested against a real language model (Qwen2.5-0.5B-Instruct), not just synthetic data. See colab_shareable_demo.py, runnable yourself in one click:

Metric Result
Accuracy (40 trials: 20 healthy, 20 real injected failures) 95.0% (38/40)
Healthy systems correctly left alone 18/20 (2/20 false alarms)
Real failures caught 20/20

Also validated on systems where classical stability-analysis methods don't apply at all: nonlinear systems (90% accuracy against an exact known answer) and systems with memory/delay (100% accuracy against an exact known answer). Also validated to work with far less historical data than standard covariance-based drift detection methods require.

Known limitations, stated plainly, not hidden

  • Detection quality depends on calibration data size. Measured: 62% accuracy at 7 calibration observations, 83% at 25, 95% at 40+. Use at least ~40 observations where possible.
  • Does not yet automatically find your system's worst-case vulnerability. You tell it what scenario to test; it doesn't discover unknown weaknesses on its own. This is open, unsolved work.
  • Does not localize which specific subsystem is failing. Tells you that something broke, not which part of a multi-component system.

Quick start

from resilience_v2 import ResilienceDetector

detector = ResilienceDetector()
detector.calibrate(nominal_trajectory)   # your system's normal behavior
result = detector.check(test_trajectory) # behavior after a perturbation
print(result)  # {'verdict': 'RECOVERS' or 'CASCADES', 'flagged_at_step': ..., ...}

Or run it as an API. See api.py (FastAPI, single /analyze endpoint, stateless).

Files

  • resilience_v2.py: core detector
  • api.py: REST API wrapper
  • colab_shareable_demo.py: real-LLM validation demo, runnable in Colab
  • tests/: stress tests (scale, edge cases, false-positive rate)

License

AGPL-3.0. Commercial licensing available for organizations that cannot use AGPL, see COMMERCIAL-LICENSE.md.

Metadata

Release files for bendex-resilience 0.1.2

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

Source distribution (sdist)

Source distribution for bendex-resilience 0.1.2
File Size Uploaded Provenance
bendex_resilience-0.1.2.tar.gz 18.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bendex-resilience 0.1.2
File Interpreter ABI Platform
bendex_resilience-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / bendex_resilience-0.1.2.tar.gz

Download URL bendex_resilience-0.1.2.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbf98e5b575ba44ae775a8cd43ac9da38d0fe665462b649b2f8402ac383a78a7
BLAKE2b-256 checksum
How to use checksums
bd7fbc844bd462925901b235731126f951ed79db8d13183f13ac09c44259d8c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / bendex_resilience-0.1.2-py3-none-any.whl

Download URL bendex_resilience-0.1.2-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
697212c233fdfea07c6af2716dfdb273328d3b3ad7f76f872d26b9e34afd5ec5
BLAKE2b-256 checksum
How to use checksums
b9b173774bbfed5f389e2a697c9b6dbfaf530315ce622fe7f0bf0d2517b20780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for bendex-resilience 0.1.2

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.

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