# Tenancy

URL: /code/platform/tenancy · Id: `capability:tenancy`

> Tenancy isolates each Customer in its own Tenant inside a Startup namespace, from records and keys to Limits.

Tenancy gives each [Customer](/business/nouns/customer) of a [Startup](/business/nouns/startup) its own [Tenant](/business/nouns/tenant): a partition of records, keys, [Settings](/business/nouns/setting) and [Limits](/business/nouns/limit) no other Customer reaches.

## Contract
- A Startup is a namespace at `api.sb/<domain>`. A Tenant adds one path segment, `api.sb/<domain>/<tenant>`, or takes its own host.
- A Tenant's data belongs to the Customer it was made for. The Startup operates it.
- A Tenant's keys reach only that Tenant. No query crosses Tenants, whatever its filter.
- Settings inherit from [Studio](/business/nouns/studio) to Startup to Tenant, nearest holder first. A locked Setting overrides every descendant, and a child may tighten a value but never loosen it.
- Limits apply per Tenant, so one Customer's traffic never spends another's capacity.
- `Tenant.provision` creates a Tenant with its keys, defaults and an admin invitation in one [Action](/business/nouns/action).
- An [Agent](/business/nouns/agent) sold to Customers runs a [Worker](/business/nouns/worker) in each Customer's Tenant, with that Tenant's [Memory](/business/nouns/memory) only.
- A Tenant is private by default. It can open reads to any key holder, or to the public.

## Verbs
| Verb | Object | Event |
| --- | --- | --- |
| [Tenant.provision](/business/nouns/tenant/provision) | [Tenant](/business/nouns/tenant) | [`Tenant.provisioned`](/business/events/Tenant.provisioned) |
| [Domain.connect](/business/nouns/domain/connect) | [Domain](/business/nouns/domain) | [`Domain.connected`](/business/events/Domain.connected) |

## Interfaces
- [API](/code/api/reference)
- [SDK](/code/sdk/reference)
- [CLI](/code/cli/reference)
- [MCP](/code/mcp/reference)

## Example
```ts
// shiftly.app schedules restaurant staff. Each restaurant group is one Tenant.
import { $ } from 'startup-builder'

const tenant = await $.Tenant.provision({
  customer: 'customer_harbor_group',
})
// tenant.$id: https://api.sb/shiftly.app/harbor-group
```