Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture, allowing core capabilities to be enhanced through extension modules. During agent development and debugging, an independent, persistent, and human-intervenable code audit mechanism is required to ensure the safety and compliance of task execution. dsh-audit-mode is designed to address this need. As the fifth preset mode in DSH, it provides an independent Codex audit workflow and a manual review entry point.
Plugin Overview¶
dsh-audit-mode is a DSH preset plugin maintained by yhfgyyf, with a core version of 0.6.1. Through an independent persistent audit mechanism and configurable reviewer backends (Codex, Claude Code, or DSH LLM), it provides human-approved repair loops and safe-pause capabilities for DSH sessions.
Core Features¶
- Fifth Preset Mode: The preset ID is
audit, and it can be selected in the TUI or Web interface. - Independent Review Architecture: Runs two isolated reviewer roles (Summarizer and Auditor). Codex is used by default, with support for switching to Claude Code or DSH LLM.
- Persistent Storage: Audit history and state are stored in a sidecar file, located at
${DSH_HOME}/audit/sidecars/<sessionId>.json. - Dual Interaction Interfaces: Provides a Web Dock Strip and a standalone TUI render block, supporting real-time control.
- Manual Intervention Loop: Supports two audit result levels,
warningandcritical. The former allows execution to continue, while the latter triggers a pause and exposes remediation capabilities. - Compatibility: Supports automatic routing for standard mode and Cordis mode.
Installation and Activation¶
The plugin is installed using pnpm and must be executed under the DSH shared Web/TUI configuration path.
- Enter the plugin directory:
cd ~/.dsh/profiles/web
- Install the core plugin and the recommended progressive tool discovery package:
pnpm add dsh-audit-mode@github:yhfgyyf/dsh-audit-mode
pnpm add dsh-progressive-tools@github:yhfgyyf/dsh-progressive-tools
- Add the installed bundles to the
dsh.profile.bundlesfield inpackage.json, then restart the Profile.
Typical Usage¶
After starting a session, use the following commands or operations to control auditing.
Activation Methods:
* Command line: --preset audit
* Web interface: Select audit from the preset chips
* Within a session: /preset audit
Command-Line Directives:
* /audit status — View the current round, interval, latest verdict, and pause status.
* /audit now — Force an audit immediately without waiting for the automatic interval.
* /audit history — View the audit history stored in the sidecar file.
* /audit accept [audit-id] — Accept the specified remediation plan (can be edited before execution).
* /audit resume — Resume a session after a non-critical review failure or manual pause.
TUI Operations:
* a — Execute the remediation plan without modifications.
* e — Edit the remediation plan and execute it.
* c — Copy the feedback content while paused.
* r — Resume from a non-critical pause.
* Esc / Ctrl+C — Stop the current work.
Configuring the Reviewer Backend¶
Configure the audit-bundle entry in the Profile’s cordis.patch.yml. If not configured, Codex is used by default.
Default Codex Configuration Example:
- id: audit-bundle
config:
reviewer: codex
binary: codex
args: [app-server, --stdio]
models:
summarizer: { model: gpt-5.6-luna, effort: medium }
auditor: { model: gpt-5.6-sol, effort: max }
Claude Code Configuration Example:
- id: audit-bundle
config:
reviewer: claude-code
claudeBinary: claude
claudeArgs: []
models:
summarizer: { model: haiku, effort: medium }
auditor: { model: opus, effort: max }
DSH LLM Backend Configuration Example:
- id: audit-bundle
config:
reviewer: dsh
dshProvider: deepseek-official
dshMaxTokens: 4096
models:
summarizer: { model: deepseek-v4-flash, effort: off }
auditor: { model: deepseek-v4-flash, effort: high }
Behavior and Limitations¶
- Execution Frequency: The first audit takes 60 seconds; subsequent audits run every 3 steps or every 3 minutes, with a minimum interval of 60 seconds. Exceptional cases are audited at the next safe boundary.
- Failure Handling: Three consecutive review failures (unreachable, timeout, or format error) cause the session to pause.
- Final Audit: A final audit is automatically run once when the session is disposed.
- Safety Limitations: The plugin does not call
session.delete; it only listens for thesession/disposedevent to detect session disposal. - Routing Limitations: Automatic routing supports only standard, code, minimal, and cordis modes.
Remote API¶
The Web interface provides the following API endpoints for third-party integration:
| Method | Path | Parameters |
|---|---|---|
| GET | /api/audit/snapshot |
?session=<id> |
| GET | /api/audit/watch |
?session=<id> (SSE event) |
| POST | /api/audit/request-now |
{ sessionId, final? } |
| POST | /api/audit/accept |
{ sessionId, auditId?, editedText? } |
| POST | /api/audit/resume |
{ sessionId } |
Notes¶
- Dependency Version: The plugin requires DSH version
0.1.3-alpha.2. - Runtime Permissions: The plugin runs with the permissions of the current DSH process. Review the source code and license before installation.
- Ecosystem Disclaimer: This plugin is a community catalog project and has no official affiliation with DeepSeek / High-Flyer.
Summary¶
dsh-audit-mode provides controllable code audit capabilities for DSH agents through an independent review workflow and a human-approval mechanism. It supports flexible backend configuration, persistent audit records, and dual Web/TUI interaction, making it suitable for developers who need to introduce secure audit processes in production environments.