← 返回
未分类 中文

Supervision Layer

Wrap every tool call with timeouts, circuit breakers, audit logging, and crash loop protection. Enforcement the agent cannot bypass.
对每一次工具调用均包装超时、断路器、审计日志和崩溃循环防护,强制代理不可绕过。
larios613-hub
未分类 clawhub v1.0.0 1 版本 99547.5 Key: 无需
★ 0
Stars
📥 220
下载
💾 0
安装
1
版本
#latest

概述

Supervision Layer

Stop trusting agents to police themselves. Supervision Layer wraps every tool call in timeouts, circuit breakers, and audit logs — enforcement the agent cannot bypass.

Before vs After

Without SupervisionWith Supervision
---------
Runaway callsAgent loops infinitely on a failing APICircuit breaker trips after 3 failures
Stuck sessionsTool hangs silently, agent waits foreverTimeout kills it after 30s
Audit trailNo record of what happenedEvery call logged with timestamp, outcome, cost
Crash loopsSubagent restarts infinitelyAfter 3 crashes, marked permanently failed

Quick Start

from supervision import get_supervisor

supervisor = get_supervisor()
result = await supervisor.execute(
    tool="web_fetch",
    fn=fetch_fn,
    agent_id="worker-1",
    session_id="sess-abc",
)

Components

  1. TimeoutWrapper — Per-tool configurable timeouts (default 30s)
  2. CircuitBreaker — 3-state machine (CLOSED → OPEN → HALF_OPEN)
  3. AuditLogger — Structured JSONL logging, 50MB rotation, queryable
  4. CrashLoopProtector — Track restarts, mark failed after 3 within window
  5. SupervisedCall — All-in-one: crash check → circuit check → audit → timeout → audit

Testing

cd scripts/ && python -m pytest test_supervision.py -v

58 tests. 0 external dependencies. Works with any async Python project.

License

MIT

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-23 23:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Photo Editor Pro

larios613-hub
Photo Editor Pro 提供AI增强编辑、背景移除、色彩调校、批量处理和格式转换,专为专业图像工作流程设计。
★ 0 📥 416

Security Audit Pro

larios613-hub
针对 OpenClaw 部署的完整 OWASP、Nmap、Nikto 漏洞评估。扫描基础设施、强化配置并生成合规报告。
★ 0 📥 254

Restaurant Operator

larios613-hub
管理餐厅运营,涵盖食谱创建、库存预测、菜单优化、员工排班和食品安全合规。
★ 0 📥 423