@deepseek-ai/dsh-sandbox-local 0.2.1-rc.5 → 0.2.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +6 -6
- package/README.md +4 -1
- package/README.zh.md +4 -1
- package/lib/index.js +9 -6
- package/lib/types/profiles.d.ts +5 -3
- package/locale/de.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/package.json +12 -12
package/README.i18n.yaml
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
en: 7282c9ec77fd6f01
|
|
28
28
|
zh: 10e385a9489105e3
|
|
29
29
|
/deepseek-ai-dsh-sandbox-local/use-this-package/failures-and-recovery:
|
|
30
|
-
en:
|
|
31
|
-
zh:
|
|
30
|
+
en: 9b648f1bfdd55e76
|
|
31
|
+
zh: d9265bdf2e272581
|
|
32
32
|
/deepseek-ai-dsh-sandbox-local/understand-the-implementation:
|
|
33
33
|
en: 15db6ec303151ccc
|
|
34
34
|
zh: 91f62c1f64192f92
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
en: f0c44248c2ca6acc
|
|
37
37
|
zh: 554e9f706671d222
|
|
38
38
|
/deepseek-ai-dsh-sandbox-local/understand-the-implementation/platform-profiles:
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
39
|
+
en: 008967ee30fbbe46
|
|
40
|
+
zh: 9e5c6a3e97851a69
|
|
41
41
|
/deepseek-ai-dsh-sandbox-local/understand-the-implementation/denial-and-runner-failure-dialects:
|
|
42
42
|
en: 62adfc9229c656cc
|
|
43
43
|
zh: 11b1534b6d61e5de
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
en: e290ccc9b3c92c08
|
|
55
55
|
zh: 469589ac12cdadab
|
|
56
56
|
/deepseek-ai-dsh-sandbox-local/known-limitations-and-deferred-work:
|
|
57
|
-
en:
|
|
58
|
-
zh:
|
|
57
|
+
en: 7cd5c6a4cc971803
|
|
58
|
+
zh: 4e4f495b654d95c5
|
|
59
59
|
/deepseek-ai-dsh-sandbox-local/known-limitations-and-deferred-work/dev-note:
|
|
60
60
|
en: cc273320f6a1beaf
|
|
61
61
|
zh: 5c57a312ddc50651
|
package/README.md
CHANGED
|
@@ -56,6 +56,8 @@ With the provider mounted, a command runs under the mode you resolve per call. E
|
|
|
56
56
|
|
|
57
57
|
An unsupported platform or an unusable runner fails closed: `confine()` rejects with `SANDBOX_UNAVAILABLE` and names the runner options for the platform, and the consumer surfaces that error rather than running the command unconfined. A runner that starts but refuses its profile is identified by its fatal stderr signature and exit code, so a broken sandbox is not mistaken for a denied command. The `runnerCommand` override is an operator assertion: it skips functional probes and assumes the configured runner implements the bwrap-compatible profile honestly.
|
|
58
58
|
|
|
59
|
+
Seatbelt, bwrap, and Landlock include the policy's explicit `additionalWritableRoots` under `workspace-write`. Read-only ignores those grants. Invalid extra directories raise `SANDBOX_INVALID_ROOT` before the command starts.
|
|
60
|
+
|
|
59
61
|
-----
|
|
60
62
|
|
|
61
63
|
<a id="understand-the-implementation"></a>
|
|
@@ -72,7 +74,7 @@ Selection is by platform first, probes second: each platform has a runner chain
|
|
|
72
74
|
|
|
73
75
|
### Platform profiles
|
|
74
76
|
|
|
75
|
-
The bwrap profile combines a read-only host root, a fresh `/dev`, and `/proc` from a private PID namespace — commands manage their descendants but cannot see host processes, so procfs magic links cannot bypass the mounts; `workspace-write` adds an ephemeral `/tmp` and
|
|
77
|
+
The bwrap profile combines a read-only host root, a fresh `/dev`, and `/proc` from a private PID namespace — commands manage their descendants but cannot see host processes, so procfs magic links cannot bypass the mounts; `workspace-write` adds an ephemeral `/tmp` and writable binds for the workspace and each explicit extra root. The [historical private-PID note](../../../.agents/notes/archived/bug-fix/2026-08-06-bwrap-private-pid-namespace.md) records the boundary.
|
|
76
78
|
|
|
77
79
|
The `@deepseek-ai/node-addon-system/landlock-run` API supplies the platform launcher, functional probe, and grant vocabulary; this provider maps mode to grants only, keeping path resolution and probe parsing with the versioned binary.
|
|
78
80
|
|
|
@@ -128,6 +130,7 @@ No direct invalidation; the named consumers own any request-prefix changes.
|
|
|
128
130
|
|
|
129
131
|
These limits define when the provider is a poor fit or needs special operational care. They are current package constraints, not a general platform comparison or a task backlog.
|
|
130
132
|
|
|
133
|
+
- **Windows extra roots** — Windows ACL rejects every workspace-write subprocess carrying extra directories with `SANDBOX_UNSUPPORTED_POLICY`, before grants or child creation. Filesystem tools can enforce these grants independently. Remove the extra grants or use a supported host for process operations.
|
|
131
134
|
- **Windows ACL enforcement is partial** — NTFS hard links alias one file object across workspace and external paths, reads stay unconfined, and a tree another AppContainer tool has ACL'd with a package SID is unreadable to the Low-integrity child. The provider reports `enforcement: 'partial'` rather than overstating that boundary as full.
|
|
132
135
|
- **Landlock may be partial** — older supported kernel ABIs confine only the access classes they expose, reported as `enforcement: 'partial'` rather than overstated as full.
|
|
133
136
|
- **Seatbelt depends on deprecated `sandbox-exec`** — macOS still ships it, but this provider cannot replace or probe that private policy engine if Apple removes it.
|
package/README.zh.md
CHANGED
|
@@ -56,6 +56,8 @@ kind: "package-reference"
|
|
|
56
56
|
|
|
57
57
|
不受支持的平台或不可用的 runner 会拒绝执行:`confine()` 以 `SANDBOX_UNAVAILABLE` 拒绝 并列出该平台的 runner 选项,消费方会呈现该错误,而不是让命令不受限制地运行。启动后拒绝自身 profile 的 runner 由其致命 stderr 签名与退出码识别,因此损坏的沙箱不会被误认为被拒绝的命令。`runnerCommand` 覆盖是操作方断言:它跳过功能探测,并假定配置的 runner 诚实实现与 bwrap 兼容的 profile。
|
|
58
58
|
|
|
59
|
+
Seatbelt、bwrap 和 Landlock 在 `workspace-write` 下包含策略显式指定的 `additionalWritableRoots`。只读模式忽略这些授权。无效的额外目录会在命令启动前触发 `SANDBOX_INVALID_ROOT`。
|
|
60
|
+
|
|
59
61
|
-----
|
|
60
62
|
|
|
61
63
|
<a id="understand-the-implementation"></a>
|
|
@@ -72,7 +74,7 @@ kind: "package-reference"
|
|
|
72
74
|
|
|
73
75
|
### 平台 profile
|
|
74
76
|
|
|
75
|
-
bwrap profile 组合只读宿主根目录、全新 `/dev` 与私有 PID 命名空间中的 `/proc`——命令可管理其后代,但看不到宿主进程,因此 procfs 魔法链接无法绕过挂载;`workspace-write` 另加临时的 `/tmp`
|
|
77
|
+
bwrap profile 组合只读宿主根目录、全新 `/dev` 与私有 PID 命名空间中的 `/proc`——命令可管理其后代,但看不到宿主进程,因此 procfs 魔法链接无法绕过挂载;`workspace-write` 另加临时的 `/tmp` 与工作区与每个显式额外根目录的可写绑定挂载。[历史私有 PID 笔记](../../../.agents/notes/archived/bug-fix/2026-08-06-bwrap-private-pid-namespace.md)记录该边界。
|
|
76
78
|
|
|
77
79
|
`@deepseek-ai/node-addon-system/landlock-run` API 提供平台 launcher、功能探测与授权词汇;此提供方只做模式到授权的映射,把路径解析与探测解析保留在带版本的 binary 中。
|
|
78
80
|
|
|
@@ -128,6 +130,7 @@ Windows 档为每个工作区保留一个确定性写入 SID 和常驻 ACE,同
|
|
|
128
130
|
|
|
129
131
|
这些限制说明提供方何时不合适,或何时需要特别运维。它们是当前包约束,不是通用平台对比或任务积压。
|
|
130
132
|
|
|
133
|
+
- **Windows 额外根目录**——Windows ACL 在授权或创建子进程前,以 `SANDBOX_UNSUPPORTED_POLICY` 拒绝所有携带额外目录的 workspace-write 子进程。文件系统工具可独立执行这些授权。运行进程操作前,请移除额外授权或使用支持此功能的主机。
|
|
131
134
|
- **Windows ACL 只能实现部分强制执行**——NTFS 硬链接会使工作区路径与外部路径指向同一个文件对象,读取仍不受限,且被其他 AppContainer 工具以包 SID 标记过的目录树对 Low 完整性子进程不可读。提供方报告 `enforcement: 'partial'`,而不会把该边界夸大为完整强制执行。
|
|
132
135
|
- **Landlock 可能只实现部分强制执行**——较旧且受支持的内核 ABI 只能限制自身公开的访问类别,因此报告 `enforcement: 'partial'`,不会夸大为完整强制执行。
|
|
133
136
|
- **Seatbelt 依赖已弃用的 `sandbox-exec`**——macOS 仍会提供它,但若 Apple 移除该私有策略引擎,该提供方无法替换或探测。
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { join } from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { LAUNCHER_BIN, LAUNCHER_FAILURE_EXIT, grantArgs, launcherPath, probe } from "@deepseek-ai/node-addon-system/landlock-run";
|
|
7
7
|
import z from "@deepseek-ai/schemastery";
|
|
8
|
-
import { SandboxProvider, SandboxUnavailableError, canonicalPath, writableRoots } from "@deepseek-ai/dsh-sandbox";
|
|
8
|
+
import { SandboxProvider, SandboxUnavailableError, SandboxUnsupportedPolicyError, canonicalPath, workspaceWritableRoots, writableRoots } from "@deepseek-ai/dsh-sandbox";
|
|
9
9
|
import { AclWriteGrant, assertTempRootOutsideWorkspace, registerAclDiagnosisSkill, tempWriteSid, workspaceWriteSid } from "@deepseek-ai/dsh-sandbox-windows-acl";
|
|
10
10
|
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
11
11
|
//#region lib/types/profiles.js
|
|
@@ -33,7 +33,7 @@ function bwrapProfileArgs(policy) {
|
|
|
33
33
|
];
|
|
34
34
|
if (policy.mode === "workspace-write") {
|
|
35
35
|
args.push("--tmpfs", "/tmp");
|
|
36
|
-
args.push("--bind",
|
|
36
|
+
for (const root of workspaceWritableRoots(policy)) args.push("--bind", root, root);
|
|
37
37
|
}
|
|
38
38
|
return args;
|
|
39
39
|
}
|
|
@@ -44,7 +44,7 @@ function bwrapProfileArgs(policy) {
|
|
|
44
44
|
*/
|
|
45
45
|
function landlockProfileArgs(policy) {
|
|
46
46
|
const readWrite = ["/dev/null"];
|
|
47
|
-
if (policy.mode === "workspace-write") readWrite.push("/tmp", policy
|
|
47
|
+
if (policy.mode === "workspace-write") readWrite.push("/tmp", ...workspaceWritableRoots(policy));
|
|
48
48
|
return grantArgs({
|
|
49
49
|
readOnly: ["/"],
|
|
50
50
|
readWrite
|
|
@@ -56,9 +56,11 @@ function sbplString(path) {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Build the sandbox-exec arguments and SBPL profile for one policy. The
|
|
59
|
-
* writable roots
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* workspace-owned writable roots (workspace plus explicit extra directories)
|
|
60
|
+
* come from the shared {@link writableRoots} helper (canonical, deduplicated)
|
|
61
|
+
* so the Seatbelt grant and the in-process fs fence
|
|
62
|
+
* (`@deepseek-ai/dsh-fs-sandbox`) can never drift apart; the helper adds the
|
|
63
|
+
* documented Seatbelt temp areas.
|
|
62
64
|
* @param policy - file-effect policy to express as an SBPL profile.
|
|
63
65
|
* @returns sandbox-exec arguments before the trailing separator and command argv.
|
|
64
66
|
*/
|
|
@@ -355,6 +357,7 @@ var LocalSandboxProvider = class extends SandboxProvider {
|
|
|
355
357
|
* @returns the runner invocation.
|
|
356
358
|
*/
|
|
357
359
|
windowsAclRunnerArgv(policy) {
|
|
360
|
+
if (policy.mode === "workspace-write" && (policy.additionalWritableRoots?.length ?? 0) > 0) throw new SandboxUnsupportedPolicyError("Windows ACL confinement does not support additional writable directories; remove the extra grants or use a supported host");
|
|
358
361
|
const sessionId = policy.sessionId;
|
|
359
362
|
if (sessionId === void 0 || policy.mode === "read-only") return [
|
|
360
363
|
...this.windowsAclRunnerInvocation(),
|
package/lib/types/profiles.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ export declare function bwrapProfileArgs(policy: SandboxPolicy): string[];
|
|
|
18
18
|
export declare function landlockProfileArgs(policy: SandboxPolicy): string[];
|
|
19
19
|
/**
|
|
20
20
|
* Build the sandbox-exec arguments and SBPL profile for one policy. The
|
|
21
|
-
* writable roots
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* workspace-owned writable roots (workspace plus explicit extra directories)
|
|
22
|
+
* come from the shared {@link writableRoots} helper (canonical, deduplicated)
|
|
23
|
+
* so the Seatbelt grant and the in-process fs fence
|
|
24
|
+
* (`@deepseek-ai/dsh-fs-sandbox`) can never drift apart; the helper adds the
|
|
25
|
+
* documented Seatbelt temp areas.
|
|
24
26
|
* @param policy - file-effect policy to express as an SBPL profile.
|
|
25
27
|
* @returns sandbox-exec arguments before the trailing separator and command argv.
|
|
26
28
|
*/
|
package/locale/de.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-sandbox-local",
|
|
3
3
|
"description": "Local process-sandbox backends for the DeepSeek Harness sandbox seam: bwrap, the npm-distributed landlock-run launcher, macOS Seatbelt, or the Windows ACL restricted-token runner — functionally probed, fail-closed",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
33
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
34
|
-
"@deepseek-ai/dsh-sandbox": "0.2.
|
|
35
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
32
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1",
|
|
33
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
34
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.2"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@deepseek-ai/dsh-sandbox-windows-acl": "0.2.
|
|
39
|
-
"@deepseek-ai/dsh-util-values": "0.2.
|
|
38
|
+
"@deepseek-ai/dsh-sandbox-windows-acl": "0.2.2-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-util-values": "0.2.2-alpha.2",
|
|
40
40
|
"@deepseek-ai/node-addon-system": "~0.1.2",
|
|
41
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
41
|
+
"@deepseek-ai/schemastery": "~3.18.6-alpha.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
45
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
46
|
-
"@deepseek-ai/dsh-sandbox": "0.2.
|
|
47
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
44
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.2"
|
|
48
48
|
}
|
|
49
49
|
}
|