> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Spaces

> Spaces are isolated control and permission boundaries for runtime work.

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

```ts
const space = await bctrl.spaces.create({
  name: "acme-invoice-ops",
  region: "us-east",
  metadata: {
    customerId: "acme",
  },
});
```

## Mount resources

Mounts define the resources runtimes and invocations can access.

```ts
const space = await bctrl.spaces.create({
  name: "acme-invoice-ops",
  mounts: {
    storage: { space: "acme" },
    vault: { allow: ["clients/acme/"] },
    ai: { allowConnections: ["anthropic-prod"] },
  },
});
```

| Mount          | Purpose                                                    |
| -------------- | ---------------------------------------------------------- |
| Storage        | Durable files, uploads, downloads, reports, and artifacts. |
| Vault          | Secrets such as credentials, API keys, and TOTP seeds.     |
| AI Connections | Provider credentials for hosted agent invocations.         |
| Proxies        | Network routing for browser runtimes.                      |

## Launch runtimes inside a space

```ts
const runtime = await space.runtimes.browser.launch({
  name: "crm",
});
```

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.

```ts
const context = await space.agentContext({
  runtimeId: runtime.id,
});

console.log(context.operations.map((operation) => operation.id));
```

## Related

* [Runtimes](/sdk/core-concepts/runtimes)
* [Connections](/sdk/core-concepts/connections)
* [Mounts & Inheritance](/sdk/core-concepts/mounts-inheritance)