Skip to content

Commit d0cffe2

Browse files
authored
docs: revert default agent working directory to /home/user (#1506)
Revert the /workspace default-pwd change in docs + examples back to /home/user (including mount-path examples). Clarify in the filesystem doc that /home/user is the agent's home directory and default pwd.
1 parent 973b0af commit d0cffe2

11 files changed

Lines changed: 48 additions & 48 deletions

File tree

examples/docs/filesystem/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import pi from "./software/pi";
55
const vm = agentOS({
66
software: [pi],
77
mounts: [
8-
{ path: "/workspace/scratch", driver: createInMemoryFileSystem() },
8+
{ path: "/home/user/scratch", driver: createInMemoryFileSystem() },
99
],
1010
});
1111

examples/docs/sandbox/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import type { registry } from "./server";
44
const client = createClient<typeof registry>({ endpoint: "http://localhost:6420" });
55
const vm = client.vm.getOrCreate("my-agent");
66

7-
// Write code via the filesystem. The /workspace/sandbox mount maps to the sandbox root.
8-
await vm.writeFile("/workspace/sandbox/app/index.ts", 'console.log("hello")');
7+
// Write code via the filesystem. The /home/user/sandbox mount maps to the sandbox root.
8+
await vm.writeFile("/home/user/sandbox/app/index.ts", 'console.log("hello")');
99

1010
// Run it inside the sandbox. Commands execute through the VM's process table,
1111
// reading the file from the mounted directory.
12-
const result = await vm.exec("node /workspace/sandbox/app/index.ts");
12+
const result = await vm.exec("node /home/user/sandbox/app/index.ts");
1313
console.log(result.stdout); // "hello\n"
1414

1515
// Call a mounted binding from the client. The sandbox bindings are exposed inside
1616
// the VM as a CLI command, so you invoke it through the same exec/spawn surface.
17-
const install = await vm.exec("agentos-sandbox run-command --command \"npm install\" --cwd /workspace/sandbox/app");
17+
const install = await vm.exec("agentos-sandbox run-command --command \"npm install\" --cwd /home/user/sandbox/app");
1818
console.log(install.exitCode, install.stdout);
1919

2020
// Spawn a long-running process via the bindings and stream its output.

examples/docs/sandbox/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const sandbox = await SandboxAgent.start({ sandbox: docker() });
1212
// process management as bindings.
1313
const vm = agentOS({
1414
mounts: [
15-
{ path: "/workspace/sandbox", plugin: createSandboxFs({ client: sandbox }) },
15+
{ path: "/home/user/sandbox", plugin: createSandboxFs({ client: sandbox }) },
1616
],
1717
bindings: [createSandboxBindings({ client: sandbox })],
1818
});

website/.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

website/src/components/marketing/solutions/AgentOSPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,15 @@ const terminalLines: TermLine[] = [
548548
{ text: ' v0.1.0 | runtime ready', color: 'text-cream/45', delay: 1400 },
549549
{ text: '', delay: 1600 },
550550
{ text: '✓ V8 isolate pool initialized (12 workers)', color: 'text-cream/70', delay: 1800 },
551-
{ text: '✓ File system mounted → /workspace', color: 'text-cream/70', delay: 2100 },
551+
{ text: '✓ File system mounted → /home/user', color: 'text-cream/70', delay: 2100 },
552552
{ text: '✓ Tool registry loaded (git, curl, python, node)', color: 'text-cream/70', delay: 2400 },
553553
{ text: '✓ Network policy applied → allowlist mode', color: 'text-cream/70', delay: 2700 },
554554
{ text: '', delay: 3000 },
555555
{ text: '● Agent session created sid=a8f3c2e1', color: 'text-cream/85', delay: 3200 },
556556
{ text: ' → Claude Code connected', color: 'text-cream/55', delay: 3500 },
557557
{ text: ' → Prompt: "Set up a Next.js app with auth"', color: 'text-cream/55', delay: 3800 },
558558
{ text: '', delay: 4100 },
559-
{ text: ' ▸ agent npm create next-app@latest /workspace/app', color: 'text-cream/70', delay: 4400 },
559+
{ text: ' ▸ agent npm create next-app@latest /home/user/app', color: 'text-cream/70', delay: 4400 },
560560
{ text: ' ▸ agent npm install next-auth@5 prisma @prisma/client', color: 'text-cream/70', delay: 5000 },
561561
{ text: ' ▸ agent Writing 7 files...', color: 'text-cream/70', delay: 5600 },
562562
{ text: ' ▸ agent npx prisma db push', color: 'text-cream/70', delay: 6200 },

website/src/content/docs/docs/agent-to-agent.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ async function reviewCode(code: string): Promise<string> {
2929
const reviewerHandle = client.reviewer.getOrCreate("my-project");
3030

3131
// Write the submitted contents into the reviewer's VM.
32-
await reviewerHandle.writeFile("/workspace/review.ts", code);
32+
await reviewerHandle.writeFile("/home/user/review.ts", code);
3333

3434
// Ask the reviewer to review.
3535
const session = await reviewerHandle.createSession("claude", {
3636
env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },
3737
});
3838
const result = await reviewerHandle.sendPrompt(
3939
session.sessionId,
40-
"Review the code at /workspace/review.ts and list any issues.",
40+
"Review the code at /home/user/review.ts and list any issues.",
4141
);
4242
await reviewerHandle.closeSession(session.sessionId);
4343

website/src/content/docs/docs/crash-course.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ registry.start();
394394

395395
### Filesystem
396396

397-
Read, write, and manage files inside the VM. The `/workspace` directory is persisted automatically across sleep/wake cycles.
397+
Read, write, and manage files inside the VM. The `/home/user` directory is persisted automatically across sleep/wake cycles.
398398

399399
<CodeGroup>
400400
```ts title="client.ts"
@@ -405,14 +405,14 @@ const client = createClient<typeof registry>({ endpoint: "http://localhost:6420"
405405
const agent = client.vm.getOrCreate("my-agent");
406406

407407
// Write a file
408-
await agent.writeFile("/workspace/config.json", JSON.stringify({ key: "value" }));
408+
await agent.writeFile("/home/user/config.json", JSON.stringify({ key: "value" }));
409409

410410
// Read a file
411-
const content = await agent.readFile("/workspace/config.json");
411+
const content = await agent.readFile("/home/user/config.json");
412412
console.log(new TextDecoder().decode(content));
413413

414414
// List directory contents recursively
415-
const files = await agent.readdirRecursive("/workspace", { maxDepth: 2 });
415+
const files = await agent.readdirRecursive("/home/user", { maxDepth: 2 });
416416
console.log(files);
417417
```
418418

@@ -454,7 +454,7 @@ conn.on("processOutput", (data) => {
454454
console.log(`[pid ${data.pid}]`, new TextDecoder().decode(data.data));
455455
});
456456

457-
const { pid } = await agent.spawn("node", ["/workspace/server.js"]);
457+
const { pid } = await agent.spawn("node", ["/home/user/server.js"]);
458458
console.log("Process ID:", pid);
459459
```
460460

@@ -571,7 +571,7 @@ const vm = agentOS({
571571
bindings: [createSandboxBindings({ client: sandbox })],
572572
// Mounts let the agent read the sandbox filesystem (optional)
573573
mounts: [
574-
{ path: "/workspace/sandbox", plugin: createSandboxFs({ client: sandbox }) },
574+
{ path: "/home/user/sandbox", plugin: createSandboxFs({ client: sandbox }) },
575575
],
576576
});
577577

website/src/content/docs/docs/filesystem.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const vm = agentOS({
2626
software: [pi],
2727
mounts: [
2828
{
29-
path: "/workspace/repo",
29+
path: "/home/user/repo",
3030
plugin: { id: "host_dir", config: { hostPath: "/path/to/repo" } },
3131
readOnly: true,
3232
},
@@ -55,7 +55,7 @@ const vm = agentOS({
5555
software: [pi],
5656
mounts: [
5757
{
58-
path: "/workspace/data",
58+
path: "/home/user/data",
5959
plugin: {
6060
id: "s3",
6161
config: {
@@ -90,7 +90,7 @@ const vm = agentOS({
9090
software: [pi],
9191
mounts: [
9292
{
93-
path: "/workspace/drive",
93+
path: "/home/user/drive",
9494
plugin: {
9595
id: "google_drive",
9696
config: {
@@ -123,7 +123,7 @@ import pi from "@agentos-software/pi";
123123
const vm = agentOS({
124124
software: [pi],
125125
mounts: [
126-
{ path: "/workspace/scratch", driver: createInMemoryFileSystem() },
126+
{ path: "/home/user/scratch", driver: createInMemoryFileSystem() },
127127
],
128128
});
129129

@@ -151,10 +151,10 @@ const client = createClient<typeof registry>({ endpoint: "http://localhost:6420"
151151
const agent = client.vm.getOrCreate("my-agent");
152152

153153
// Write a file (string or Uint8Array)
154-
await agent.writeFile("/workspace/hello.txt", "Hello, world!");
154+
await agent.writeFile("/home/user/hello.txt", "Hello, world!");
155155

156156
// Read a file (returns Uint8Array)
157-
const content = await agent.readFile("/workspace/hello.txt");
157+
const content = await agent.readFile("/home/user/hello.txt");
158158
console.log(new TextDecoder().decode(content));
159159
```
160160

@@ -165,14 +165,14 @@ console.log(new TextDecoder().decode(content));
165165
```ts
166166
// Batch write (creates parent directories automatically)
167167
const writeResults = await agent.writeFiles([
168-
{ path: "/workspace/src/index.ts", content: "console.log('hello');" },
169-
{ path: "/workspace/src/utils.ts", content: "export function add(a: number, b: number) { return a + b; }" },
168+
{ path: "/home/user/src/index.ts", content: "console.log('hello');" },
169+
{ path: "/home/user/src/utils.ts", content: "export function add(a: number, b: number) { return a + b; }" },
170170
]);
171171

172172
// Batch read
173173
const readResults = await agent.readFiles([
174-
"/workspace/src/index.ts",
175-
"/workspace/src/utils.ts",
174+
"/home/user/src/index.ts",
175+
"/home/user/src/utils.ts",
176176
]);
177177
for (const result of readResults) {
178178
console.log(result.path, new TextDecoder().decode(result.content ?? new Uint8Array()));
@@ -183,13 +183,13 @@ for (const result of readResults) {
183183

184184
```ts
185185
// Create a directory
186-
await agent.mkdir("/workspace/projects");
186+
await agent.mkdir("/home/user/projects");
187187

188188
// List directory contents
189-
const entries = await agent.readdir("/workspace/projects");
189+
const entries = await agent.readdir("/home/user/projects");
190190

191191
// Recursive listing with metadata
192-
const tree = await agent.readdirRecursive("/workspace", {
192+
const tree = await agent.readdirRecursive("/home/user", {
193193
maxDepth: 3,
194194
exclude: ["node_modules"],
195195
});
@@ -202,24 +202,24 @@ for (const entry of tree) {
202202

203203
```ts
204204
// Check if a path exists
205-
const fileExists = await agent.exists("/workspace/hello.txt");
205+
const fileExists = await agent.exists("/home/user/hello.txt");
206206

207207
// Get file metadata
208-
const info = await agent.stat("/workspace/hello.txt");
208+
const info = await agent.stat("/home/user/hello.txt");
209209
console.log(info.size, info.isDirectory, info.mtimeMs);
210210
```
211211

212212
### Move and delete
213213

214214
```ts
215215
// Move/rename
216-
await agent.move("/workspace/old.txt", "/workspace/new.txt");
216+
await agent.move("/home/user/old.txt", "/home/user/new.txt");
217217

218218
// Delete a file
219-
await agent.delete("/workspace/new.txt");
219+
await agent.delete("/home/user/new.txt");
220220

221221
// Delete a directory recursively
222-
await agent.delete("/workspace/temp", { recursive: true });
222+
await agent.delete("/home/user/temp", { recursive: true });
223223
```
224224

225225
*[See Full Example](https://github.com/rivet-dev/agent-os/tree/main/examples/docs/filesystem)*
@@ -234,7 +234,7 @@ const vm = agentOS({
234234
permissions: {
235235
fs: {
236236
default: "allow",
237-
rules: [{ mode: "deny", operations: ["*"], paths: ["/workspace/secrets/**"] }],
237+
rules: [{ mode: "deny", operations: ["*"], paths: ["/home/user/secrets/**"] }],
238238
},
239239
},
240240
});
@@ -250,7 +250,7 @@ For heavier or untrusted workloads, run a full Linux [sandbox](/docs/sandbox) al
250250

251251
With no `mounts` configured, every VM boots an Alpine-based root filesystem with the standard POSIX directories:
252252

253-
- `/workspace`: the agent's default working directory and `pwd` when spawned, where it reads and writes (mounts land under it, e.g. `/workspace/data`).
253+
- `/home/user`: the agent's home directory (`$HOME`) and default working directory (`pwd`) when spawned, where it reads and writes (mounts land under it, e.g. `/home/user/data`).
254254
- `/bin`, `/sbin`, `/usr`: installed commands (common POSIX utilities by default, plus any [software](/docs/software) you add).
255255
- `/etc`, `/lib`, `/opt`, `/root`, `/run`, `/srv`, `/tmp`, `/var`, `/mnt`: standard system paths.
256256

website/src/content/docs/docs/permissions.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,23 @@ There is no typed `"ask"` mode. Interactive, human-in-the-loop approval lives in
8989
For finer control, a scope can be a rule set instead of a bare mode: a `default` mode plus an ordered list of `rules`. The `fs` scope matches by `paths` (filesystem globs). Each rule names its `operations` (`read`, `write`, `stat`, `readdir`, `create_dir`, `rm`, `rename`, `symlink`, `readlink`, `chmod`, `truncate`, `mount_sensitive`, or `["*"]` for all). Last matching rule wins; if no rule matches, `default` applies.
9090

9191
```ts
92-
// Allow the filesystem everywhere, but deny anything under /workspace/vault.
92+
// Allow the filesystem everywhere, but deny anything under /home/user/vault.
9393
const denyVault = {
9494
fs: {
9595
default: "allow",
96-
rules: [{ mode: "deny", operations: ["*"], paths: ["/workspace/vault/**"] }],
96+
rules: [{ mode: "deny", operations: ["*"], paths: ["/home/user/vault/**"] }],
9797
},
9898
};
9999
```
100100

101101
To invert it, flip `default` to `"deny"` and allow just one subtree:
102102

103103
```ts
104-
// Deny the filesystem by default, allow only reads under /workspace/data.
104+
// Deny the filesystem by default, allow only reads under /home/user/data.
105105
const allowOnlyData = {
106106
fs: {
107107
default: "deny",
108-
rules: [{ mode: "allow", operations: ["read", "readdir", "stat"], paths: ["/workspace/data/**"] }],
108+
rules: [{ mode: "allow", operations: ["read", "readdir", "stat"], paths: ["/home/user/data/**"] }],
109109
},
110110
};
111111
```

website/src/content/docs/docs/sandbox.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const vm = agentOS({
5454
bindings: [createSandboxBindings({ client: sandbox })],
5555
// Mounts let the agent read the sandbox filesystem (optional)
5656
mounts: [
57-
{ path: "/workspace/sandbox", plugin: createSandboxFs({ client: sandbox }) },
57+
{ path: "/home/user/sandbox", plugin: createSandboxFs({ client: sandbox }) },
5858
],
5959
});
6060

@@ -76,17 +76,17 @@ import type { registry } from "./server";
7676
const client = createClient<typeof registry>({ endpoint: "http://localhost:6420" });
7777
const vm = client.vm.getOrCreate("my-agent");
7878

79-
// Write code via the filesystem. The /workspace/sandbox mount maps to the sandbox root.
80-
await vm.writeFile("/workspace/sandbox/app/index.ts", 'console.log("hello")');
79+
// Write code via the filesystem. The /home/user/sandbox mount maps to the sandbox root.
80+
await vm.writeFile("/home/user/sandbox/app/index.ts", 'console.log("hello")');
8181

8282
// Run it inside the sandbox. Commands execute through the VM's process table,
8383
// reading the file from the mounted directory.
84-
const result = await vm.exec("node /workspace/sandbox/app/index.ts");
84+
const result = await vm.exec("node /home/user/sandbox/app/index.ts");
8585
console.log(result.stdout); // "hello\n"
8686

8787
// Call a mounted binding from the client. The sandbox bindings are exposed inside the
8888
// VM as a CLI command, so you invoke it through the same exec/spawn surface.
89-
const install = await vm.exec("agentos-sandbox run-command --command \"npm install\" --cwd /workspace/sandbox/app");
89+
const install = await vm.exec("agentos-sandbox run-command --command \"npm install\" --cwd /home/user/sandbox/app");
9090
console.log(install.exitCode, install.stdout);
9191

9292
// Spawn a long-running process via the bindings and stream its output.

0 commit comments

Comments
 (0)