dsh-approval-memory
Manifest validAuto-approve Requests / DAM for DeepSeek Harness: approval memory, command-risk preview, and scoped auto-approval for read-only classes.
dsh-approval-memory(DAM)
A profile-level Host + Client plugin for DeepSeek Harness (DSH) that records approval requests, groups them into request classes, shows counts and possible risk, and lets the user auto-approve selected read-only classes.
- DAM = DSH Approval Memory
- Version:
0.3.2 - No DSH core changes
- No custom session event types
- One-shot grants only: auto-approval still returns
allowed-once
Features
- Collects
approval/asked/approval/decidedfrom every session in the current profile. - Groups requests into stable classes such as
plugin_manager:list_bundlesandbash:sandbox:danger-full-access. - Shows request name, operation, count, risk, and last seen time; statistics are sorted by observed frequency, with the main table showing the auto-approved count.
- Irreversible-action tags for display/audit only:
force-push,deploy,data-delete,send-message; they never affect auto-approval. - Per-class switch for low-risk read-only classes.
- Path trust, scoped to the current conversation and cleared on restart:
- non-sensitive
readrequests are auto-approved; - sensitive paths stay manual, then a once-approved exact path is trusted for that session;
- a manual
write/editapproval trusts exactly that file for that session; - no parent/directory inheritance, no shell trust.
- non-sensitive
- One collapsible no auto-approval (statistics only) section with two groups:
- other observed classes that cannot be toggled (command preview, risk tags, targets, cwd);
- permanent blacklist (read-only counts, no switch, no rule creation).
- Repeated-rejection hint for the latest command hash, queried from retained audit events (no fixed 30-day window; the retained window may be shorter).
- Approximate auto-approval outcomes (ok / error / no-result) from
tool/resultevents. - Audit log of auto-approved requests.
- Sidebar panel,
/dam-uicommand, and theopen_dam_uiagent tool for natural-language opening. - Panel loads when opened; manual refresh is available.
- Horizontal and vertical scrolling for long tables.
Install from GitHub
In a DSH Web session, install this repository as a profile bundle:
plugin_manager
action: install_bundle
target: https://github.com/TMrazbw/dsh-approval-memory
Or with the DSH CLI:
dsh plugin --profile <profile> add https://github.com/TMrazbw/dsh-approval-memory
The installation action requires approval and may need a DSH restart depending on the profile's HMR setup.
The plugin targets the public DSH 0.2.x plugin/event APIs. It was verified against DSH
0.2.1-rc.2. API changes in other DSH versions may require adjustments.
Usage
After installation:
- Open 自动同意请求 from the left sidebar, or type
/dam-ui. - Say “我要看 DAM 的界面” / “open the DAM UI”; the agent can call
open_dam_ui. - The panel shows only request classes that actually occurred and can be auto-approved.
- Classes that cannot be auto-approved (blacklist, medium/high/unknown risk) are counted but are not listed in the toggle table; the blacklist has its own read-only section.
- Use the switch to enable or disable auto-approval for a low-risk read-only class.
- 关闭全部自动同意 disables every known rule; it does not close the panel.
- 返回对话 closes the panel and returns to the conversation.
Command names are lowercase; the typed command is /dam-ui, while the menu label is DAM-UI.
Default auto-approval
V1 enables these low-risk read-only classes by default:
plugin_manager:list_pluginsplugin_manager:list_bundlesplugin_manager:list_version_exemptionsplugin_manager:inspect(if the installed DSH exposes it)
Everything else is conservative:
| Class | Behavior |
|---|---|
plugin_manager:set_plugin / set_bundle | displayed, switch disabled (medium risk) |
plugin_manager:install_bundle / remove_bundle | statistics only |
plugin_manager:set_version_exemption | blacklisted, never auto-approved |
bash / pwsh sandbox escalation | statistics only |
write / edit sandbox escalation | statistics only |
bash / pwsh / write / edit full access | blacklisted |
| unknown / MCP / PTC | statistics only |
Risk labels are static inferences, not a security guarantee.
Scope
- Applies to all sessions in the current DSH profile where the plugin is installed.
- Subagent sessions are counted; auto-approval is disabled for subagents by default.
- Other DSH profiles, other processes, and requests made before installation are not covered.
- Data is stored under
%DSH_HOME%/approval-memoryby default:classes.jsonrules.jsonevents.jsonl_plugin.log
Optional plugin config:
| Field | Default | Meaning |
|---|---|---|
dataRoot | %DSH_HOME%/approval-memory | data directory |
maxEvents | 5000 | retained audit events |
maxExamples | 3 | examples retained per class |
includeSubagents | false | allow auto-approval in subagent sessions |
Environment override: DSH_APPROVAL_MEMORY_ROOT.
Security boundaries
- Auto-approval is a user-enabled rule, not an inferred “the user surely agrees” judgment.
- Repeating a request does not automatically create a rule.
- A request class with any rejection can be reviewed; V1 never treats repetition as consent.
- The blacklist is code-owned and cannot be removed through the UI/API.
- The
open_dam_uitool only opens the panel; it never changes rules. - The panel uses authenticated
connection.fetchroutes:GET /api/approval-memory.snapshotPOST /api/approval-memory.mutate(setRule/closeAll)
Development
node --test --test-isolation=none
Current test suite: 136 tests, covering classification, extraction, redaction, storage, Host runtime, data bridge, Client registration, command-risk parsing, path trust, result tracking, and integration flows.
index.js Host entry
client.js Client entry: panel, sidebar, /dam-ui, open_dam_ui tool view
lib/
classes.js request class catalog
blacklist.js permanent deny list
extract.js callId/tool-call, command/cwd, and reason extraction
format.js counts, time, redaction
store.js file-backed persistence (v2 risk metadata)
host.js approval runtime
open-tool.js plain ToolDefinition for open_dam_ui
bridge.js authenticated snapshot/mutate routes
command-risk.js pure command-risk heuristics (recorded and displayed)
path-trust.js session path normalization and sensitive-path checks
test/ 136 Node tests
locale/ en / zh display metadata
No build step is required. The plugin uses only public DSH events/services and the browser module loader.
License
MIT. See LICENSE.
Comments
Loading…
Similar plugins
by StyxNether
Auto-Approval: a middle permission tier for DeepSeek Harness between workspace-write and danger-full-access, auto-approving harmless commands and trusted-area targets
★ 6
↓ 59/wk
MIT
JavaScript
Sep 6, 2026
dsh plugin --profile web add dsh-auto-approval-pluginby DWJZ
DeepSeek Harness 权限记忆插件:把某类命令加进允许列表,之后同类命令不再询问。 / Remember sandbox-escalation approvals so the same command prefix stops asking.
★ 0
MIT
JavaScript
Sep 18, 2026
dsh plugin --profile web add dsh-allowby 040822
Codex-style approval autopilot for DeepSeek Harness: ordered glob rules (allow/ask/deny) plus an AI risk judge (low/medium/high) mapped through a risk tolerance, as an approval answerer.
★ 3
↓ 141/wk
MIT
JavaScript
Oct 10, 2026
dsh plugin --profile web add dsh-codex-approvalby Jiao-XXX
为 DeepSeek Harness 增加介于 Workspace Write 与 Full access 之间的自动批准权限档,危险或不确定操作仍转人工审批。An auto-approval permission preset between workspace-write and full access for DeepSeek Harness.
★ 22
↓ 476/wk
MIT
JavaScript
Oct 2, 2026
dsh plugin --profile web add dsh-auto-approveby Martlet-Tech
Explain what a pending dsh approval will actually do, with one LLM call: an Explain button beside Allow/Reject in the DeepSeek Harness Web GUI.
★ 2
MIT
JavaScript
Sep 22, 2026
dsh plugin --profile web add dsh-approval-explainby moon09300731
DeepSeek Harness 自动审批门控:Flash 预判不可回补操作,安全自动批准、危险转人工(fail-safe)
★ 113
↓ 952/wk
MIT
JavaScript
Aug 20, 2026
dsh plugin --profile web add dsh-approval-gate