Spaces

View as Markdown

A space is the durable boundary for an automation workflow, customer, or agent. It owns runtimes, space storage, tools, vault access, AI credentials, and run records.

Use spaces to separate customers, workflows, environments, or permission scopes.

Create a space

1const space = await bctrl.spaces.create({
2 name: "acme-invoice-ops",
3 region: "us-east",
4 metadata: {
5 customerId: "acme",
6 },
7});

Mount resources

Mounts define the resources runtimes and invocations can access.

1const space = await bctrl.spaces.create({
2 name: "acme-invoice-ops",
3 mounts: {
4 storage: { space: "acme" },
5 vault: { allow: ["clients/acme/"] },
6 ai: { allowConnections: ["anthropic-prod"] },
7 },
8});
MountPurpose
StorageDurable files, uploads, downloads, reports, and artifacts.
VaultSecrets such as credentials, API keys, and TOTP seeds.
AI ConnectionsProvider credentials for hosted agent invocations.
ProxiesNetwork routing for browser runtimes.

Launch runtimes inside a space

1const runtime = await space.runtimes.browser.launch({
2 name: "crm",
3});

Runtimes inherit the space boundary. Runtime-level configuration can narrow access, but should not expand beyond the space.

Ask for Agent Context

Agent Context gives coding agents a structured guide to the current space.

1const context = await space.agentContext({
2 runtimeId: runtime.id,
3});
4
5console.log(context.operations.map((operation) => operation.id));