Mimo Stable
Mimo-stable: cross-model guardrails that detect LLM degenerate loops — repeated outputs, repeated tool calls, and language drift — with engineering-side circuit breakers so runaway agents stop instead of burning tokens.
$3
Works with the AI Agents you already use
mimo-stable
Example session with this skill installed
Analyze this log for loops: [exec('ls'), exec('ls'), exec('ls')] and verify if we hit the threshold.
- Read your context and instructions
- Compiled the mimo-stable
The detection script has processed the input stream. A degenerate loop was identified based on Rule 2 (Identical Tool Calls) exceeding the threshold of 3 consecutive matches.
Detection Summary
| Metric | Value | Status |
|---|---|---|
| Detection Trigger | Identical Tool Parameters | CRITICAL |
| Consecutive Count | 3 | THRESHOLD MET |
| Similarity Score | 1.0 (Exact Match) | FAILED |
| Action Recommended | Engineering-side Stop | TRIGGERED |
{
"loop_detected": true,
"reason": "repeated_tool_calls",
"details": {
"tool": "exec",
"params": "{\"cmd\": \"ls\"}",
"occurrences": 3,
"timestamp_start": "2023-10-27T10:00:05Z",
"timestamp_end": "2023-10-27T10:00:12Z"
},
"recovery_hint": "Switch model or inject system message to break state."
}
Next steps
- Immediately terminate the current task runner process to prevent token waste.
- Review the
AGENTS.mdrecovery strategy to implement a model switch for the next request. - Adjust
detect_loop.pythreshold to 2 if this specific tool requires stricter idempotency.
Connects securely to your tools. The creator never sees your data.
About this skill
LLM Degenerate Loop Guardrails provides a programmatic safety net for developers facing model degradation issues like infinite loops and repetitive tool calls. When models collapse into repeating the same text or redundant API calls, they drain tokens and increase latency without making progress. This skill offers a structured detection and engineering-side mitigation framework to identify these failures in real-time.
What it does
- Text Loop Detection monitors output blocks for identical or highly similar content (≥95% similarity) using SequenceMatcher.
- Tool Call Auditing catches instances where a model invokes the same tool with identical parameters three or more times consecutively.
- Language Drift Monitoring alerts when a model ignores system prompts by switching from Chinese to English unexpectedly.
- Automated Exit Signaling triggers engineering-side stop signals based on customizable thresholds for time and repetition.
How it works
- Integration Pipe your runner's output stream into the
detect_loop.pyscript or point it at a session log file. - Configuration Set detection thresholds for similarity, repetition counts, and timeouts (defaulting to 3 blocks and 180 seconds).
- Execution The detector analyzes input blocks or JSON log summaries for patterns of probability collapse.
- Reporting Receive a
LOOP_DETECTEDstatus or a JSON summary to trigger upstream logic like task termination or model switching.
Frameworks & tools
This tool relies on Python 3 and the difflib.SequenceMatcher library. It is designed to work as a CLI utility compatible with any LLM runner that supports standard output piping or JSON logging.
Why this beats prompting it yourself
Prompting a model not to loop is often ineffective once it has already entered a degenerate state. This skill provides an external, deterministic logic layer that monitors the model from the outside, ensuring a hard stop when internal guardrails fail.
Use cases
- Production Monitoring to stop runaway agents before they consume excessive API credits.
- CI/CD Testing to catch model regressions or "hallucination loops" during automated evals.
- Tool Call Debugging to identify when an agent is stuck trying to execute the same failing command.
Known limitations
The system is detection-only and does not automatically terminate processes or switch models. Language detection requires explicit configuration via the --expect-language flag to prevent false positives in coding tasks.
Function-call record format: one call per line; only whitespace is allowed after the closing parenthesis on the same line (e.g. write({...}); is skipped and not counted as a call). A { on the line immediately after write( is supported; if a blank line separates them, CLI and API call counts may differ.
Only detects and reports; does not auto-terminate processes. Language drift detection requires manual language flags. Thresholds may require per-model calibration.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Requires