dsh-docker-policy-ceiling
A DeepSeek Harness community plugin that keeps a sandbox mode ceiling over a profile: it replaces the stock sandbox-policy service with one that refuses danger-full-access at the resolve layer, with a single boolean to restore upstream semantics.
Built for container execution worlds (see dsh-container-lifecycle): when a profile's subprocess/sandbox/fs run over ssh into a container, the policy question "what may escalate to full host access?" deserves an explicit, default-deny answer that does not silently loosen just because the transport changed. This plugin is transport-independent — it composes with any sandbox provider.
Status: experimental (Stage A). Independent community plugin — not part of DeepSeek Harness, not reviewed or endorsed by the DeepSeek team. Tested against 0.2.2-rc.1 and 0.2.2-rc.2 (see the supported versions; the
v0.1.0-rc.1tag serves rc.1 hosts).
What it does
- Replaces the base
sandbox-policyrow (disable + insert — by-id patches cannot rename) with a service that extends the upstreamSandboxPolicyServiceand refusesdanger-full-accessat resolve with the plugin-ownedPolicyCeilingRefusalError(upstream's sharedSandboxUnsupportedPolicyErrorwas removed in 0.2.2-rc.2), naming the source (approved grant / session override / deployment default) and the opt-in. - Stricter than upstream ssh semantics, on purpose. Upstream treats remote transports more loosely; this plugin makes the ceiling explicit. One config boolean restores the upstream behavior:
- id: sandbox-policy-ceiling
config:
allowDangerFullAccess: true # default false — restores upstream semantics
mode/workspaceRootinherit the base row's defaults (DSH_PERMISSION_MODE/ process cwd) and stay overridable from a profile patch.- Composition-safe with
dsh-headless: replacing thesandbox-policyrow drops the headless bundle's by-id config on that row (patch config replaces, never merges), so the plugin re-attaches the headless CLI'sadditionalWritableRootsgrant at runtime — order-free, and only whenheadlessStartupactually exists (union with any config-set roots, deduplicated). - Prompt rendering stays total. A session override to
danger-full-accessrenders a one-line refusal in the model context instead of throwing inside every prompt assembly; the enforcing path (tools callingresolve) keeps the actionablePolicyCeilingRefusalError. A deployment default ofdanger-full-accesswithout the opt-in fails loudly at load with the same guidance rather than booting a session whose every confined call would be denied. - The approval waterfall is unchanged: escalation requests, approver payloads, and post-grant retries are byte-identical to upstream apart from the ceiling refusal itself. A cosmetic pre-deny on the approval stream (
escalate sandbox to danger-full-access:) fails fast before a human is asked; enforcement lives at the resolve layer, and the README says so because a cosmetic layer alone would be security theater. Known wording limitation: the waterfall's outcome vocabulary is a closed enum, so the model-facing copy for a pre-denied escalation reads as a user rejection; the honest, actionable refusal text reaches the model on the enforcing resolve path, and the operator's log records the plugin as the denier.
Install
Same three-step shape as the lifecycle plugin (see its README for the full paste blocks); in the profile manifest add both bundles:
"dsh": { "profile": { "bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-headless",
"dsh-container-lifecycle",
"dsh-docker-policy-ceiling"
] } }
then dsh plugin --profile headless add dsh-docker-policy-ceiling. The plugin's own bundle patch replaces the base sandbox-policy row; profile-level patches can still override its config by id.
Tests
tests/matrix-test.mjs — 72 assertions, all green, run against the pinned dependency versions:
- A. resolve matrix: 4 session cases × 3 mode cases × 3 configs (base / ceiling default / ceiling opt-in).
- B. escalation ladder: every wider-mode request × 4 outcomes × 3 configs; approver payloads asserted byte-identical to upstream apart from the ceiling path.
- C. post-grant retry: an approved grant cannot smuggle
danger-full-accesspast the ceiling. - D. pre-deny waterfall: the cosmetic pre-deny fires before the approval stream, with the resolve-layer refusal still authoritative.
- E. composition semantics: headless
additionalWritableRootsre-attach (deduped, frozen, unioned with config roots); the guarded prompt render is byte-identical to the real base service's registered text for every non-refused mode; adanger-full-accessdeployment default loads on base/opt-in and is refused actionably at load on ceiling-default.
Implementation note (for anyone extending it): the service must use plain properties, not #private fields — the cordis context hands services through derived views (Object.create chains) that fail private-field brand checks.
Supported versions
| Component | This release pins | Notes |
|---|---|---|
| DeepSeek Harness runtime | >=0.2.2-rc.2 <0.2.2-rc.3 (engines.dsh) |
Tested on 0.2.2-rc.1 and 0.2.2-rc.2 |
@deepseek-ai/dsh-sandbox-policy / dsh-sandbox |
exact 0.2.2-rc.2 |
The service extends the upstream SandboxPolicyService; upstream removed SandboxUnsupportedPolicyError in rc.2, so the refusal is the plugin-owned PolicyCeilingRefusalError |
@deepseek-ai/cordis |
exact 4.1.0 |
License
MIT. Independent community plugin; not affiliated with or endorsed by DeepSeek.
No comments yet. Be the first to write one.