返回 CodeWhale
docs-sandbox.ts
根目录 / web / lib / i18n / dictionaries / en / docs-sandbox.ts
1 import type { DocsSandboxDict } from "../types";
2
3 /**
4 * English reference dictionary for `app/[locale]/docs/sandbox/page.tsx`
5 * ("Limit what commands can touch"). Checked against docs/SANDBOX.md — which
6 * describes only behavior wired into the command execution path — and
7 * docs/CONFIGURATION.md (`sandbox_mode`, `prefer_bwrap`).
8 */
9 export const docsSandbox: DocsSandboxDict = {
10 metaTitle: "Limit what commands can touch · Codewhale Docs",
11 metaDescription:
12 "See which operating-system sandbox wraps shell commands on macOS, Linux, and Windows, turn it on where it is optional, and choose how much a command may write.",
13 bodyClassName: "text-ink-soft leading-relaxed",
14 title: "Limit what commands can touch",
15 lede:
16 "Approving a command decides whether it runs. A sandbox decides what it can reach once it does. Codewhale uses the operating system's sandbox where one is available and tells you plainly when there is none.",
17 sections: [
18 {
19 "id": "execution-policy",
20 "title": "Inspect execution policy rules",
21 "blocks": [
22 {
23 "code": "/permissions",
24 "lang": "Codewhale"
25 },
26 {
27 "p": "Typed permissions select User, Agent and BuiltinDefault rules in that order. Within one source layer, deny wins over ask and allow; specificity breaks ties."
28 },
29 {
30 "p": "Hard denied command prefixes cannot be overridden by a typed allow. An allow never removes later safety checks, repository restrictions or sandbox limits."
31 },
32 {
33 "p": "[Read the authorization order and matching rules](https://github.com/codewhale-hq/CodeWhale/blob/main/docs/AUTHORIZATION_ORDER.md)"
34 }
35 ]
36 },
37 {
38 id: "platforms",
39 title: "Check what your platform provides",
40 blocks: [
41 {
42 rows: [
43 ["macOS", "Seatbelt, automatically, when its startup check succeeds. Commands get broad read access, writes limited by the sandbox mode, and network only when the mode allows it."],
44 ["Linux", "Bubblewrap, automatically, once it is installed and verified working (opt out below). Without it, commands run with no OS sandbox, and Codewhale shows the workspace limit as unenforced."],
45 ["Windows", "No OS sandbox. Codewhale shows the workspace limit as unenforced, and your approval setting and Windows permissions still apply."],
46 ["External service", "With `sandbox_backend = \"opensandbox\"`, shell commands run on an OpenSandbox-compatible service you configure; its isolation is that service's to guarantee."],
47 ],
48 },
49 { p: "Ask Codewhale which one it found:" },
50 { code: "codewhale doctor\ncodewhale setup --status", lang: "Terminal" },
51 {
52 p: "Both report the sandbox that is actually available after your settings are applied. Codewhale never counts source code that is not wired in as a sandbox.",
53 },
54 ],
55 },
56 {
57 id: "linux",
58 title: "Enable (or turn off) the Linux sandbox",
59 blocks: [
60 { p: "Install bubblewrap — Codewhale uses it by default. To run Linux commands unwrapped instead, opt out with one line in `~/.codewhale/config.toml`:" },
61 {
62 code: "sudo apt install bubblewrap",
63 lang: "Debian / Ubuntu — Terminal",
64 },
65 {
66 code: "prefer_bwrap = false",
67 lang: "~/.codewhale/config.toml — optional opt-out",
68 },
69 {
70 p: "Codewhale uses `/usr/bin/bwrap` only when that file exists, is executable, and a probe shows it can create its sandbox namespaces — an installed-but-blocked bwrap is treated as absent, not used. Commands then see a read-only view of the system, write only where the sandbox mode allows, and have no network unless the mode enables it.",
71 },
72 ],
73 },
74 {
75 id: "mode",
76 title: "Choose how much a command may write",
77 blocks: [
78 { code: 'sandbox_mode = "workspace-write"', lang: "config.toml" },
79 {
80 rows: [
81 ["read-only", "Commands can read but not write."],
82 ["workspace-write", "Commands can write inside the workspace and temporary folders, and nowhere else."],
83 ["danger-full-access", "No OS sandbox. Use only on a machine or container you are prepared to lose."],
84 ["external-sandbox", "You are already running inside isolation, so Codewhale adds none of its own."],
85 ],
86 codeTerms: true,
87 },
88 {
89 p: "The first two are enforced only where a sandbox is available — on Linux without bubblewrap, and on Windows, they are settings without an OS wrapper behind them. A repository's own config can make the mode stricter, never looser. For one headless run, pass `--sandbox <mode>` before the prompt to `codewhale exec`. By default, `--auto` enables Full Access: tools run without asking, shell commands have no Codewhale sandbox, and trust mode lets file tools write outside the workspace. Any `--sandbox` other than `danger-full-access` (or the equivalent `sandbox_mode` in config) keeps trust mode off. Use `--sandbox workspace-write` for the shell sandbox, where available, and file-tool workspace restrictions; `external-sandbox` relies on your own isolation.",
90 },
91 ],
92 },
93 {
94 id: "limits",
95 title: "Know the limits",
96 blocks: [
97 {
98 list: [
99 "Availability is checked before a command starts, but the sandbox can still fail at launch because of host policy or container restrictions.",
100 "A “Permission denied” from a command is not proof that the sandbox blocked it. Codewhale labels a denial as the sandbox's only when the sandbox itself reported it.",
101 "No sandbox protects against kernel vulnerabilities or every kind of resource exhaustion.",
102 ],
103 },
104 ],
105 },
106 ],
107 next: [
108 {
109 href: "/docs/modes",
110 label: "Set modes and approvals",
111 note: "Decide which commands stop for your approval.",
112 },
113 {
114 href: "/docs/trust",
115 label: "See what leaves your machine",
116 note: "What a provider receives, what stays local, and what telemetry sends.",
117 },
118 {
119 href: "/docs/configuration",
120 label: "Change settings",
121 note: "Where these keys live and what a repository may override.",
122 },
123 ],
124 sourceNote: "Source documents: docs/SANDBOX.md, docs/CONFIGURATION.md · Update docs-map.ts when changing.",
125 };
126
126 lines TYPESCRIPT