Make your AI agent self-heal — auto-diagnose every error and apply safe fixes, gated. Snapback interceptor for OpenClaw and any Python agent.
pip install snapback-selfheal Copy PIP instructions
Make Snapback automatic. Instead of remembering to call the diagnosis tool, wrap your agent's tool calls once — and every error is auto-diagnosed, and gated-safe fixes are applied and retried without a human.
"Power tools are optional. Infrastructure is not." This turns Snapback from a tool you reach for into infrastructure that runs on every failure.
It fails closed: when unsure, it escalates rather than acting.
# no install needed beyond the stdlib; drop the file in, or: cp snapback_interceptor.py your_agent/ export SNAPBACK_MCP=https://api.snapback.sh/mcp # default; the free tools need no token Use from snapback_interceptor import SnapbackInterceptor heal = SnapbackInterceptor( auto_apply=True, on_escalate=lambda v: my_ops_inbox.log(v), # human sees non-auto-safe verdicts on_heal=lambda v: metrics.count("snapback.autoheal", family=v["family"]), ) # wrap any call that might raise: result = heal.run(call_solana_rpc, wallet, amount) # or as a decorator: @heal.guard def call_solana_rpc(wallet, amount): ... # or manually on a caught error: verdict = heal.diagnose("BlockhashNotFound") if verdict["gate"]["auto_apply_ok"]: ...apply verdict["fix"] and retry... The gate contract (returned by Snapback) diagnose_infra_error returns {matched, family, fix, confidence, source, action_class, auto_safe, gate}. action_class is one of:
gate.auto_apply_ok is the ready-made verdict; the interceptor also re-derives it locally so a stale client can't over-trust.
ai-agent self-healing agentops openclaw error-recovery mcp snapback
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.




