Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Bot box: show a command line's server files only when the caller named them (#5223)

Milind Soni04288922079a
diff --git a/server/bot-box/box-cleanup.linux.test.ts b/server/bot-box/box-cleanup.linux.test.ts
index 7b47963854..944049ad29 100644
--- a/server/bot-box/box-cleanup.linux.test.ts
+++ b/server/bot-box/box-cleanup.linux.test.ts
@@ -16,11 +16,13 @@ describe.skipIf(process.platform !== "linux")("BoxRunner refusal cleanup", () =>
it.each(["explicit", "argv"] as const)("releases seccomp descriptors and broker grants on %s read-only refusal", async (source) => {
const root = mkdtempSync(join(tmpdir(), "omb-wrap-cleanup-"));
const home = join(root, "home"), dataDir = join(root, "data");
- const file = join(dataDir, "mcp.json"), filter = join(root, "seccomp.bpf");
+ // A path on the command line is shown only outside the data folder; one the caller names may be inside it.
+ const file = source === "argv" ? join(root, "turn", "mcp.json") : join(dataDir, "mcp.json"), filter = join(root, "seccomp.bpf");
let broker: CredentialBroker | undefined;
try {
mkdirSync(home);
mkdirSync(dataDir);
+ mkdirSync(join(root, "turn"));
writeFileSync(file, "fixture");
writeFileSync(filter, "filter");
broker = await openCredentialBroker({ socketPath: join(root, "b.sock") });
diff --git a/server/bot-box/command-line-paths.linux.test.ts b/server/bot-box/command-line-paths.linux.test.ts
new file mode 100644
index 0000000000..2141dc10ea
--- /dev/null
+++ b/server/bot-box/command-line-paths.linux.test.ts
@@ -0,0 +1,80 @@
+// The real box, where it can run (Linux with an unprivileged bubblewrap): what a path on a command line, or in a
+// configured server's environment, shows of the data folder. Elsewhere the suite says so and skips.
+import { spawn } from "node:child_process";
+import { closeSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+
+import { BotBox } from "./box.ts";
+import { detectBox } from "./detect.ts";
+
+const ENV = { PATH: process.env.PATH ?? "/usr/local/bin:/usr/bin:/bin", OMB_BOT_BOX: "1" };
+const detection = detectBox({ env: ENV });
+const CANARY = "OPENMAUSBOT-COMMAND-LINE-CANARY";
+
+describe.skipIf(detection.box !== "bwrap")(`paths on a boxed command line (${detection.box === "bwrap" ? "bubblewrap works here" : `skipped: ${detection.reason}`})`, () => {
+ const root = mkdtempSync(join(tmpdir(), "omb-argv-real-"));
+ const home = join(root, "home"), dataDir = join(home, ".openmausbot"), cwd = join(dataDir, "task-workspaces", "bot-1", "thread-1");
+ const settings = join(dataDir, "config.json"), handed = join(dataDir, "hook-tokens", "t", "token"), outside = join(root, "turn", "mcp.json");
+ const box = new BotBox();
+ beforeAll(async () => {
+ for (const dir of [cwd, join(dataDir, "workspaces", "bot-1"), join(dataDir, "workspaces", "bot-2"), join(dataDir, "hook-tokens", "t"), join(root, "turn")]) mkdirSync(dir, { recursive: true, mode: 0o700 });
+ for (const file of [settings, join(dataDir, "messages.db"), join(dataDir, "workspaces", "bot-2", "MEMORY.md")]) writeFileSync(file, CANARY, { mode: 0o600 });
+ writeFileSync(handed, "a file the server hands this turn");
+ writeFileSync(outside, "the turn's own config");
+ expect((await box.start({ dataDir, home, port: 1, env: ENV, denyEnv: new Set(), log: () => {} })).box).toBe("bwrap");
+ });
+ afterAll(async () => { await box.stop(); rmSync(root, { recursive: true, force: true }); });
+
+ function run(args: string[], extra: { env?: Record<string, string>; configured?: boolean; ro?: string[] } = {}): Promise<{ code: number | null; out: string }> {
+ const wrapped = box.wrap({ command: "/bin/sh", args, cwd, env: { ...ENV, HOME: home, ...extra.env }, botId: "bot-1", ...(extra.ro ? { ro: extra.ro } : {}), ...(extra.configured ? { configured: true, allowEnv: Object.keys(extra.env ?? {}) } : {}) })!;
+ return new Promise((resolve) => {
+ const child = spawn(wrapped.command, wrapped.args, { env: wrapped.env, stdio: ["ignore", "pipe", "pipe", ...wrapped.extraFds] });
+ for (const fd of wrapped.extraFds) try { closeSync(fd); } catch {}
+ let out = "";
+ child.stdout?.on("data", (chunk) => { out += chunk; });
+ child.stderr?.on("data", (chunk) => { out += chunk; });
+ child.once("exit", (code) => { wrapped.release(); resolve({ code, out }); });
+ });
+ }
+ const cat = 'for path in "$@"; do cat "${path#--model=}" 2>&1; done';
+
+ it("shows nothing of the data folder for a path named there, in it or above it", async () => {
+ for (const args of [[settings], [join(dataDir, "messages.db")], [`--model=${settings}`], [dataDir, settings], [join(dataDir, ".."), settings], [join(dataDir, "workspaces", "bot-2", "MEMORY.md")]]) {
+ expect((await run(["-c", cat, "sh", ...args])).out, args.join(" ")).not.toContain(CANARY);
+ }
+ }, 60_000);
+
+ it("still shows a file outside the data folder that the command line names, and one inside it that the caller names", async () => {
+ expect((await run(["-c", cat, "sh", outside])).out).toBe("the turn's own config");
+ expect((await run(["-c", cat, "sh", handed], { ro: [join(dataDir, "hook-tokens", "t")] })).out).toBe("a file the server hands this turn");
+ }, 60_000);
+
+ it("still runs a configured server whose program is in the bot's own folder, with the bot known or not", async () => {
+ const program = join(dataDir, "workspaces", "bot-1", "tools", "server.sh");
+ mkdirSync(join(dataDir, "workspaces", "bot-1", "tools"), { recursive: true });
+ writeFileSync(program, "echo \"the bot's own server ran\"\n");
+ expect((await run([program], { configured: true })).out).toBe("the bot's own server ran\n");
+ const unknown = box.wrap({ command: "/bin/sh", args: [program], env: { ...ENV, HOME: home }, configured: true })!;
+ const out = await new Promise<string>((resolve) => {
+ const child = spawn(unknown.command, unknown.args, { env: unknown.env, stdio: ["ignore", "pipe", "pipe", ...unknown.extraFds] });
+ for (const fd of unknown.extraFds) try { closeSync(fd); } catch {}
+ let text = "";
+ child.stdout?.on("data", (chunk) => { text += chunk; });
+ child.stderr?.on("data", (chunk) => { text += chunk; });
+ child.once("exit", () => { unknown.release(); resolve(text); });
+ });
+ expect(out).toBe("the bot's own server ran\n");
+ }, 60_000);
+
+ it("makes nothing of the data folder readable or writable through a configured server's environment", async () => {
+ for (const name of ["XDG_CACHE_HOME", "CODEX_HOME", "CLAUDE_CONFIG_DIR"]) {
+ for (const value of [dataDir, settings, join(dataDir, "workspaces", "bot-2")]) {
+ const tried = await run(["-c", `${cat}; echo x >> '${settings}'`, "sh", settings, join(dataDir, "workspaces", "bot-2", "MEMORY.md")], { env: { [name]: value }, configured: true });
+ expect(tried.out, `${name}=${value}`).not.toContain(CANARY);
+ }
+ }
+ expect(readFileSync(settings, "utf8")).toBe(CANARY);
+ }, 120_000);
+});
diff --git a/server/bot-box/hardlink.test.ts b/server/bot-box/hardlink.test.ts
index 8a3534e3fe..01d68e8822 100644
--- a/server/bot-box/hardlink.test.ts
+++ b/server/bot-box/hardlink.test.ts
@@ -34,7 +34,8 @@ describe.skipIf(process.platform === "win32")("read-only file hardlinks", () =>
it("refuses a read-only source hardlinked after planning", () => {
const f = fixture();
- const given = planBox(f, { command: "/bin/sh", args: ["--mcp-config", f.file], env: {} });
+ // In the data folder, so the caller names it: a command line alone shows nothing there.
+ const given = planBox(f, { command: "/bin/sh", args: ["--mcp-config", f.file], env: {}, ro: [f.file] });
linkSync(f.file, f.alias);
expect(() => bwrapArgs(given)).toThrow(/multiply-linked read-only file: .*; grant a separate single-link copy instead\./);
});
diff --git a/server/bot-box/plan.test.ts b/server/bot-box/plan.test.ts
index 671463f46d..856945690d 100644
--- a/server/bot-box/plan.test.ts
+++ b/server/bot-box/plan.test.ts
@@ -201,6 +201,45 @@ linuxBox("the box plan", () => {
expect(bwrapArgs(plan).join(" ")).not.toContain("--tmpfs /srv/omb");
});
+ it("shows no path on the command line that is in the data folder or holds it, unless the caller named it", () => {
+ for (const { dataDir, home } of [{ dataDir: "/data/.openmausbot", home: "/data" }, { dataDir: "/srv/omb", home: "/home/maus" }]) {
+ const server = ["config.json", "sessions.json", "messages.db", "workspaces/other/MEMORY.md"].map((file) => join(dataDir, file));
+ const ask = (args: string[], ro: string[] = []) => planBox({ ...setup(), dataDir, home }, { command: "/bin/sh", args, cwd: join(dataDir, "task-workspaces", "b", "t"), env: {}, botId: "b", ro });
+ for (const args of [server, [dataDir], [`--model=${server[0]}`], [`@${server[0]}`], [join(dataDir, "..")], [join(dataDir, "workspaces", "..")], ["/srv", "/var"]]) {
+ const plan = ask(args);
+ for (const file of server) expect(visibleInBox(plan, file), `${dataDir}: ${args.join(" ")}`).toBe("none");
+ }
+ // A server whose program is in the bot's own folder still finds it: with the bot known its folder is there
+ // anyway, and without one (a configured server run for a chat) the file itself is shown, read-only.
+ expect(visibleInBox(ask([join(dataDir, "workspaces", "b", "tools", "server.js")]), join(dataDir, "workspaces", "b", "tools", "server.js"))).not.toBe("none");
+ const noBot = planBox({ ...setup(), dataDir, home }, { command: "python3", args: [join(dataDir, "workspaces", "b", "tools", "server.py")], env: {}, configured: true });
+ expect(visibleInBox(noBot, join(dataDir, "workspaces", "b", "tools", "server.py"))).toBe("ro");
+ expect(visibleInBox(noBot, join(dataDir, "config.json"))).toBe("none");
+ // Never another bot's for a box that has a bot, and never the folder of every bot.
+ expect(visibleInBox(ask([join(dataDir, "workspaces", "other", "MEMORY.md")]), join(dataDir, "workspaces", "other", "MEMORY.md"))).toBe("none");
+ for (const all of [join(dataDir, "workspaces"), join(dataDir, "task-workspaces")]) {
+ expect(visibleInBox(planBox({ ...setup(), dataDir, home }, { command: "ls", args: [all], env: {}, configured: true }), join(all, "other", "MEMORY.md"))).toBe("none");
+ }
+ expect(visibleInBox(ask(["--token", join(dataDir, "hook-tokens", "t", "token")], [join(dataDir, "hook-tokens", "t")]), join(dataDir, "hook-tokens", "t", "token"))).toBe("ro");
+ expect(visibleInBox(ask(["--mcp-config", "/tmp/omb-mcp-1/mcp.json"]), "/tmp/omb-mcp-1/mcp.json")).toBe("ro");
+ expect(visibleInBox(ask([]), join(dataDir, "bots", "b", "SOUL.md"))).toBe("ro");
+ }
+ });
+
+ it("makes nothing of the data folder writable for a configured server's environment, but the bot's own folders", () => {
+ const dataDir = "/data/.openmausbot";
+ const ask = (env: Record<string, string>, configured: boolean) => planBox({ ...setup(), dataDir, home: "/data" }, { command: "sh", args: [], cwd: join(dataDir, "task-workspaces", "b", "t"), env, botId: "b", configured });
+ for (const value of [join(dataDir, "config.json"), join(dataDir, "box"), dataDir, join(dataDir, "workspaces", "other"), "/"]) {
+ for (const name of ["XDG_CACHE_HOME", "CODEX_HOME", "CLAUDE_CONFIG_DIR", "TMPDIR"]) {
+ const plan = ask({ [name]: value }, true);
+ for (const file of ["config.json", "box/harness.sock", "messages.db", "workspaces/other/MEMORY.md"]) expect(visibleInBox(plan, join(dataDir, file)), `${name}=${value}`).toBe("none");
+ }
+ }
+ expect(visibleInBox(ask({ XDG_CACHE_HOME: join(dataDir, "workspaces", "b", "cache") }, true), join(dataDir, "workspaces", "b", "cache", "x"))).toBe("rw");
+ // An engine OpenMausBot starts keeps the home it was given there.
+ expect(visibleInBox(ask({ CODEX_HOME: join(dataDir, "providers", "codex-1") }, false), join(dataDir, "providers", "codex-1", "auth.json"))).toBe("rw");
+ });
+
it("each mutation opens exactly the hole it names", () => {
const base = turn();
const flips: Record<BoxMutation, (plan: ReturnType<typeof turn>) => boolean> = {
diff --git a/server/bot-box/plan.ts b/server/bot-box/plan.ts
index 03df446dba..aa49c6e5c7 100644
--- a/server/bot-box/plan.ts
+++ b/server/bot-box/plan.ts
@@ -75,6 +75,10 @@ export interface BoxRequest {
home?: string;
/** Files bound read-write over their names in `home`: the team's engine sign-ins. */
shared?: ReadonlyArray<{ source: string; target: string }>;
+ /** The command, its arguments and its environment are a server someone configured (an MCP server a bot may have
+ * added), not ones OpenMausBot built. Security: none of them puts anything of the data folder in the box but the
+ * bot's own folders, so an environment value naming a folder there is not made writable. */
+ configured?: boolean;
/** A host unix socket the box dials out to, so the server can reach a port the engine listens on inside the box's own
* network, such as a sign-in's callback. Only an isolated box has one. */
relay?: string;
@@ -200,6 +204,7 @@ export function planBox(setup: BoxSetup, request: BoxRequest): BoxPlan {
const own = join(dataDir, "workspaces", botId);
if (!covered(own)) rw(own);
}
+ const ownFolders = botId && ID.test(botId) ? [join(dataDir, "workspaces", botId), join(dataDir, "task-workspaces", botId)] : [];
if (mutate.has("bind-otherws")) {
rw(join(dataDir, "workspaces"));
rw(join(dataDir, "task-workspaces"));
@@ -207,7 +212,9 @@ export function planBox(setup: BoxSetup, request: BoxRequest): BoxPlan {
for (const name of PATH_ENV_NAMES) {
const value = request.env[name];
// A temp folder stays the box's own private one; anything else the engine writes is put back.
- if (value && isAbsolute(value) && !covered(resolve(value)) && !PRIVATE_INSIDE.some((base) => under(resolve(value), base))) rw(resolve(value));
+ if (!value || !isAbsolute(value) || covered(resolve(value)) || PRIVATE_INSIDE.some((base) => under(resolve(value), base))) continue;
+ if (request.configured && (under(resolve(value), dataDir) || under(dataDir, resolve(value))) && !ownFolders.some((folder) => under(resolve(value), folder))) continue;
+ rw(resolve(value));
}
for (const path of request.rw ?? []) if (!covered(resolve(path))) rw(resolve(path));
if (ownHome) {
@@ -226,9 +233,19 @@ export function planBox(setup: BoxSetup, request: BoxRequest): BoxPlan {
mounts.push({ kind: "ro", source: shown, target: shown, optional: true });
}
const readOnly = new Set<string>();
+ const inBotFolder = (path: string) => ["workspaces", "task-workspaces"].some((kind) => {
+ const [owner, ...rest] = relative(join(dataDir, kind), path).split(sep);
+ return owner !== undefined && ID.test(owner) && !rest.includes("..") && (botId ? owner === botId : true);
+ });
+ const named = new Set((request.ro ?? []).map((path) => resolve(path)));
+ if (botId && ID.test(botId)) named.add(join(dataDir, "bots", botId, "SOUL.md"));
for (const path of [...(request.ro ?? []), ...argvPaths(request.args), ...(botId && ID.test(botId) ? [join(dataDir, "bots", botId, "SOUL.md")] : [])]) {
const full = resolve(path);
if (request.ro?.includes(path)) assertReadOnlySource(full);
+ // Security: a command line is not a grant. A path on one that is in the data folder, or holds it, is shown only
+ // when the caller named it in `ro`, or when it is in a bot's folder: this box's bot's, or any bot's where the caller
+ // gave no bot (a configured server's program lives in the folder of the bot that added it).
+ if (!named.has(full) && (under(full, dataDir) || under(dataDir, full)) && !covered(full) && !inBotFolder(full)) continue;
// Code and the system are already there; a file under HOME or /tmp the command line names is put back read-only.
if (covered(full) || readOnly.has(full)) continue;
if (["/usr", "/etc", "/opt", "/var/lib", ...setup.codeRoots, ...setup.engineRoots].some((base) => under(full, resolve(base)))) continue;
diff --git a/server/drivers/chat-mcp-tools.test.ts b/server/drivers/chat-mcp-tools.test.ts
index 96dd8a2ff6..ae87fc0f6f 100644
--- a/server/drivers/chat-mcp-tools.test.ts
+++ b/server/drivers/chat-mcp-tools.test.ts
@@ -257,7 +257,7 @@ describe("Chat MCP session", () => {
const session = await mountChatTools({ agents: agents.server, custom: { onepassword: own.server } }, own.controller.signal);
sessions.push(session);
const of = (receipt: string) => spawned.find((entry) => entry.opts.env?.RECEIPT === receipt)!;
- expect(of(own.receipt)).toMatchObject({ owner: "bot", opts: { box: { allowEnv: ["RECEIPT", "OP_SERVICE_ACCOUNT_TOKEN"] } } });
+ expect(of(own.receipt)).toMatchObject({ owner: "bot", opts: { box: { allowEnv: ["RECEIPT", "OP_SERVICE_ACCOUNT_TOKEN"], configured: true } } });
expect(of(agents.receipt).opts.box).toBeUndefined();
});
diff --git a/server/drivers/chat-mcp-tools.ts b/server/drivers/chat-mcp-tools.ts
index 8fc21f812e..f38802f031 100644
--- a/server/drivers/chat-mcp-tools.ts
+++ b/server/drivers/chat-mcp-tools.ts
@@ -106,7 +106,7 @@ export class ChatMcpClient {
// The desktop shell inherits Finder's bare PATH, where `npx`-style servers cannot find `node`.
this.child = spawnCli(server.command, server.args, {
stdio: ["pipe", "pipe", "pipe"], env: chatMcpEnvironment(server.env),
- ...(configured ? { box: { allowEnv: Object.keys(server.env) } } : {}),
+ ...(configured ? { box: { allowEnv: Object.keys(server.env), configured: true } } : {}),
}, "bot");
} catch { throw new Error("MCP server could not start; check its command and installation"); }
this.child.stdout.setEncoding("utf8");
diff --git a/server/mcp-bot-servers.test.ts b/server/mcp-bot-servers.test.ts
index 287cd0a24c..92be2884ae 100644
--- a/server/mcp-bot-servers.test.ts
+++ b/server/mcp-bot-servers.test.ts
@@ -147,6 +147,36 @@ describe("a bot adding a server where bots are boxed", () => {
});
});
+describe("a bot adding a server that names the server's own files, where bots are boxed", () => {
+ it("is refused for settings, sessions, the chats and the data folder itself, however the path is written", () => {
+ const data = dataDir();
+ const attempts = [
+ { command: "sh", args: ["-c", 'cat "$1" >&2', "sh", join(data, "config.json")], env: {} },
+ { command: "sh", args: ["-c", "true", "sh", data], env: {} },
+ { command: "cat", args: [join(data, "messages.db")], env: {} },
+ { command: "node", args: [`--config=${join(data, "sessions.json")}`], env: {} },
+ { command: "node", args: ["x.js"], env: { CONFIG: join(data, "logins.json") } },
+ { command: join(data, "config.json"), args: [], env: {} },
+ { command: "cat", args: [join(data, "workspaces", "..", "config.json")], env: {} },
+ ];
+ for (const attempt of attempts) {
+ expect(addBotMcpServer({}, { name: "leak", ...attempt }, "iris", data, true), JSON.stringify(attempt))
+ .toMatchObject({ ok: false, status: 400, error: expect.stringMatching(/a file of the server's own/) });
+ }
+ });
+
+ it("still takes its own files, an engine OpenMausBot installed, and paths outside the data folder", () => {
+ const data = dataDir();
+ const own = addBotMcpServer({}, { name: "own", ...python(file(join(data, "workspaces", "iris", "tools", "s.py"))) }, "iris", data, true);
+ expect(own.ok).toBe(true);
+ for (const server of [{ command: "npx", args: ["-y", "@x/files-mcp", "/srv/docs", "/"], env: {} }, python("/opt/tools/server.py")]) {
+ expect(addBotMcpServer({}, { name: "plain", ...server }, "iris", data, true).ok, JSON.stringify(server)).toBe(true);
+ }
+ // Unboxed, every bot is the server's user already: the add is as it was.
+ expect(addBotMcpServer({}, { name: "desk", command: "cat", args: [join(data, "config.json")], env: {} }, "iris", data, false).ok).toBe(true);
+ });
+});
+
describe("a bot adding a server where every bot reaches every folder (a desktop)", () => {
it("still keeps files from a conversation folder in its own folder, but the server stays every bot's", () => {
const data = dataDir();
diff --git a/server/mcp-bot-servers.ts b/server/mcp-bot-servers.ts
index 8b1039ca13..bae0c301a4 100644
--- a/server/mcp-bot-servers.ts
+++ b/server/mcp-bot-servers.ts
@@ -6,6 +6,7 @@ import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, realpathSync } f
import { basename, delimiter, isAbsolute, join, relative, resolve, sep } from "node:path";
import type { StdioMcpSpec } from "./contracts.ts";
+import { engineInstallRoots } from "./engine-roots.ts";
import { addDisabledMcpServer, isRemoteMcpServer, parseStoredMcpServer, type DisabledMcpServerAdd, type StoredStdioMcpServer } from "./mcp-registry.ts";
const ID = /^[A-Za-z0-9_-]{1,128}$/;
@@ -56,6 +57,19 @@ export function botFolderUse(server: StdioMcpSpec, dataDir: string): BotFolderUs
return botId ? { botId, temporary } : null;
}
+/** A path of this server's that is in the data folder and is no bot's folder and no engine OpenMausBot installed: the
+ * server's own files (settings, sessions, saved logins), which no bot's command may name. */
+export function serverFileUse(server: StdioMcpSpec, dataDir: string): string | null {
+ const root = resolve(dataDir);
+ const open = [join(root, "workspaces"), join(root, "task-workspaces"), ...engineInstallRoots(root).map((path) => resolve(path))];
+ for (const value of values(server)) {
+ const full = resolve(value);
+ if (full !== root && segments(full, root) === null) continue;
+ if (!open.some((folder) => segments(full, folder) !== null)) return full;
+ }
+ return null;
+}
+
/** Bytes and files under `path`, never following a link; null once past the limits. */
function size(path: string, total = { bytes: 0, files: 0 }): { bytes: number; files: number } | null {
const stat = lstatSync(path);
@@ -131,6 +145,11 @@ export type BotKept =
* `boxed`: no bot reaches another's folders, so a server using this bot's files becomes its own, and one using another
* bot's files is refused; unboxed, every bot reaches them and the server stays every bot's. */
export function keepForBot(server: StoredStdioMcpServer, botId: string, dataDir: string, boxed: boolean): BotKept {
+ // Security: boxed, the data folder is not there for a bot; a command that names the server's own files is asking the
+ // server to show them (the box shows none of them, whatever a command line says: bot-box/plan.ts).
+ if (boxed && serverFileUse(server, dataDir)) {
+ return { ok: false, status: 400, error: "That command names a file of the server's own, which no bot can reach. Use files in your own folder." };
+ }
const use = botFolderUse(server, dataDir);
const theirs = use !== null && (use === "several" || use.botId !== botId);
if (theirs && boxed) {
diff --git a/server/mcp-probe.test.ts b/server/mcp-probe.test.ts
index d06ca81d90..274f43b29a 100644
--- a/server/mcp-probe.test.ts
+++ b/server/mcp-probe.test.ts
@@ -69,11 +69,11 @@ describe("custom MCP probe", () => {
return spawned[0]!.opts;
};
const anyBot = await opts({ asBot: {} });
- expect(anyBot.box).toEqual({ allowEnv: ["OP_SERVICE_ACCOUNT_TOKEN"] });
+ expect(anyBot.box).toEqual({ allowEnv: ["OP_SERVICE_ACCOUNT_TOKEN"], configured: true });
expect(anyBot).not.toHaveProperty("cwd");
const folder = mkdtempSync(join(tmpdir(), "omb-probe-bot-"));
try {
- expect(await opts({ asBot: { id: "ada", cwd: folder } })).toMatchObject({ cwd: folder, box: { botId: "ada", allowEnv: ["OP_SERVICE_ACCOUNT_TOKEN"] } });
+ expect(await opts({ asBot: { id: "ada", cwd: folder } })).toMatchObject({ cwd: folder, box: { botId: "ada", allowEnv: ["OP_SERVICE_ACCOUNT_TOKEN"], configured: true } });
} finally { await removeTempDir(folder); }
const plain = await opts({});
expect(plain).not.toHaveProperty("box");
diff --git a/server/mcp-probe.ts b/server/mcp-probe.ts
index 8dd1790809..dd42c0bae3 100644
--- a/server/mcp-probe.ts
+++ b/server/mcp-probe.ts
@@ -236,7 +236,7 @@ function probeStdioMcpServer(
...(options.asBot ? (options.asBot.cwd ? { cwd: options.asBot.cwd } : {}) : { cwd: process.cwd() }),
env: probeEnvironment(server),
stdio: ["pipe", "pipe", "pipe"],
- ...(options.asBot ? { box: { ...(options.asBot.id ? { botId: options.asBot.id } : {}), allowEnv: Object.keys(server.env) } } : {}),
+ ...(options.asBot ? { box: { ...(options.asBot.id ? { botId: options.asBot.id } : {}), allowEnv: Object.keys(server.env), configured: true } } : {}),
});
} catch {
resolve({ ok: false, error: publicProbeError("spawn") });
diff --git a/server/procs.ts b/server/procs.ts
index 35280bb6ee..a125581e6d 100644
--- a/server/procs.ts
+++ b/server/procs.ts
@@ -173,7 +173,7 @@ export type CliOwner = "bot" | "openmausbot";
/** The bot box (server/bot-box): a `bot` spawn runs in it where it is on; `box` asks for one for another owner, with more
* paths or the host's network, and `false` keeps a spawn out of it. */
export interface BoxSpawnOptions {
- box?: boolean | Pick<BoxRequest, "rw" | "ro" | "net" | "botId" | "botThreads" | "allowEnv" | "relay">;
+ box?: boolean | Pick<BoxRequest, "rw" | "ro" | "net" | "botId" | "botThreads" | "allowEnv" | "relay" | "configured">;
/** On a Team Cloud, runs in its conversation's engine home though it is not a bot's engine (a keep-warm ping). */
engineHome?: boolean;
/** A bot's own work that is not its engine (its browser, a helper engine): memory runs out on it first, as on a `bot`