Preface¶
In DeepSeek Harness (DSH) workflow development, agent deviation from the task trajectory or behavioral degradation is a common issue. dsh-trajectory-anchor is a plugin designed to address this problem. It prevents agents from straying from the task by locking in initial behavior, monitoring the trajectory at every step, and intervening when degradation occurs.
Plugin Positioning¶
This is a workflow plugin maintained by ggfgfgf-on. It is a standalone DSH bundle used for the observation, anchoring, and auditing of single-agent trajectories.
Core Features¶
The plugin provides four core capabilities:
- Observation & audit: Tokenization-weight-based trajectory scoring for every step (e.g., “I/Let me” ratio, persona band, session-local baseline percentiles, EWMA), evidence capture (verify/edit/complete declarations), and generation of an append-only audit log (
<workspace>/.dsh-trajectory-logs/anchor-<agentId>.jsonl). - First-round anchoring: Applies a three-part mechanism on the first-round request: bootstrap tool allowlist (
bash/str_replace_editor/pwsh), minimum persona, and runtime context + skill catalog suppression. The tool surface is derived during assembly (ungated requests receive only the bootstrap allowlist). - Two behavioral reminders:
- L1 pullback: Triggered on scope violations or code edits after the last verification, suggesting explicit exemptions.
- L2’ confirm-reanchor: Triggered only when confirming something is wrong within a turn, putting the first-round minimum payload back.
- Both reminders are informational and disabled by default.
- anchor_status: A read-only audit tool to check anchoring/promotion status, bootstrap allowlists, scores, and audit log tails.
Installation and Enablement¶
Install using PowerShell, set environment variables, and add the plugin.
$env:DSH_HOME = "<scratch-dir>"
dsh plugin --profile anchor-e3 add --ignore-scripts <path-or-fixed-commit-spec>
dsh --profile anchor-e3 --dump-config
Configuration Items¶
New installations require zero configuration. All 21 keys have default values, and unknown keys will be warned about and ignored.
Key configuration items include:
- anchorEnabled: Enables first-round anchoring.
- bootstrapTools: Bootstrap tool allowlist.
- gateEnabled: Promotion gate (anchor-gate vocabulary check).
- pullbackEnabled: L1 pullback reminder.
- reanchorOnConfirm: L2’ reanchor confirmation.
Precautions¶
- The plugin writes only to its own append-only audit log; no network/credentials, no subprocesses, no dynamic code loading.
- The two behavioral reminders are off by default; when enabled, they inject one extra user message.
- No rollback, capability layer, delivery gate, or fact mirroring.
- Requires DSH
>=0.2.0-rc.2 <0.3.0and Node.js>=22.19.
Conclusion¶
This plugin focuses on observation and auditing, rather than promising direct execution results. For more details and source code, please refer to the GitHub repository.