> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Placement

> Choose who operates each capability your app reaches: Bijection's managed provider by default, or your own provider over the same protocol.

Your code names what the program reaches. The installation says who operates
it. Bijection operates many capabilities out of the box: the target sandbox,
Lake SQL, Flink, change capture, the Iceberg catalog and its storage,
file storage, encryption keys, model accounts, the partner sync relay, an
inbound mail address and telemetry export. You can operate any of them
yourself instead, over the same protocol. There is one way to choose, the
bindings file you pass to `bijection deploy --bindings <file>`. One way to inspect
the choice, `bijection placement`; one way to change it, `bijection deploy`;
and one usage record to pay for it.

## Slots

A **slot** is one declaration your program reaches but does not fill. Its name
is its path in the app tree: a handler target at `scoring.score`, a pipeline
named `counts` at `etl.counts`, a Datasets catalog at `lake.catalogs.lake`.
Every target, pipeline, catalog, capture replica, model provider pack, worker
pool and mail address is its own slot. Libraries declare their slots; you
mount the library and the slots appear under its path. Run
`bijection placement` to list every slot of your app.

Each slot speaks a named, versioned **protocol**, such as `lake-sql@1` or
`object-store@1`. Bijection's provider and yours speak the same protocol, so
your code and its results do not depend on who operates the slot. A choice
that can change the answer, such as a pipeline's SQL engine, a document
analysis engine or a model, is code: deploy refuses a provider that does not
serve it.

The host itself reaches three slots at reserved paths:

| Slot | Protocol | What it holds |
| - | - | - |
| `platform.files` | `object-store@1` | The bytes of [files](https://docs.bijection.com/files) |
| `platform.keys` | `key-root@1` | The root that wraps the installation's data keys |
| `platform.telemetry` | `otlp@1` | Logs, exceptions, audit events and traces sent out of the installation |

The `platform` root of every program is reserved. It holds these host slots
and the platform's own mounts (the placement reconciler at
`platform.placement` and the telemetry export); deploy refuses anything else
your code declares under `platform`.

A target or receiver that names its own endpoint in code, such as
`http("https://api.crm.example")`, has made its choice and is not a slot.

## The bindings file

The installation's operator keeps one TypeScript file per installation, or
per kind of installation, that default-exports `placement.bindings([...])`.
It holds provider bindings, `bind(slot, provider)`, and resource entries,
which choose which thing a slot reads: a replica's
[capture source](https://docs.bijection.com/integrations/replica) and the sync destinations of
`syncDestinations({...})`. Each slot and each named selection appears at
most once. Share choices
across installations by importing ordinary lists.

```ts ops/bindings/production.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { placement } from "@bijectionhq/bijection";
const { bind, bindings, platform } = placement;

export default bindings([
  bind(platform.files, placement.managed({ storage: placement.aws.s3Bucket({ account: "111122223333", name: "acme-files", region: "eu-west-1" }) })),
  bind(platform.keys, placement.managed({ root: placement.aws.kms({ arn: "arn:aws:kms:eu-west-1:111122223333:key/9f0c…" }) })),
  bind(platform.telemetry, placement.otlp({ url: "https://otlp.acme.example", credential: "telemetry.token" })),
]);
```

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deploy --installation acme:production --bindings ops/bindings/production.ts --trial
bijection deploy --installation acme:production --bindings ops/bindings/production.ts
```

A deploy with `--bindings` replaces the installation's accepted map. Omit
`--bindings` to reuse that map, including for hosted builds. Passing a file
with `bindings([])` returns every slot to Bijection's managed provider. An
installation that never passed a file runs every slot managed. Deploy never
reads a bindings file you do not pass; `bijection.bindings.ts` names only a
component package's own manifest.

Choose a provider through its protocol's constructor:

* **`placement.managed(params?)`** is Bijection's provider, and omitting a
  slot means the same. Its parameters are exactly the ones the slot's
  protocol declares. When Bijection's driver operates your own account or
  store, that account is a typed **resource** parameter: a catalog's or
  Files' `storage`
  (`placement.managed({ storage: placement.aws.s3Bucket({ … }) })`), the key
  root (`root: placement.aws.kms(...)`), and an `account` for Textract or
  Transcribe (`placement.aws.account`), partner sync (`fivetran.account`,
  `airbyte.workspace`) or inbound mail (`placement.aws.ses`). Your account's
  region and custodian are the label's evidence; the driver's tenancy is the
  offer's; release never deletes bytes in your account. A missing required
  parameter refuses the deploy with `InputMissing`, including on a host whose
  driver has no default account of its own.
* **`endpoint({ url, hosts, credential, network? })`** reaches any provider
  that speaks Bijection's HTTPS target wire: a [handler](https://docs.bijection.com/functions/targets.md)
  on Lambda or Cloud Run, your own Lake SQL runner or Flink provider, a
  Debezium capture provider. `url` may be
  `placement.env("NAME")`, an installation input; `hosts` are the hosts it may
  connect to, required when `url` comes from the environment. `credential` is
  the path of a secret you set with `bijection secret set`.
* **Typed constructors** build customer providers that speak a foreign-wire
  protocol themselves: `placement.otlp`, and from the owning library's
  package root `icebergRest`, `selfHostedGateway`, `anthropicAccount` or
  `openaiAccount` (an OpenAI-compatible server binds with
  `openaiAccount({ url, credential })`).

A protocol names its credential roles. A provider of a one-role protocol
takes `credential`; a provider of a protocol with several roles takes
`credentials` naming every role, such as a catalog's
`credentials: { writer: "lake.rw", reader: "lake.ro" }`. Bindings carry
secret references, never values.

`placement.env("NAME")` stays a reference in the build. At deploy, the host
reads `NAME` from the installation's
[environment variables](https://docs.bijection.com/operate/configuration/environment-variables.md)
(`bijection env set NAME …`), for a deploy from your machine and a hosted build
alike. A variable with no value refuses the deploy with `InputMissing` on
that slot.

What a provider reaches is a parameter of that provider. The bucket a managed
catalog writes to, a provider's private network attachment and a vendor
account are arguments of the provider, not slots of their own, and changing
one is a move of the slot.

### Typed slots in an operations repository

`bijection placement --types` prints typed slot references for a program, so
an operations repository can bind slots without the app's source:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection placement --types --installation my-app:staging --program "$PROGRAM" > placement-slots.ts
```

To pin a deployment to the choices you reviewed, add
`--write-plan placement.plan` to the trial and deploy with
`--apply-plan placement.plan` for the same installation. Apply checks the
release, intent, serving generations, provider identities and offered terms
against the review. If any of those changed, rerun the trial.

### Reach a provider through a network relay

`network` names the network relay group a provider on a private network is
reached through. The installation sends to the relay target named after the
slot: its path in lowercase, with `.` replaced by `-`. The slot `etl.counts`
is reached at the relay target `etl-counts`, so the relay's target file
lists `etl-counts` at your provider's host and port. A relay carries only a
fixed HTTPS `url`.

## Every capability

| Capability | Slot | Protocol | Managed provider | Your provider |
| - | - | - | - | - |
| [Handler targets](https://docs.bijection.com/functions/targets.md) | the target's path | `handler@1` | the target sandbox | `endpoint` (Lambda, Cloud Run, any HTTPS server) |
| [Lake SQL](https://docs.bijection.com/transforms/pipelines.md#use-the-installations-lake-sql) | `<mount>.<pipeline>` | `lake-sql@1` | the cell's DataFusion workers and Trino pool | `endpoint` to your runner |
| [Flink, batch](https://docs.bijection.com/transforms/pipelines.md#use-your-own-flink) | `<mount>.<pipeline>` | `flink-batch@1` | managed Flink | `endpoint` |
| [Flink, streaming](https://docs.bijection.com/transforms/pipelines.md#use-your-own-flink) | `<mount>.<pipeline>` | `flink-stream@1` | managed Flink | `endpoint` |
| [Change capture](https://docs.bijection.com/integrations/replica) | `<replica>.capture` | `exact-capture@1` | the cell's capture service | `endpoint` to your Debezium provider |
| [Connector gateway receivers](https://docs.bijection.com/integrations/connections.md) | each gateway receiver's own path, such as `sql.changes` | `connector-gateway@1` | the cell's connector gateway | `selfHostedGateway({ url, credential })` from `@bijectionhq/library-sources` |
| [Iceberg catalog and lake storage](https://docs.bijection.com/datasets/catalogs.md) | `<datasets>.catalogs.<name>` | `iceberg-rest@1` | the cell's Lakekeeper, on `managed({ storage })` or Bijection's bucket | `icebergRest` |
| [File storage](https://docs.bijection.com/files) | `platform.files` | `object-store@1` | managed storage, or `managed({ storage })` on `placement.aws.s3Bucket`, `placement.gcp.gcsBucket`, `placement.azure.container`, `placement.cloudflare.r2Bucket` | none |
| Encryption keys | `platform.keys` | `key-root@1` | Bijection's key ring, or `managed({ root })` on `placement.aws.kms`, `placement.gcp.kms`, `placement.azure.keyVault` | none |
| [Models](https://docs.bijection.com/models/gateway.md) | each provider pack, such as `ai.anthropic` | the vendor's API | Anthropic, Cohere and Bedrock models on Bijection's Amazon Bedrock account in the cell's region | `anthropicAccount`, `openaiAccount`, … (each takes an optional `url` for a regional host, private endpoint or gateway) |
| [Document analysis](https://docs.bijection.com/models/extraction.md) | `<extraction>.reader` | `document-analysis@1` | AWS Textract on enabled cells, or on `managed({ account: placement.aws.account(...) })` | an endpoint serving the declared engine |
| [Batch transcription](https://docs.bijection.com/files/media.md) | `<media>.transcriber` | `transcription@1` | AWS Transcribe on enabled cells, or on `managed({ account: placement.aws.account(...) })` | an endpoint serving the declared engine |
| [Partner sync](https://docs.bijection.com/operate/partner-sync.md) | `<transfers>.partner` | `partner-sync@1` | the managed Fivetran and Airbyte relay, or its driver on `managed({ account: fivetran.account(...) \| airbyte.workspace(...) })` | none |
| [Inbound mail address](https://docs.bijection.com/integrations/native-mail.md) | `<mail>.inbound` | `inbound-mail@1` | managed SES, or your pipeline as `managed({ account: placement.aws.ses(...) })` | none |
| [Bijection Auth's code sender](https://docs.bijection.com/access/authentication/providers/bijection-auth#email-delivery) | `<auth>.mail` | `send-mail@1` | the managed sender | `endpoint` to your mail relay |
| [Telemetry export](https://docs.bijection.com/operate/observability/log-export.md) | `platform.telemetry` | `otlp@1` | Bijection's hosted telemetry store | `otlp({ url, credential })` |
| [Worker pools](https://docs.bijection.com/transforms/workers.md) | `<compute>.pools.<name>` | `worker@1` | not offered today | `workerPool.aws`, `workerPool.gcp` |

## Requirements and offers

A label states what its data requires of every provider that handles it,
one property at a time: `executionTenancy`, `processingRegions`,
`storageRegions`, `custodians` and `maximumRetentionMs`.

```ts bijection/labels.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { label } from "@bijectionhq/bijection";

export const invoices = label({
  placement: { executionTenancy: "single-organization", processingRegions: ["aws:eu-west-1"] },
});
```

Deployment and task admission check every property on its own. When the
evidence is absent or does not meet the requirement, the slot reports
`RequirementUnmet`, and the trial shows the known properties and where each
claim came from. A label accepts host controls and vendor terms by default.
When its author includes `"installationOperator"` in `evidenceSources`, the
deployment operator may attest properties of the exact customer provider with
`placement.attest(provider, { ..., validUntilMs })`. A required claim's expiry
bounds admission and the task's send window. An account binding alone does
not establish single-organization execution.

A host publishes what it operates as **offers**, at most one per protocol
major version, stating its properties, meters and price.
`bijection placement offers` lists them. A binding never asks for more
isolation: to meet a stricter requirement, run the installation on a
one-tenant cell or a private host, or bind your own provider whose evidence
meets it.

| Offer property | Shared cell | One-tenant cell |
| - | - | - |
| Co-residency | other organizations' installations in the cell's pool | only your organization's installations |
| Never shared | state, credentials, delivery key and key material | the same, plus processes, nodes and network path |
| Capacity | pooled, under a per-installation admission bound | reserved |
| Residual channels | timing, throttling, queueing and errors can reveal co-tenant activity; operator access under audited break-glass | operator access under audited break-glass |

Every managed offer signs each delivery for your installation and derives the
tenant from that signature; keys everything it holds by installation and
slot; bounds each slot's admission on its own; reaches your data only through
installation-scoped grants such as read leases; and attributes every metered
unit to the installation and slot.

On a Bijection hosting cell, a managed slot is the cell's service. A private
installation offers nothing unless its operator publishes offers, so on one
you bind every slot your app mounts, or unmount the capability. File storage
is the one host-wide exception: a standalone host that mounts label
partitions (`BIJECTION_LOCAL_FILE_PARTITIONS`) serves them as
its managed `object-store@1` store, and one that mounts none refuses an
unbound `platform.files` with `NotOffered`. A missing
offer is refused at deploy, never replaced by a silent fallback. When no host
offers a protocol yet, such as `worker@1` for worker pools, an unbound slot
is refused `NotOffered`; the day a host offers it, unbound slots become
managed with no code or configuration change.

`bijection dev` runs a local host that offers only `handler@1` (the
runtime's target sandbox provider), `connector-gateway@1` (the runtime's
gateway provider), `object-store@1` (dev-grade label partitions, one directory
per label with no capacity isolation), `key-root@1`, `send-mail@1` (which
writes each message to the backend log) and `otlp@1` (which keeps telemetry
in `sys.logs`). A runtime installed before these providers shipped is
refused as incompatible, so install the runtime again with the CLI. A local
deploy of a program that reaches another slot unbound, such as a Lake SQL
slot, is refused `NotOffered`.

## When placement is refused

Every placement failure, at deploy or while a move is blocked, is one
refusal:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
PlacementUnavailable { installation, slot, provider, reason, offered, fix }
```

`offered` lists what the host does offer for the slot's protocol, and `fix`
names the next step.

| Reason | Meaning |
| - | - |
| `NotOffered` | The host offers no provider for the protocol, or none that serves the slot's declared engine. Bind your own provider or unmount the capability. |
| `RequirementUnmet` | The provider lacks evidence for a requirement on the data it receives or stores. |
| `ProtocolMismatch` | The provider does not speak the slot's protocol. |
| `VersionNotServed` | The provider in force does not serve the protocol version the program needs. Deploy follows the move and activates the program at the cut. |
| `TrustPending` | The provider requires the trust shown by `deploy --trial` or `placement trust`. |
| `Unreachable` | The provider's probe failed, or its host is outside the binding's `hosts`. |
| `InputMissing` | A binding names an installation input, secret or required parameter that is not set, or a resource reference has no binding. |
| `UnknownSlot` | A binding names a path that is not a slot of the program. |
| `CannotResume` | The move cannot continue from its recorded state, for example a new source database, a partner provider that cannot prove where it stopped, or stored state (a File's bytes, a table's data file) that neither provider holds. Restore it, or erase it through its owner; the move retries on its own. |
| `DoesNotFit` | The state exceeds a bounded destination, for example the files of record over its per-label partition capacity. |

Every reason is generic: no capability adds its own. A move that is waiting (writes draining at its fence, read leases at release) shows its phase, not a reason.

## Switch providers

Change the binding and deploy. There is no move command.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deploy --bindings ops/bindings/production.ts --trial   # per slot: provider, properties, move plan, trust to install
bijection deploy --bindings ops/bindings/production.ts
```

Deploy prepares the new provider first: protocol version, probe, reach,
credential, trust and requirements. A failure refuses the deploy and changes
nothing. Deploy then records a pending placement **generation** for the slot
and activates your program at once; the slot keeps serving at the old
generation until the cut. The one exception is a slot whose provider in force
does not serve the protocol version your new program needs: deploy follows
the move and activates the program at the slot's cut, so the slot's work
waits only during the final stretch. With `--detach`, deploy prints the
command that resumes it. The installation's placement reconciler runs the
move, as the protocol's state class defines:

| State class | Protocols | During the move | Old provider released when |
| - | - | - | - |
| `none` | handlers, Lake SQL, batch Flink, models, mail, telemetry, workers | new submits go to the new provider | tasks submitted at the old generation settle |
| `running` | streaming Flink, capture, partner sync | the old run stops at a resume point the installation records, and the new provider resumes from it, or starts a new history when you deploy with `--restart` | the old run is disposed of |
| `stored` | files, catalogs and their storage | data is copied while the old provider serves; at the fence writes wait, the old provider seals (writes it already granted finish, at most the protocol's write-lease bound, which `--trial` shows), and the rest is copied and verified at the sealed point; the cut switches reads and writes to the new provider | pinned tasks, read leases and signed URLs end |
| `wrapped` | keys | every live data key is rewrapped under the new root | no data key is wrapped only under the old root |

A task runs and settles at the generation it was submitted under; it is never
redirected. After the cut, Bijection keeps its copy for a retention window
(7 days) so that binding back is cheap, then deletes its own copy with
disposal evidence. A move never deletes bytes in a provider you operate; it
reports them as releasable. Erasure reaches every retained generation.

Run deploy again to resume a move. Bind back before the cut to cancel it.
A `stored` source keeps serving even when the move's fence sealed it: the
seal is lifted, writes resume and nothing is copied back. After the cut,
moving back is another move. Once a `running` move has
stopped the old run, the old generation never serves again. Binding back
then records a fresh generation that continues from the same stop.

When the old provider keeps no resumable point, or the new one cannot
continue from another provider's point, deploy refuses the `running` move
with `CannotResume` before anything stops. A managed offer states this for
its driver, and a customer provider's read-only probe answers it
(`{ "points": "portable" | "none", "seeds": true | false }`). Today's
Fivetran and Airbyte providers are in that case
([partner sync](https://docs.bijection.com/operate/partner-sync.md)). If a provider stops without a point
it did not predict (a lost replication slot), the move holds at its fence
with the same `CannotResume`. To accept a new history, deploy again with
your consent:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deploy --restart shop.capture           # comma-separate several slots
bijection deploy --restart shop.capture --trial   # shows the consent in the plan
```

The new provider then starts as a first placement does: capture takes a
snapshot, partner sync runs a full resync, and streaming Flink starts
without provider state. The consent applies to this move only. It is part
of the reviewed plan, so `--write-plan` and `--apply-plan` carry it, and it
never goes in your bindings file. Without it, `--trial` predicts the hold.
Stored moves never restart. Removing a slot from your code withdraws its
generations the same way for every class.

## Inspect placement

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection placement                       # every slot: provider, generation, status, pending move and blocker, managed usage this UTC month
bijection placement show etl.counts       # one slot: requirements and evidence, reachability, credential roles, pinned tasks, move certificates, restart consent and history origin
bijection placement offers                # what this installation's host offers: protocol, version, properties, meters, price
bijection placement trust platform.files  # the trust to install for your provider
bijection placement usage --slot etl.counts
```

`placement show` checks a fixed customer endpoint when the caller can deploy.
It shows `protocolReady` when the declared read-only probe succeeds,
`reachable` when a request with no body confirms only the route, `blocked`
with the reason, or `unchecked` when the host has no authorized check for that
provider. Withdrawn slots remain visible until their retained generations
finish retiring.

Use `deploy --trial` to see the trust for a candidate binding, including its
first deploy. `placement trust` looks up a slot's recorded pending, current or
most recent retained provider.

| Provider | Trust items |
| - | - |
| `placement.aws.s3Bucket` (a catalog's or Files' `storage`) | `role` (default `bijection-file-storage/<bucket>`), the driver's role it trusts (`trustRole`) and the installation's storage `externalId` |
| `placement.gcp.gcsBucket` | the workload identity issuer and subject to trust |
| `placement.azure.container` | the issuer and subject, with the tenant, client, subscription and resource group |
| `placement.cloudflare.r2Bucket` | nothing beyond its credential |
| `placement.aws.kms` | `role` (default `bijection-keys`), `trustRole`, `externalId` and the key policy grant |
| `placement.gcp.kms`, `placement.azure.keyVault` | the workload identity issuer and subject, and the key policy grant |
| `placement.aws.account` | `role` (default `bijection-engines`), the driver's role it trusts, and the installation's engines `externalId` |
| `placement.aws.ses`, `fivetran.account`, `airbyte.workspace` | their credential and hosts |

`bijection.lock` records the program's slot declarations. Update it with
`bijection check --write-lock` when those declarations change.

## Usage and spend

Managed usage is one record per installation, slot, placement generation,
protocol, meter and quantity. `bijection placement usage` reads this UTC
month's recorded usage. Its price comes from the offer the generation pinned,
which you reviewed when you deployed it. A managed model answer, document
analysis or transcription run records its vendor list price in
millionths of a US dollar as the `costMicros` meter, which the offer prices
like any other; a managed telemetry export records the `records` and
`bytes` the hosted store accepted; mail reports `messages`; managed partner
sync reports `pages`. Shared state, such as one capture source serving
several installations, is charged to the installation that enrolled it.

Spend is not placement. Limit units in code with
[`budget()`](https://docs.bijection.com/operate/usage#budgets) over a protocol's meters; a budget holds
whoever operates the slot. Set a money ceiling on your Bijection bill as a
billing-account limit. Set one for a slot with
`bijection installation spend-limit --slot <slot> --usd <amount>` (`--clear`
removes it, and with neither flag the command lists the limits) or the
dashboard's billing page; the account-wide limit is the billing account's. When a slot's managed usage
reaches its ceiling, new work for that slot is refused while running work
finishes. A slot served by your own provider is never stopped by a Bijection
ceiling.

## What placement does not choose

* **Who may sign in.** Identity providers are trusted issuers, changed by an
  audited trust act, never by a deploy. See
  [switching providers](https://docs.bijection.com/access/authentication/switch-provider.md).
* **Which source, connection, mailbox or dataset.** These are
  [resource entries](#the-bindings-file) or the application's own choices. Gmail, Microsoft Graph and IMAP read a mailbox you choose;
  they are not placement.
* **Which engine or model.** They change the answer, so they are code.
  Placement chooses only who runs them.
* **The installation itself.** Its storage and log are the installation; run
  them yourself with a private installation.
* **Secret values.** Bindings carry references; `bijection secret set` is
  unchanged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.