AI Agent Hub
Back to plugins
🧩

dsh-agent-loop-guard

admin-security Updated 2026.09.03

Run the following command in DeepSeek Harness:

dsh plugin install GooDAnDReaDY/dsh-agent-loop-guard

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install GooDAnDReaDY/dsh-agent-loop-guard in your DeepSeek Harness terminal to install the plugin; the source code is hosted at https://github.com/GooDAnDReaDY/dsh-agent-loop-guard .

About this plugin

Autonomous AI coding agents that hit tool failures, ambiguous instructions, or hallucination loops can easily spin into infinite retry cycles — re-reading the same directory, editing identical lines, or echoing the same streaming text across turns — burning through token budgets and locking execution threads without ever completing the user goal. dsh-agent-loop-guard is a native DeepSeek Harness runtime plugin that intercepts these spirals before they run out of control, steering the agent into a graceful text-only answer when progress stalls. Three core capabilities drive the plugin: a progress-aware tool-call guard that uses epoch-based state tracking to distinguish productive iteration from stagnant repetition and blocks a call only when no new evidence appears; a real-time assistant output stream guard that detects repeated lines and multi-line block repetitions and cleanly cancels runaway generation while preserving session history; and an Answer-Only graceful fallback that issues structured DSH denials guiding the model to explain the bottleneck in prose rather than terminating abruptly. All diagnostic logs automatically redact Bearer tokens, passwords, and secret query parameters, making the plugin safe to enable in production and enterprise environments. It is designed for teams running DeepSeek Harness workspaces where long autonomous coding sessions regularly consume API credits on unproductive loops, and for operators who need a fail-closed safety net without modifying the Harness core.

Use Cases

  • When autonomous coding agents enter infinite read-edit retry loops
  • When assistant output streams repeat identical lines or blocks across turns
  • When production workspaces need protection against unproductive API credit burn

Best For

  • Workspace administrators running DeepSeek Harness
  • DevOps teams managing autonomous agent sessions
  • Operations teams requiring enterprise-grade log redaction and compliance