Files
deepseek-harness/packages/bash/pwsh-sandbox
imccyu ec601ca13d build(vendor): rescope the vendored Cordis packages into @deepseek-ai
Machine-produced by `pnpm run rescope-vendor --apply` plus the regeneration it
prints: `pnpm install` for the lockfile, `pnpm run gen-third-party-notices`,
`verify-translation-pairing --write` for the touched bilingual pairs,
`gen-doc-graphs`, and one typert snapshot whose ids embed character offsets.
`pnpm run rescope-vendor --check` verifies the result.

Renames nine vendored packages (cordis, cosmokit, schemastery and the six
@cordisjs plugins) and every reference that resolves them: manifest names and
dependency keys, module specifiers including declare-module merges, cordis.yml
plugin names, tsconfig paths, every Markdown fence, and `docs/` prose.
Directory names, upstream versions, and dependency ranges are unchanged, so
vendor/README.md still reads as an upstream snapshot; its manifest table gains
an upstream-name column so THIRD_PARTY_NOTICES keeps MIT attribution pointed
at each fork's origin.

The tutorial tier follows the rename end to end: its yaml fences named plugins
the Loader can no longer resolve, its `ts ignore-check` fences disagreed with
the compiled fences beside them, and its prose quoted both. The contracts that
told readers to keep upstream names — the root convention and the vendoring
cookbook's tree comment and manifest invariant — now say to rescope instead.

Two rules read `@deepseek-ai/` as "another workspace plugin": the client bundle
purity gate now names the vendored libraries a browser bundle inlines, and the
files where a bare `cordis` is an agent-preset id keep that product data.
2026-08-10 22:04:13 +08:00
..

@deepseek-ai/dsh-pwsh-sandbox

English | 中文

Sandbox-consuming PowerShell implementation of the ctx.bash executor seam: every command runs as pwsh -NoLogo -NoProfile -NonInteractive -Command <command> confined through ctx.sandbox, with the selected mode, enforcement, and denial facts stamped on each settled result. The pwsh twin of @deepseek-ai/dsh-bash-sandbox, a call-for-call mirror per the pwsh executor and tool decision — the confinement substance is platform-neutral: on Windows the sandbox seam resolves to the ACL restricted-token runner chain (@deepseek-ai/dsh-sandbox-windows-acl), on Linux/macOS to bwrap/Landlock/Seatbelt.

The executor inherits @deepseek-ai/dsh-pwsh-local's process mechanics and consumes its argv-level seam (argv() / runArgv() / startArgv() / onProcessDone()) to wrap the exact pwsh invocation through the provider. The sandbox policy (mode + workspace root) is NOT this package's config: it rides each call from ctx.sandboxPolicy (tool calls pass the calling session's resolved policy; direct calls fall back to deployment policy).

Behavior

  • danger-full-access: commands run through the local executor unchanged; results carry sandbox: { mode, denied: false }.
  • Confined modes (read-only, workspace-write): the pwsh argv is wrapped by ctx.sandbox.confine(); runner-launch refusal fails closed with SANDBOX_UNAVAILABLE (foreground throw, background runnerFailed fact), and a denied write classifies against the selected backend's denialSignatures into sandbox.denied.

Model Experience

Confinement works, denial surfaces as command failure

What the model sees

The confined command's own stderr (e.g. Access to the path '...' is denied. under the Windows ACL runner); the tool layer converts classified denials into the standard permission-denied surface exactly as it does for the bash tool.

Token effect

No model-visible text beyond the command's stderr and the tool layer's standard denial surface.

KV Cache effect

None directly; the denial surface belongs to the tool layer.

Known Limitations and Deferred Work

  • Reads are unrestricted on Windows (the ACL runner restricts writes only); the read boundary is documented in @deepseek-ai/dsh-sandbox-windows-acl.
  • The Windows workspace-write temp area is the real temp directory (GetTempPathW). This is a deliberate backend-defined choice, the same decision Landlock makes (readWrite: ['/tmp', ...]): the seam's "backend-defined temp area" permits it, and the escape probe in tests/acl.e2e.ts lives outside the temp tree for exactly that reason. A per-run private temp (bwrap's --tmpfs /tmp semantics) would additionally need an environment-block rewrite in the runner; it is an optional future hardening, not a correctness gap.
  • Windows read-only is strict zero-grant — not even the NUL device is writable; > $null redirection still works (documented in the backend package).