dsh-permission-rules: Declarative Permission Rules for DeepSeek Harness
perrylink/dsh-permission-rules
Declarative permission rules for DeepSeek Harness, intercepting and auditing tool calls before execution.
Define allow/deny/ask rules in YAML for deterministic pre-execution decisions, with audit logging and hierarchical merging.
dsh plugin --profile web add github:perrylink/dsh-permission-rules- Category
- Development & Operations
- Platform
- DSH-Plugin
- Author
- perrylink
- Distribution
- Plugin
dsh-permission-rules Key Features
dsh-permission-rules Repository

dsh-permission-rules Repo Summary
dsh-permission-rules is a permission rules plugin (DSH plugin) for DeepSeek Harness, maintained by PerryLink under the Apache-2.0 license and written in TypeScript. It brings Claude Code-style declarative permission rules to DSH: on the tools/pre-execute waterfall, it evaluates an ordered allow/deny/ask rule list against every tool call, providing deterministic, instant, and auditable decisions. It solves the permission governance problem of which calls should be allowed, blocked, or asked about, letting administrators write rules in plain YAML without relying on model judgment. Core capabilities include tool-name globs (including mcp__), argument key/value globs or regexes (with ! negation and an absent dimension), workspace-relative path matching at any nesting depth, agent-identity selectors (main / subagent / preset:), when host conditions (env vars, platform), and hierarchical rule merging via searchUp.
What core features does the dsh-permission-rules DSH plugin support?
Rules use three-state semantics, evaluated in file order with first match wins: deny blocks the call, and its reason becomes the model-visible error so the agent learns why instead of retrying blindly; ask rides the official approval seam, optionally mounting dsh-auto-review for a second model to decide, otherwise a human answers, and with neither the harness fails closed; allow or no-match strictly delegates via next(), never short-circuiting downstream listeners. Every hit and passthrough is audit-logged as a permissionRules/decision session event (log-only, nothing injected into model context). Rule files support metadata like enabled: false, description, and tags; the /rules command warns about rules shadowed by an earlier catch-all.
How do I install dsh-permission-rules?
Use the DSH plugin management CLI with the following command:
dsh plugin --profile web add github:perrylink/dsh-permission-rules
After installation, place a .dsh/rules.yaml in your session working directory to activate it; if searchUp is enabled, all rule files from the session cwd up to the filesystem root are merged, nearest first, so child projects can override parent rules.
What is the "rules first, AI backstop" design of dsh-permission-rules?
Declarative rules are deterministic, instant, and model-free, but only cover what an admin wrote down; a second model can judge whether a specific call is appropriate, but costs a round-trip and can be wrong. Combining them forms a "rules first, AI backstop" loop: rules decide the known, the reviewer decides the unknown. This design makes dsh-permission-rules a key component of ai-safety and approval workflows in the DeepSeek Harness ecosystem.
What are the compatibility and maintenance status of dsh-permission-rules?
The plugin requires Node ^22.19 or >=24, depends on official packages like @deepseek-ai/dsh-agent, dsh-commands, dsh-llm, dsh-session, dsh-tools, dsh-subagent, dsh-user-approval, and works alongside dsh-auto-review. The repository was created on 2026-08-13 and last updated on 2026-08-16, currently with 4 stars, 1 fork, and 2 open issues, indicating active iteration.