Introduction¶
When running Agents in DeepSeek Harness (DSH), models often spontaneously call web_fetch, execute curl in Shell, or run pip install. By default, these actions connect directly, making them difficult to control in scenarios involving weak network conditions, usage-based billing, or compliance requirements. You can add a “ask for human approval before connecting” gate at the plugin level, rather than sifting through logs afterwards.
Below is an introduction to the community plugin dsh-net-consent (maintained by hsushjk), categorized under admin-security. It hooks into tool execution before the session tool runs, approving or intercepting network actions initiated by the Agent; it does not handle traffic statistics. If you need to separate statistics from observation, you can use the author’s dsh-traffic-statistics.
What is the Plugin¶
dsh-net-consent is an approval/interception tool: any network action initiated by the Agent within the session requires user approval (or silent allow if the policy permits). The plugin intervenes via the tools/pre-execute hook; it does not wrap globalThis.fetch nor modify node:http(s).request.
- Repository: https://github.com/hsushjk/dsh-net-consent
- Community Directory: https://www.skillhub.cn/plugins/hsushjk/dsh-net-consent
- Version in current docs: 1.0.1 (
package.json) - License: MIT
- Runtime Environment: Node.js >= 20, supports Linux / Windows
The installation hint on SkillHub is: install the plugin hsushjk/dsh-net-consent in DSH. The documentation gathered does not provide a separate shell installation command line; follow the installation method based on your DSH version and its plugin management instructions. The plugin identifier is hsushjk/dsh-net-consent.
What and What Not to Audit¶
The plugin only handles network-related actions initiated by the Agent itself within the current session.
Tool Layer (policy key mode) covers tools such as web_fetch, web_search, browser/Playwright-like tools, and third-party plugin tools that contain http(s) URLs in their call parameters.
Command Line Layer (policy key shellMode) covers network verbs within command text, such as curl, wget, ssh, scp, rsync, git clone, pnpm install, pip install, apt, snap refresh, pacman -S, svn checkout, etc.
The following paths are outside its scope: chat requests, background fetching for the plugin market and plugin details, update checks, telemetry, etc. — these do not go through session tools, so the plugin will not intercept them.
Policies: Allow, Ask, Deny¶
There is one policy level for the Tool Layer and one for the Command Line Layer, both taking values of allow / ask / deny.
| Value | Behavior |
|---|---|
allow |
No approval card pops up; executes directly |
ask |
Pop approval card (default) |
deny |
Block directly; no approval card pops up |
Key points: deny takes precedence over “allow for this session”; local/LAN addresses and whitelist hits are allowed first (this can also be controlled via allowLocal).
Approval Card¶
Users typically have three options: Allow Once, Allow for this target in the session, or Reject. When clicking “Other” and filling in text, it defaults to reject, and the original text will be returned to the model to allow for route changes.
The card will display the model’s self-described purpose (can be closed via purposes); the command line layer shows the command text, while other tools show a summary of call parameters. At the end, it will state the wait timeout for this session and the timeout action, for example, “Auto-reject if not selected within 30 seconds” — the wait time and whether the action is auto-allow or auto-reject after timeout are configurable in the settings.
Sub-agents cannot pop cards (DSH prohibits sub-agents from asking users questions), so they are handled as reject with a prompt to execute via the main agent.
Whitelist¶
The whitelist is an explicit exception list that takes effect before the deny strategy. One record uses one format; a hit means no question is asked:
| Format | Example | Match Method |
|---|---|---|
| Tool Name | web_fetch, browser_* |
Exact match on tool name; ending * is a prefix wildcard |
| Command Name | curl, git, pnpm |
Whole word match in command text |
| Domain | example.com, *.example.com |
The host of the call must match all for allow |
| IP | 8.8.8.8, ::1 |
Exact match |
Configuration¶
Adjust behavior in config under net-consent in cordis.patch.yml. Default values are as follows (excerpted from the README):
# Common keys in dsh-net-consent.config in cordis.patch.yml
mode: ask # Tool Layer: allow / ask / deny
shellMode: ask # Command Line Layer: allow / ask / deny
allowLocal: true # Skip questions for loopback and LAN
askTimeoutMs: 30000 # Wait for user answer, range approx 5s–10min
onTimeout: deny # Deny or allow after timeout
audit: true # Write audit jsonl
auditRetentionDays: 30 # 0 means permanent retention
allowlist: [] # Tools / Commands / Domains / IPs
purposes: true # Show model self-described purpose on card
internalTools is a built-in, long list of read-only tools in the documentation; they are completely unexamined. The UI cannot be modified.
A typical usage is to keep the default ask, set mode and shellMode to ask or deny in weak network or high-cost environments, then write trusted domains and internal network IPs into allowlist. If necessary, change onTimeout to deny to prevent auto-allow when unattended.
Audit¶
A JSON line is written for every decision to:
~/.dsh/net-consent/audit/YYYY-MM-DD.jsonl
The via field distinguishes allow/deny reasons, such as once, session-grant, user-reject, policy=deny, timeout-allow, NET_CONSENT_TIMEOUT, etc. Files exceeding auditRetentionDays are automatically cleaned on startup or after writing.
Security Implementation¶
The Settings page status API is registered on the DSH /api channel (precise route of ctx.connection.fetch.register). Host/Origin validation and browser authentication are completed by DSH; only authenticated owner sessions can read/write configuration. The plugin does not register bare routes to webServer.
Use Cases and Notes¶
Suitable for scenarios requiring manual control over network behavior or traffic costs, such as poor network, roaming, satellite, maritime, and other environments. It is crucial to understand: this is a review gate, not a traffic counter.
It is recommended to read the repository source code and the MIT license before installing. The plugin runs with the current DSH process permissions; incorrect policies or whitelists may block too much or too little. Before changing deny, timeout, or audit retention in production environments, you should first test the approval card flow in a test session.
Conclusion¶
dsh-net-consent puts humans in the approval card before the Agent actually connects, separates the configuration of the Tool Layer and Shell Layer, and adds maintainability via whitelists and auditing. Directories and source code: