Introduction¶
When using models in DeepSeek Harness (DSH) to execute Minecraft mod build tasks, every privilege escalation request requires manual confirmation — even when the justification clearly states something like “gradle build” or “fabric setup,” which is unambiguously within the build domain. This not only disrupts the workflow but also encourages users to habitually select “Allow All,” increasing the risk of accidentally approving unintended actions.
What This Is¶
dsh-mod-build-auto-approve is a DSH plugin maintained by onup-1, categorized under admin-security. It only auto-approves “mod build”-type sandbox privilege escalations, and after a human approves one request, it learns the keywords so that subsequent similar requests pass automatically without repeated confirmation.
Core Features¶
Keyword-Based Approval (Built-in Rules)¶
The plugin listens to the approval/request event (waterline event, prepend priority). It returns allowed-once only when the tool is pwsh / bash and the justification contains any of the following keywords:
- fabric
- loom
- forge
- gradle
- daynight
- minecraft
- 模组 (mod)
- 1.x.y (version number)
All other requests continue to go through manual approval.
Keyword Learning After Manual Approval¶
Requests that are not auto-approved go to a human approver. If the user approves (grants allowed-once), the plugin scans the justification, extracts domain keywords (e.g., forge, gradle, mirror, cache, build, etc.), and stores them in the “permanent keyword table” in learned.json. Subsequent privilege escalation requests whose justifications contain these keywords are automatically approved without prompting.
Keywords are shared across sessions and do not expire. The plugin re-reads learned.json on every decision, so edits take effect immediately without a restart.
learned.json also records who approved, in which session, and for what reason each keyword was learned.
One-Click Batch Authorization Tool¶
Before the model begins configuring the mod environment, it calls the tool mod_permission_plan:
mod_permission_plan({ items: ["Write .gradle-home build cache", "Start java/gradle processes", ...] })
This bundles a set of permission types into one approval prompt for the user (instead of showing them one by one). After the user selects “Approve All,” the keywords from that batch are written into the permanent keyword table, and subsequent similar escalations are auto-approved.
Decision Statistics¶
Starting from 3.0.0, the plugin writes each approval decision to a dedicated file stats.jsonl (one JSON per line) and registers the tool mod_permission_stats:
mod_permission_stats({ limit: 20 }) // Last 20 entries timeline
mod_permission_stats({ since: "2026-11-20T15:00:00Z" })
The output includes: totals and auto-approval hit rate, average interval between adjacent requests, keyword reuse frequency ranking (including “how many times the top keyword alone covered requests”), and a timestamped timeline with intervals. This answers questions like “how many approvals did this keyword set actually save” and “which keyword is the most useful.”
- Retention cap is 100,000 entries (
DECISION_CAP); oldest entries are discarded when exceeded. learned.jsonrequires a full rewrite on every decision; at 100,000 entries, each rewrite is ~20 MB. Append-write only writes one line, and in a crash scenario, at most one line is lost.learned.jsononly retainsstartedAt / lastAt / totals, so its size does not grow with the record count.
Risk Tiering (5.0.0)¶
Keyword matching is divided into three tiers:
| Tier | Examples | Auto-approve on solo match |
|---|---|---|
| Strong | forge, gradle, fabric, loom, mcp, bmclapi, 模组, decompile, mappings, jdk8 | Yes |
| Weak | mod, java, jar, build, cache, mirror, 环境, 缓存, 下载, 依赖, 构建, 镜像, 预热 | No, requires ≥2 distinct weak keywords co-occurring |
| Dangerous verbs | taskkill, rm, del, rmdir, format, shutdown, Remove-Item, Stop-Process |
Never auto-approved |
Weak keywords can be promoted: after you approve a request that was matched solely by a weak keyword, that keyword enters the promoted section of learned.json and is thereafter treated as a strong keyword.
Security Boundaries¶
- The decision basis is the textual justification in the request, which is filled in by the model that initiated the request. Therefore, this is a convenience feature, not a security boundary.
- Learning only records content that a user has actually approved; as long as the justification is written truthfully, behavior will match intuition.
- It only affects the approval chain — it does not alter sandbox policies, does not modify any global settings; non-matching requests remain completely unchanged.
- This plugin only auto-approves
pwsh/bash.plugin_manager(install/uninstall/enable/disable plugins) is intentionally not auto-approved, because otherwise a plugin could modify its own configuration and then enable itself, effectively bypassing human confirmation.
Installation & Activation¶
The plugin is published on npm. Both the package name and bundle ID are dsh-mod-build-auto-approve:
dsh plugin --profile desktop add dsh-mod-build-auto-approve
Hot reload (after modifying index.js):
plugin_manager set_plugin target=include:mod-build-auto-approve enabled=false
plugin_manager set_plugin target=include:mod-build-auto-approve enabled=true
Typical Usage¶
Auto-approve Known Mod Builds¶
When the model executes the following command with gradle or forge in the justification:
pwsh -Command "cd /path/to/mod && ./gradlew build"
The plugin recognizes the keyword and returns allowed-once without requiring manual confirmation.
Auto-approve After One Manual Approval¶
The model writes “build fabric mod” in the justification:
pwsh -Command "cd /path/to/fabric && pnpm dlx create-react-app . && npm install"
The user manually approves once. The plugin records the keywords “fabric” and “build” into learned.json. From then on, any privilege escalation request whose justification contains these words will be auto-approved.
Batch Authorize a Full Set of Permissions¶
The model calls the following before configuring the mod environment:
mod_permission_plan({ items: ["Write .gradle-home build cache", "Start java/gradle processes", "Delete old build artifacts"] })
The user selects “Approve All,” the keywords from that batch are written into the permanent table, and subsequent similar escalations are auto-approved.
View Approval Statistics¶
mod_permission_stats({ limit: 20 })
Example output:
{
"total": 123,
"auto": 87,
"auto_rate": 0.707,
"avg_interval_seconds": 300,
"keyword_rank": [
{ "keyword": "gradle", "count": 45 },
{ "keyword": "forge", "count": 30 }
],
"history": [ ... ]
}
Use Cases & Caveats¶
This plugin is suited for environments where Minecraft mod build tasks are executed frequently and privilege escalation justifications are clear and stable. The plugin runs with the current DSH process permissions; review the source code and license before installing.
This plugin uses keyword matching as an auxiliary signal and does not replace human review. If the justification is written ambiguously, the request may not be auto-approved and will require manual confirmation.
Directory Page & Source Code¶
- Plugin directory page: https://www.skillhub.cn/plugins/onup-1/dsh-mod-build-auto-approve
- GitHub repository: https://github.com/onup-1/dsh-mod-build-auto-approve