Registry stack documentation: machine-readable Markdown.
Index of all pages: https://docs.registrystack.org/dev/llms.txt
Full corpus: https://docs.registrystack.org/dev/llms-full.txt

# Where authority lives

> Which of the token, the configuration and the records decides who a caller is, what a profile may do, and which rows and teams a caller reaches, and what holds today.

Every Registry Stack product asks the same three questions about a request. Each question has one
home. Knowing the home tells you where to change an answer, and which answer takes effect first.

## One rule

- The token says who the caller is. Your issuer signs it, and the product verifies it.
- Configuration says what a profile may do. The access profile lists operations, fields and purposes.
- Records say which rows and which teams. Today this holds only in part, as the next sections show.

A caller cannot widen its own reach. A request field is never an authorisation decision, and a
product inherits no authority from another product.

{/* Evidence: crates/registry-breg/src/access.rs; crates/registry-platform-oidc/src/lib.rs. */}

## Row authority today comes from token claims

A [row boundary](../../reference/glossary/#row-boundary) compares a Record field with a claim in
the verified token. Base Registry Engine (BReg) declares it with `rowBoundaries` on a record
permission. The rows a caller reaches therefore depend on what your issuer put in the token.

This has two consequences.

- Your issuer must be one you trust to assert the claim.
- A change to a caller's reach takes effect when the caller next receives a token, not when you
  change a record.

The compiled form shows the limit of this design. An empty list of boundaries permits every row, and
the authored `rowBoundaries: unrestricted` compiles to that empty list.

See [BReg access profiles](../../configure/breg-access/) for the fields and examples.

{/* Evidence: crates/registry-breg/src/contract.rs row_boundaries; crates/registry-breg/src/access.rs;
    crates/registry-breg/src/authority.rs. */}

## Membership boundaries read records

A membership boundary moves the decision into records. A row is in reach only while a current,
active membership Record names the caller. Deactivate the membership and the next request loses
that reach. No token expiry is involved.

A membership boundary bounds reads, Record Create, Patch, Tombstone and Batch, and immediate
Action and Proposal targets. Writes check the membership in the write transaction and hold it
locked until they commit. Because the membership source is itself authority, BReg refuses a
profile bounded through a source that could write the fields its check reads
(`breg.access.membership-source-write`). Grant membership writes to a separate administrator
profile, or to bounded Actions such as a steward's, and review that grant as authority.

Some limits apply:

- A profile with a membership boundary cannot enable spatial bounding-box queries or Import.
- A grant declares at most eight membership boundaries.
- A membership source can be bounded by membership only one level deep.

{/* Evidence: crates/registry-breg/src/membership.rs validate(), validate_source_writes;
    crates/registry-breg/tests/membership_access.rs membership_boundaries_refuse_unenforced_authority_paths;
    crates/registry-breg/tests/steward_authoring.rs a_member_cannot_write_the_fields_their_membership_probe_reads. */}

## Casework keeps BReg disclosure under the reviewer's identity

Registry Casework decides who may review a task. It does not decide what a reviewer may see in
BReg. When Casework shows a reviewer the current record, BReg answers under the reviewer's own
identity and its own access profile. Casework adds no disclosure authority.

For every human read of a current source, the caller sends a Casework-audience token in
`Authorization` and a separate BReg-audience token for the same reviewer in
`Registry-Source-Authorization`. Casework verifies both and forwards only the source token to BReg,
where BReg applies its own profile to the reviewer's identity.

{/* Evidence: crates/registry-casework/src/review.rs; crates/registry-casework-breg/src/lib.rs human_display();
    crates/registry-casework/src/http/source_credentials.rs. */}

## Continue

- [BReg access profiles](../../configure/breg-access/)
- [Where each rule lives](../where-each-rule-lives/)
- [Security model](../../security/)