Pyshackle:为 AI Agent 工具调用设置严格的执行前闸门(开源)
英文标题:🔶 Pyshackle: A hard pre-execution gate for AI agent tool calls (open source)
SHACKLE 是一个面向自主 AI Agent 的开源运行时治理层和 SP/1.0 一致性标准,可在每次工具调用或 LLM 调用前作出 `ALLOW`、`DENY` 或 `HITL` 决策。项目提供 15 个可通过哈希验证的一致性测试向量、纯标准库参考实现,以及基于公开测试夹具的认证与注册机制。其运行时集成可拦截工具调用、检测重复调用和错误级联、跟踪 token 预算并触发人工介入,以降低 Agent 无限重试和成本失控风险。对开发者而言,SHACKLE 可通过 LiteLLM、AutoGen 和 Python 装饰器接入多个 Agent 框架,但其定位更偏向本地开发、调试和有人监督的工作流。
1.8 KB
1.7 KB
2.3 KB
2.9 KB
1.4 KB
1.8 KB
1.6 KB
5.0 KB
2.1 KB
7.0 KB
中文
⛓️ SHACKLE
面向自主 AI Agent 的运行时治理层,以及 SP/1.0 一致性标准。 SHACKLE 会实时调解每一次 Agent 工具调用:失控的 token 循环、未处理的工具级联故障和预算超支,都会在_下一次_调用触发前被阻止。它已经上线,今天即可运行,其参考实现可证明通过自身的一致性测试套件。这不是提案或原型,而是一项可运行、可验证且可据此获得认证的标准。(每次调用后从 usage 读取成本,因此 SHACKLE 会停止循环,而非停止那次刚刚越过限制的单次调用;请参阅下方 AGPL 的尽力而为免责声明。)
🔒 SP/1.0 —— 一致性标准
SHACKLE 不仅是运行时断路器,还是一项经编写、可验证的 Agent 工具调用运行时调解一致性标准。
- 决策表面:
ALLOW/DENY/HITL - 一致性模型:
Valid(τ) ⇔ Required(τ) ⊆ Supported(τ) fixtures/conformance.json中包含 15 个可通过哈希验证的一致性向量 —— 10 个决策核心案例,以及 5 个人在回路(HITL)转换案例(批准 / 拒绝 / 修改 / 延后升级 / 重复恢复)- 纯参考实现:
shackle/conformance.py—— 仅使用标准库的decide(config, state, call) -> (verdict, reason) - 可执行证明:
pytest tests/test_conformance.py针对参考实现运行每个向量 - 核心不变量: 历史可见 ≠ 运行时可执行 —— 一项操作曾发生过的记录,并不能证明该转换受到支持
一个运行时当且仅当通过已发布的测试夹具集时,才是符合 SHACKLE 标准的——可通过复现而非声明加以证明。有关完整规范及如何声明一致性,请参阅 CONFORMANCE.md。夹具哈希已由第三方独立复现。
各层分别是什么:
shackle/conformance.py+fixtures/conformance.json构成经过一致性验证的层——即编写的规范、15 个可通过哈希验证的向量,以及参考decide()。shackle/core.py是已交付的运行时集成(@Guard装饰器):它将其在线TriggerEngine/ExecutionState映射至decide()的(config, state, call)契约,并在每次被评估的工具调用和每次 LLM 调用时查询_同一个_参考decide(),将裁决记录在state.last_decision中。因此,“符合 SP/1.0”指的是规范、夹具以及已交付运行时实际调用的参考实现——一个决策表面,而不是两个恰好得出相同结论的实现。
**作者身份与来源:**SHACKLE、Required ⊆ Supported 一致性模型、decide() 表面及 HITL 转换契约,均由唯一作者 Dante Bullock (@Fame510) 编写。首次发布于 2026-06-17。
📜 SP/1.0 到底是什么
SP/1.0(SHACKLE Protocol 1.0)是一项针对自主 AI Agent 操作运行时调解的一致性标准。 简单来说:它以精确且任何人都能独立验证的方式,定义了一个系统如何正确决定 Agent 是否被_允许_执行下一项操作。
每个 AI Agent 在每一步都将要做某件事:调用工具、消耗预算、调用另一个 Agent、执行交易。SP/1.0 规范的就是这个时刻。它规定了其他 Agent 框架都未作为可验证契约明确界定的三件事:
- 决策表面 ——
ALLOW/DENY/HITL。 每个被调解的操作都会且只能得到一种裁决:允许、拒绝,或暂停等待人工处理。不存在第四种状态,也不存在歧义。每项裁决都带有确定且可检查的理由。 - 一致性模型 ——
Valid(τ) ⇔ Required(τ) ⊆ Supported(τ)。 当且仅当一项转换所需的一切,都在系统可证明支持的范围内,该转换才有效。这是该标准的数学主干:能力是一种集合关系,而不是承诺。 - 核心不变量 —— 历史可见 ≠ 运行时可执行。 某项操作被记录、恢复或重放的事实,并不证明它曾获授权。被拒绝或延后的操作再次出现时,应被拒绝,而非放行。这一条规则封堵了 Agent 通过“恢复”绕过自身护栏的一类故障。
SP/1.0 以 15 个可通过哈希验证的一致性向量的形式发布(fixtures/conformance.json)——包括 10 个决策核心案例和 5 个人在回路转换案例(批准 / 拒绝 / 修改 / 延后升级 / 重复恢复)——并提供仅使用标准库的参考实现(shackle/conformance.py)。你不必凭信任接受这项标准,而是运行它。 pytest tests/test_conformance.py 会针对参考实现执行每个向量,且该参考实现通过了自己的测试套件——经过验证,而非自行宣称。
🎓 获得 SHACKLE 认证意味着什么
SHACKLE 认证是运行时正确执行 SP/1.0 调解契约的证明,而非承诺。 它完全依据公开、可通过哈希验证的测试夹具进行衡量。用于认证的向量,也正是其他任何人都可以重新运行以验证你的声明的向量。不存在私密审计、要求用户信任的认证印章或付费即通过:认证就是复现。
对于买方而言,“SHACKLE Certified”回答了每个严肃的采购方、企业和监管机构最终都会就自主系统提出的问题:“你能否证明它只做被允许做的事,而不会做其他事?” 获得认证的运行时可以做到。只需几分钟,基于一个干净的克隆即可完成。
认证等级
| 等级 | 名称 | 保证内容 |
|---|---|---|
| SP/1.0-Core | 核心一致性 | 运行时将每个被调解的操作解析为正确的 ALLOW / DENY / HITL 裁决,并提供正确的拒绝理由。决策表面是可靠的。 |
| SP/1.0-HITL | 转换完整 | 在核心一致性的基础上,正确处理每种人工在回路转换:批准、拒绝、修改、延后升级和重复恢复。被拒绝与延后的操作可被证明无法通过重放而执行。 |
| SP/1.0-Sovereign | 企业运行时 | 在 HITL 的基础上,增加原子化守护进程状态、防篡改账本记录和审计导出。企业或收购方可据此追责的完整问责层。 |
如何获得认证(今天向任何运行时开放)
- 运行测试套件以测试你的运行时:
pytest tests/test_conformance.py和pytest v2/tests/test_conformance.py。 - 收集证据。 SHACKLE 会为每个夹具输出通过/失败报告,并附上其验证所依据的夹具哈希。该报告_就是_你的一致性证明材料——任何人都可独立复现。
- 提交以申请列名。 使用你的报告和公开、可复现的证据链接,提交 认证请求。自动检查会重新运行公开夹具;维护者将在列名之前进行验证。
- 获得列名。 已验证的运行时将出现在公开的 SHACKLE 一致性注册表 中,列出所获等级、SP/1.0 版本和日期,并可展示 SP/1.0 Certified 徽章。
一项开放标准,一扇开放之门
SP/1.0 是一项中立、公开的标准。任何 Agent 运行时——包括竞争框架和竞争性安全产品——都受邀使用它测试并申请列入注册表。夹具是公开的,裁决是确定的,注册表是开放的。我们以要求其他所有人遵守的同一标准要求自己的参考实现,并公布夹具,使相关声明可被核验。
这就是全部理念:标准的价值,只取决于它能够承受怎样的检验。 如果一个运行时符合标准,注册表会证明这一点;如果不符合,夹具会准确展示问题所在。无论哪种情况,衡量标准都是公开的,并且对所有人一视同仁。
集成(LiteLLM + AutoGen)
SHACKLE 现为 Agent 技术栈中最关键的瓶颈节点提供一流治理能力。完整用法及 LiteLLM 代理 config.yaml 示例,请参阅 INTEGRATIONS.md。
- LiteLLM 护栏(
shackle/litellm_shackle_guardrail.py)——在任何由 LiteLLM 驱动的 Agent(CrewAI、AutoGen、LangGraph、自定义框架)上执行 SP/1.0:ShackleGuardrail—— 选项 A,直接由纯 SP/1.0 参考decide()支持(严格符合一致性、依赖轻量)。ShackleEngineGuardrail—— 选项 B,由完整TriggerEngine驱动(有状态的预算 / 重复调用 / 超时控制)。- 两者均为 SDK 提供同步
check()/record(),并为 LiteLLM 代理提供async_pre_call_hook/async_post_call_success_hook。litellm是可选依赖项。
- AutoGen 包装器(
shackle/autogen_shackle_wrapper.py)——通过相同引擎治理 AutoGen 工具调用的wrap_tool装饰器和create_shackle_agent工厂。AutoGen 是可选依赖;wrap_tool无需 AutoGen 也可使用。
一个集成即可覆盖整个供应链:由于 LiteLLM 位于大多数 Agent 框架之下,该护栏可通过单一瓶颈节点治理这些框架。所有决策均可追溯至 fixtures/conformance.json 中经哈希固定的夹具。
来源
SHACKLE 由来自加利福尼亚州奥克兰的 52 岁自学成才系统架构师兼工程师 Dante Bullock 开发。没有风险投资,没有企业孵化器。只有切实的需求,以及拒绝眼看自主 Agent 在无声的无限循环中烧掉资金的决心。
Sovereign Logic 并未猜测 Agent 生态需要什么,而是使用实时网页抓取和社区情绪挖掘,审查 CrewAI、AutoGen 和 LangGraph 的问题跟踪器——梳理影响生产环境开发者的确切系统性故障,随后构建可直接接入的断路器来解决这些问题。
这是由开发者为开发者打造的基础设施——自主、精简、零臃肿。
🎯 何时使用 SHACKLE
SHACKLE 专为以下场景设计:
- 本地开发和调试 —— 交互式 HITL 控制台赋予你实时控制能力
- CLI Agent 和受监督工作流 —— 在检测到循环时可恢复 / 跳过 / 中止
- 跨框架覆盖 —— 一个装饰器即可在 CrewAI、LangGraph 和 AutoGen 之间使用
- 预算执行 —— 客户端 token 跟踪可防止成本失控
- 迭代测试 —— 在开发周期的早期发现循环
对于无头生产 API(无服务器函数、FastAPI 端点、后台工作线程等不适合阻塞等待人工输入的场景),可考虑 TokenCircuit 等框架原生解决方案,以实现自动化 LangGraph 覆盖。
SHACKLE 与面向生产的工具解决的是互补问题:在开发和测试期间使用 SHACKLE;如有需要,在已部署的 API 中转向自动化覆盖机制。
⚡ 问题
AI Agent 能力很强,但其错误处理机制存在根本缺陷。当 Agent 遇到未处理的工具错误(401 Unauthorized、变更的 API payload、失效端点)时,它很少会自我纠正。相反,它会进入**“死亡循环”(Loop of Death)**——以完全相同的输入重试完全相同的工具,在几分钟内耗尽上下文窗口并累积巨额 API 账单。
CrewAI、AutoGen 和 LangGraph 等框架缺少原生、跨框架的支出护栏或确定性的循环断路机制。
🛡️ 解决方案
SHACKLE 是一层轻量、零依赖的治理层,通过动态 Python shim 置于你的运行时内部。它在客户端拦截 LLM 调用和工具执行,以确定性方式监控执行状态。
当 Agent 越过你设定的边界时,SHACKLE 会触发断路器、停止执行,并让你进入交互式终端控制台。
核心特性
- 一行安装 —— 无需重构你的 Agent 拓扑
- 防止死亡循环 —— 检测连续的相同工具调用和错误级联
- 预算执行 —— 基于客户端价格表实时跟踪 token 使用量
- 执行超时 —— 防止失效 API 导致线程挂起
- HITL 控制台 —— 提供恢复 / 跳过 / 中止选项的交互式终端
- 100% 客户端运行 —— 无遥测、无回传、无隐藏 SaaS
🚀 快速开始
1. 安装
**注意:**PyPI 版本正在发布中。在
pip install shackle可用之前,请直接从源码安装(目前即可使用):
# From source (available now)
git clone https://github.com/Fame510/SHACKLE.git
cd SHACKLE
pip install -e .
# Or, once published to PyPI:
pip install shackle
2. 为你的工作流添加防护
from shackle import Guard
from crewai import Crew, Agent, Task
# Your normal CrewAI setup
my_crew = Crew(agents=[...], tasks=[...])
# One line to add circuit breaking
@Guard(budget=0.25, max_repeat_calls=3, timeout_seconds=180)
def run():
return my_crew.kickoff()
run()
就是这样。SHACKLE 会动态挂接底层解释器——无需修改 CrewAI 源码。
⚙️ 四重断路器
English / 原文
⛓️ SHACKLE
The runtime governance layer — and the SP/1.0 conformance standard — for autonomous AI agents. SHACKLE mediates every agent tool call in real time: runaway token loops, unhandled tool cascades, and budget overruns are stopped before the next call fires. It is live, it runs today, and its reference implementation provably passes its own conformance suite. This is not a proposal or a prototype — it is a working standard you can run, verify, and be certified against. (Cost is read from usage after each call, so SHACKLE halts the loop, not the single call that crossed the line; see the AGPL best-effort disclaimer below.)
🔒 SP/1.0 — The Conformance Standard
SHACKLE is not only a runtime circuit breaker — it is the authored, verifiable conformance standard for runtime mediation of agent tool calls.
- Decision surface:
ALLOW/DENY/HITL - Conformance model:
Valid(τ) ⇔ Required(τ) ⊆ Supported(τ) - 15 hash-verifiable conformance vectors in
fixtures/conformance.json— 10 decision-core + 5 HITL transition cases (approve / reject / modify / defer-escalate / duplicate-resume) - Pure reference implementation:
shackle/conformance.py— a stdlib-onlydecide(config, state, call) -> (verdict, reason) - Executable proof:
pytest tests/test_conformance.pyruns every vector against the reference - Core invariant: history-visible ≠ runtime-executable — a record that an action happened is not proof the transition was supported
A runtime is SHACKLE-conformant iff it passes the published fixture set — provable by reproduction, not assertion. See CONFORMANCE.md for the full specification and how to claim conformance. The fixture hashes have been independently reproduced by third parties.
Which layer is which:
shackle/conformance.py+fixtures/conformance.jsonare the conformance-verified layer — the authored spec and its 15 hash-verifiable vectors, with a referencedecide().shackle/core.pyis the shipped runtime integration (the@Guarddecorator): it maps its liveTriggerEngine/ExecutionStateontodecide()'s(config, state, call)contract and consults the same referencedecide()on every evaluated tool call and every LLM call, recording the verdict onstate.last_decision. So "SP/1.0-conformant" refers to the spec, the fixtures, and the reference implementation the shipped runtime actually calls — one decision surface, not two implementations that happen to agree.
Authorship & provenance: SHACKLE, the Required ⊆ Supported conformance model, the decide() surface, and the HITL transition contract are authored by Dante Bullock (@Fame510), sole author. First published 2026-06-17.
📜 What SP/1.0 Actually Is
SP/1.0 (SHACKLE Protocol 1.0) is a conformance standard for runtime mediation of autonomous AI agent actions. In plain terms: it defines — precisely, and in a way anyone can independently verify — what it means for a system to correctly decide whether an agent is allowed to take its next action.
Every AI agent, at every step, is about to do something: call a tool, spend budget, invoke another agent, execute a transaction. SP/1.0 governs that moment. It specifies three things no other agent framework pins down as a verifiable contract:
- The decision surface —
ALLOW/DENY/HITL. Every mediated action resolves to exactly one verdict: allow it, deny it, or halt for a human. There is no fourth state and no ambiguity. Each verdict carries a deterministic, inspectable reason. - The conformance model —
Valid(τ) ⇔ Required(τ) ⊆ Supported(τ). A transition is valid if and only if everything it requires is within what the system provably supports. This is the mathematical spine of the standard: capability is a set relationship, not a promise. - The core invariant — history-visible ≠ runtime-executable. The fact that an action is recorded, resumed, or replayed is not evidence that it was ever authorized. A rejected or deferred action that comes back around is denied, not waved through. This single rule closes the class of failures where agents "resume" their way past their own guardrails.
SP/1.0 ships as 15 hash-verifiable conformance vectors (fixtures/conformance.json) — 10 decision-core cases plus 5 human-in-the-loop transition cases (approve / reject / modify / defer-escalate / duplicate-resume) — and a stdlib-only reference implementation (shackle/conformance.py). You do not take the standard on faith. You run it. pytest tests/test_conformance.py executes every vector against the reference, and the reference implementation passes its own suite — verified, not asserted.
🎓 What It Means to Be SHACKLE Certified
SHACKLE Certification is proof — not a promise — that a runtime correctly enforces the SP/1.0 mediation contract. It is measured entirely against the public, hash-verifiable fixtures. The same vectors that certify you are the ones anyone else can re-run to check your claim. There is no private audit, no trust-us seal, no pay-to-pass: certification is reproduction.
For a buyer, "SHACKLE Certified" answers the question every serious acquirer, enterprise, and regulator eventually asks about an autonomous system: "Can you prove it does what it's allowed to do — and nothing else?" A certified runtime can. In minutes. From a clean clone.
Certification Levels
| Level | Name | What it guarantees |
|---|---|---|
| SP/1.0-Core | Core Conformance | The runtime resolves every mediated action to the correct ALLOW / DENY / HITL verdict, with the correct deny reason. The decision surface is sound. |
| SP/1.0-HITL | Transition-Complete | Core, plus correct handling of every human-in-the-loop transition: approve, reject, modify, defer-escalate, and duplicate-resume. Rejected and deferred actions provably cannot execute by being replayed. |
| SP/1.0-Sovereign | Enterprise Runtime | HITL, plus atomic daemon state, tamper-evident ledgering, and audit export. The full accountability layer an enterprise or acquirer can hold to account. |
How to Get Certified (open to any runtime, today)
- Run the suite against your runtime:
pytest tests/test_conformance.pyandpytest v2/tests/test_conformance.py. - Capture the evidence. SHACKLE emits a per-fixture pass/fail report with the fixture hashes it verified against. That report is your conformance artifact — independently reproducible by anyone.
- Submit for listing. Open a certification request with your report and a public, reproducible evidence link. An automated check re-runs the public fixtures; a maintainer verifies before listing.
- Get listed. Verified runtimes appear in the public SHACKLE Conformance Registry with the level achieved, SP/1.0 version, and date — and may display the SP/1.0 Certified badge.
An open standard, an open door
SP/1.0 is a neutral, public standard. Any agent runtime — including competing frameworks and competing safety products — is invited to test against it and be listed. The fixtures are public. The verdicts are deterministic. The registry is open. We hold our own reference implementation to exactly the bar we ask of everyone else, and we publish our fixtures so the claim is checkable.
That is the entire philosophy: a standard is only worth what it can withstand. If a runtime conforms, the registry proves it. If it doesn't, the fixtures show exactly where. Either way, the measure is public and the same for everyone.
Certify your agents. → Run the fixtures · Get listed · View the registry
Integrations (LiteLLM + AutoGen)
SHACKLE now ships first-class governance for the biggest chokepoints in the agent stack. See INTEGRATIONS.md for full usage and LiteLLM proxy config.yaml examples.
- LiteLLM guardrail (
shackle/litellm_shackle_guardrail.py) — enforce SP/1.0 on any LiteLLM-powered agent (CrewAI, AutoGen, LangGraph, custom):ShackleGuardrail— Option A, backed directly by the pure SP/1.0 referencedecide()(conformance-exact, dependency-light).ShackleEngineGuardrail— Option B, driven by the fullTriggerEngine(stateful budget / repeat / timeout).- Both provide sync
check()/record()for the SDK andasync_pre_call_hook/async_post_call_success_hookfor the LiteLLM proxy.litellmis an optional dependency.
- AutoGen wrapper (
shackle/autogen_shackle_wrapper.py) —wrap_tooldecorator +create_shackle_agentfactory that govern AutoGen tool calls through the same engine. AutoGen is optional;wrap_toolworks without it.
One integration = coverage for the whole supply chain: because LiteLLM sits under most agent frameworks, the guardrail governs them through a single chokepoint. All decisions trace to the hash-pinned fixtures in fixtures/conformance.json.
Provenance
SHACKLE was built by Dante Bullock , a 52-year-old self-taught systems architect and engineer out of Oakland, California. No venture capital. No corporate incubator. Just raw necessity and a refusal to watch autonomous agents burn money in silent infinite loops.
Rather than guessing what the agent ecosystem needed, Sovereign Logic used real-time web scraping and community sentiment mining to audit the issue trackers of CrewAI, AutoGen, and LangGraph — mapping the exact systemic failures affecting developers in production, then building the drop-in circuit breaker to fix them.
This is infrastructure built by a developer, for developers — sovereign, lean, and zero-bloat.
🎯 When to Use SHACKLE
SHACKLE is purpose-built for:
- Local development and debugging — Interactive HITL console gives you real-time control
- CLI agents and supervised workflows — Resume/Skip/Abort when loops are detected
- Cross-framework coverage — One decorator works across CrewAI, LangGraph, and AutoGen
- Budget enforcement — Client-side token tracking prevents runaway costs
- Iterative testing — Catch loops early in the development cycle
For headless production APIs (serverless functions, FastAPI endpoints, background workers where blocking for human input isn't an option), consider framework-native solutions like TokenCircuit for automated LangGraph overrides.
SHACKLE and production-oriented tools solve complementary problems: use SHACKLE during development and testing, then transition to automated overrides for deployed APIs if needed.
⚡ The Problem
AI agents are highly capable, but their error-handling is fundamentally broken. When an agent hits an unhandled tool error (401 Unauthorized, changed API payload, dead endpoint), it rarely self-corrects. Instead, it enters a "Loop of Death" — retrying the exact same tool with the exact same input, burning your context window and running up massive API bills in minutes.
Frameworks like CrewAI , AutoGen , and LangGraph lack native, framework-agnostic spending guardrails or deterministic loop breakers.
🛡️ The Solution
SHACKLE is a lightweight, zero-dependency governance layer that sits inside your runtime via dynamic Python shims. It intercepts LLM calls and tool executions client-side, monitoring execution state deterministically.
When an agent breaches your boundaries, SHACKLE trips the circuit breaker, halts execution, and drops you into an interactive terminal console.
Key Features
- 1-Line Install — no refactoring your agent topology
- Loop of Death Prevention — detects identical sequential tool calls and error cascades
- Budget Enforcement — real-time token tracking against a client-side pricing table
- Execution Timeouts — prevents hung threads on dead APIs
- HITL Console — interactive terminal with Resume / Skip / Abort options
- 100% Client-Side — no telemetry, no phone-home, no hidden SaaS
🚀 Quick Start
1. Install
Note: the PyPI release is being published. Until
pip install shackleis live, install directly from source (works today):
# From source (available now)
git clone https://github.com/Fame510/SHACKLE.git
cd SHACKLE
pip install -e .
# Or, once published to PyPI:
pip install shackle
2. Guard Your Workflow
from shackle import Guard
from crewai import Crew, Agent, Task
# Your normal CrewAI setup
my_crew = Crew(agents=[...], tasks=[...])
# One line to add circuit breaking
@Guard(budget=0.25, max_repeat_calls=3, timeout_seconds=180)
def run():
return my_crew.kickoff()
run()
That's it. SHACKLE dynamically hooks the underlying interpreters — no CrewAI source changes needed.
⚙️ The Four Circuit Breakers
| Trigger | Condition | Default | What Happens |
|---|---|---|---|
| REPETITIVE_TOOL_CALL | Same tool + same input called N times, or input contains error signals | 3 attempts | Drops to HITL console |
| BUDGET_EXCEEDED | Accumulated token cost exceeds limit (via local pricing table) | $0.20 | Hard execution freeze |
| TIMEOUT_REACHED | Wall-clock execution exceeds threshold | 180 seconds | Immediate halt |
| MAX_TOOL_CALLS | Total tool invocations exceed limit | 50 calls | Hard stop |
Error Loop Amplification
SHACKLE amplifies sensitivity when tool inputs contain error signals (401, 500, timeout, unauthorized, etc.) — catching the "I'll just try again" loop before the agent burns tokens on a permission error it can't fix.
🛠️ The HITL Console
When a breaker trips, SHACKLE renders an interactive terminal:
⛓️ SHACKLE CIRCUIT BREAKER: REPETITIVE_TOOL_CALL
Agent: ResearchAgent
Tool: web_search
Input: {"query": "latest AI news", "error": "401 Unauthorized"}
Call Count: 3x
━━━ Session Stats ━━━
Tokens: In: 8,400 | Out: 1,200
Session Cost: $0.02850
Time Running: 47.2s
Options:
[R] Resume/Reset — clear history, continue execution
[S] Skip — return dummy output, attempt context flush
[A] Abort — hard terminate the current run
Select action (R/S/A):
🔌 Works With
| Framework | Support | Notes |
|---|---|---|
| CrewAI | ✅ Full | litellm hook + BaseTool hook + Agent.execute_task (experimental) |
| LangChain / LangGraph | Sync + async | litellm (completion/acompletion) + BaseTool (run/arun) hooks cover sync and async paths |
| AutoGen | ✅ Full | litellm interception catches all LLM calls |
| Smolagents | 🧪 Experimental | Manager Agent reasoning loop detection active |
🚀 V2: Enterprise Runtime Sovereignty Layer (Optional)
For production deployments requiring distributed state , compliance audit logs , or remote agent control , see v2/README.md.
V2 adds:
- ✅ Distributed budget tracking (across serverless functions, Lambda, K8s)
- ✅ Postgres audit logs (cryptographically signed, SOC2-ready)
- ✅ Remote HITL control (manage headless agents from mobile/web)
- ✅ Commercial licensing (for closed-source products)
V1 (this) is always free and perfect for local development. V2 is an optional upgrade for enterprise production use.
🔮 Roadmap
💰 Commercial Licensing
SHACKLE is open-source under AGPLv3 — free for individual developers, hobbyists, and open-source projects. If you're using SHACKLE in a closed-source commercial product, SaaS platform, or enterprise deployment, the AGPLv3 requires you to open-source your entire application. Most companies don't want to do that — so they purchase a commercial license instead.
What a Commercial License Gets You
| AGPLv3 (Free) | Commercial License
---|---|---
Use in closed-source products | ❌ | ✅
White-label / rebrand | ❌ | ✅
No copyleft obligations | ❌ | ✅
Priority support | Community | SLA-backed
Custom integration assistance | Self-serve | Architecture audit
Licensing Options
Commercial licensing is available for:
- Developer / Startup teams shipping closed-source agent products
- Enterprise deployments requiring on-prem, SOC2 compliance, or SLA support
- Framework companies (CrewAI, LangGraph, etc.) wanting white-label integration
Pricing is customized based on your needs, team size, and deployment scale.
📧 Contact for pricing: docspoc101@gmail.com
⚠️ Disclaimer of Liability
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
BY USING THIS SOFTWARE, YOU ACKNOWLEDGE THAT LLM ORCHESTRATION IS INHERENTLY NON-DETERMINISTIC. SHACKLE IS A BEST-EFFORT CIRCUIT BREAKER AND DOES NOT GUARANTEE PREVENTING ALL API SPEND OVERRUNS. YOU REMAIN SOLELY RESPONSIBLE FOR MONITORING YOUR OWN API LIMITS AND USAGE BILLS.
📄 License
Copyright (C) 2026 Dante Bullock, Sovereign Logic.
Licensed under the GNU Affero General Public License v3.0 (AGPLv3). See LICENSE for full terms.
Using SHACKLE in a closed-source product? Contact us for commercial licensing.
👤 Creator
Dante Bullock — 52-year-old self-taught systems architect from Oakland, California. Founder of Sovereign Logic. Built SHACKLE out of raw necessity after watching autonomous agents burn thousands in silent API loops with no native circuit breaker in sight.
"I don't wait for VC validation. I scrape issue trackers, find the bleeding, and build the tourniquet."
GitHub: @Fame510 Contact: docspoc101@gmail.com
🤝 Contributing
Pricing Table Updates
As model providers update pricing, submit PRs to shackle/core.py → MODEL_PRICING. Contributors who submit verified pricing updates get credited in release notes.
Adding Framework Hooks
SHACKLE's architecture supports pluggable runtime hooks. To add support for a new framework:
- Add a
_patch_<framework>()function following the pattern incore.py - Register it in
_apply_patches() - Submit a PR with integration tests
💼 Commercial Support (optional)
SHACKLE is free and open source (AGPLv3). If you want hands-on help deploying it in your stack, paid implementation and architecture-audit support is available.
I fix this. Today.
If your CrewAI / LangGraph / AutoGen agents are burning money in loops and you need a solution deployed by someone who understands the internals — not a generic consultant who'll Google "what is CrewAI" on your dime:
Production & Implementation Inquiries
Deploying SHACKLE in production, or need your runtime certified against the SP/1.0 fixtures? This is a conversation, not a checkout.
📧 docspoc101@gmail.com — architecture audits, custom configuration, and conformance guidance for teams shipping agent products.
You'll speak directly to the engineer who authored the standard.