TrustLog Dynamics: Python Daemon Uses Bond Math to Kill Rogue AI Agents

TrustLog Dynamics is an open-source Python daemon that monitors AI agent API costs in real time and terminates rogue processes using detection methods borrowed from quantitative finance. The tool addresses the problem of AI agents spending money continuously without oversight, drawing inspiration from trading floor circuit breakers.
Detection Methods
The daemon uses two specific detection algorithms:
- Convexity detection (
d²C/dt² > 0) — borrowed from fixed-income risk management. When cumulative cost accelerates over time (snowballing), the daemon kills the agent at the inflection point. - Zero-variance detection (
σ² < ε) — borrowed from statistical process control. When rolling cost variance drops to near zero, indicating the agent is stuck in a mechanical loop, the daemon severs the connection.
Testing Results
The developer tested TrustLog Dynamics live against two AI models:
- Claude 4.6 Sonnet (context window explosion) — caught and terminated
- Gemini 3.1 Pro (retry loop) — caught and terminated
Both interceptions were recorded on video: Claude intercept and Gemini intercept.
Installation and Deployment
The tool requires three commands to install and runs as a systemd daemon. It's released under MIT license with source code available at GitHub.
The developer positions this as a financial governance layer for AI agents, inspired by NVIDIA's NemoClaw for network security and Jensen Huang's recent comments about OpenClaw strategies. The approach uses mathematics that has been protecting capital markets for decades.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Agent Times Skill for ClawHub Adds Real-Time News, Weather, and Token Price Queries
A new ClawHub skill called Agent Times enables AI agents to answer real-time queries about news, weather, and cryptocurrency prices. Installation is via npx clawhub install agenttimes, and it provides access to 228K+ articles from 3,576 feeds with sentiment scoring and entity extraction.

PreToolUse Hook Fixes Claude Code Image Crash Problem
A developer created a PreToolUse hook that intercepts Claude Code's Read calls on images, converts them safely, and proxies them through a Haiku subprocess to prevent API Error 400 crashes from problematic images.

QCAI Mobile App Adds OpenClaw Gateway Control with Native Tailscale VPN
QCAI for iOS and Android now integrates with OpenClaw Control Center, allowing direct gateway management from mobile devices via secure Tailscale VPN tunnels without open ports.

Galadriel: Open-Source Warm-Cache Harness for Persistent Claude Agents
Galadriel is a 3-tier stacked caching harness for Claude that reduces costs by 87% and latency to under 3s for 100K token prompts. Integrates MemPalace for persistent vector memory.