loop-guardrail
Repetitive execution loop detector for AI agents. Tracks tool-call signatures across a session, warns when the same call is repeated, and hard-stops when a call has failed too many times in a row — protecting against runaway tool loops that would otherwise burn tokens and money.
Canonicalizes JSON tool arguments (recursive key sort) so semantically identical calls always hash to the same signature.
Installation
Usage
use ;
use json;
let config = ToolCallGuardrailConfig ;
let mut ctrl = new;
let decision = ctrl.before_call;
if decision.allows_execution
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.