Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
364e2a2
A platform admin's own authority reaches every standard namespace of …
zlareb1 Dec 4, 2026
ee06f8f
Platform authority reads a repository's kind row before it covers a name
zlareb1 Dec 4, 2026
e398d2e
The kind directory read raises with the caller text of its error
zlareb1 Dec 4, 2026
ade7e9f
A platform admin's write reads the repository registry row, not the k…
zlareb1 Dec 4, 2026
a3ace4f
An MCP call naming another org takes no default namespace
zlareb1 Dec 4, 2026
4c88e5a
A token's named claims are namespaces of its own org
zlareb1 Dec 4, 2026
a151187
Platform authority names a tenant org and reads no access row as a re…
zlareb1 Dec 4, 2026
5d645cb
A platform admin's first write in another org leaves no owner
zlareb1 Dec 4, 2026
5b4cf38
Merge remote-tracking branch 'origin/main' into fix/platform-admin-st…
zlareb1 Dec 4, 2026
a3bf994
A third-party client's session gets no platform reach
zlareb1 Dec 4, 2026
89fe776
A loom_search naming another org searches the caller's namespaces there
zlareb1 Dec 4, 2026
72dd287
A cross-org loom_search fails as the server's when its fan-out is unread
zlareb1 Dec 4, 2026
ba52712
A cross-org loom_search answers 503 for any unread fan-out, ledgered
zlareb1 Dec 5, 2026
8f7f559
A blank or "-" namespace in another org's MCP call names none
zlareb1 Dec 5, 2026
d8faa36
The knowledge.move test stand-ins carry an org
zlareb1 Dec 5, 2026
d7e7c75
Merge remote-tracking branch 'origin/main' into fix/platform-admin-st…
zlareb1 Dec 5, 2026
195ecb1
The caller's own fan-out error in another org answers as a tool error
zlareb1 Dec 5, 2026
8f23a8c
Merge remote-tracking branch 'origin/main' into fix/platform-admin-st…
zlareb1 Dec 5, 2026
e4de9b7
A cross-org loom_search reads the fan-out of the org as the gates rea…
zlareb1 Dec 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions docs/architecture/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ grant row on the namespace, of any status, the claim is capped at that grant ins
pending or rejected request caps it at no access, and a scoped token keeps its own role
there capped at the live grant. A namespace the subject never held a grant on (a `loom
mint-token` claim) keeps the claim; grant rows are never deleted, so a revocation is never
forgotten.
forgotten. A `*` claim names no namespace, so no grant caps it, and a platform
administrator's own authority on a namespace that is not a repository is not capped
either: neither comes from a grant.

- The subject's rows, under every spelling the directory ties to it, are read in one
statement per (org, subject) into a per-process cache (`server/core/grant_cache.py`) kept
Expand Down Expand Up @@ -280,14 +282,25 @@ authenticated call, from `gates.authorize` in both transports:
exception below.
4. An authenticated platform administrator using its own unscoped authority reads every
configured or registered repository, including closed and restricted entries. Deployment
tenancy still applies. This authority does not admit writes or any other namespace kind.
tenancy still applies. This authority admits no repository write.
5. A viewer read of an org-readable code namespace (`LOOM_CODE_ORG_READABLE` or the
entry's `org_readable`) passes for any principal of that org.
6. A scoped token's `ns_roles` decide for the namespaces they name, in the token's org
only. Grants are not consulted for them, except viewer reads of a code namespace.
7. A token acts in its own org only (or `*`, or as platform admin).
8. A flat token's roles apply to every namespace its claims cover. Otherwise a live grant
in `loom.namespace_grants` decides: unrevoked and `active` (`grant_sql.LIVE_GRANT`); a
8. A flat token's roles apply to every namespace its claims cover. A platform
administrator's own unscoped authority (`authz.is_own_platform_admin`) covers every
namespace of every org that reaches this step but a repository, whatever its claims
name, as a `*` claim covers its own org's; an `ns_write` claim still bounds its writes.
A third-party client's sign-in session (an OAuth session that is not Loom's own,
`first_party` false) has none of this authority.
For a read, a repository is an entry this process's configuration or registry
snapshot holds (`NamespaceDirectory.code_entry`). For a write, it is also a namespace
with an active registry row read at the write (`NamespaceDirectory.is_repository`), so
one another replica added a moment ago is one, and a registry that cannot be read
covers no write. A directory row's `kind` makes no repository. Where neither the
claims nor platform authority cover the namespace, a live grant in
`loom.namespace_grants` decides: unrevoked and `active` (`grant_sql.LIVE_GRANT`); a
`pending` join request grants nothing. A service account with no grant reads its
creator's. A grant raises a flat token's role, never lowers it. A failed read of
the grant map serves a cached entry younger than
Expand All @@ -298,6 +311,24 @@ authenticated call, from `gates.authorize` in both transports:
The `all_mine` fan-out and the org-wide rollups use the same predicate, so they never
exceed the gate.

**Why platform authority covers every namespace but a repository.** The role spans every org: the
admin routes, the org-wide rollups (`context.reads_every_namespace`) and the collection
gate (`sharing.check`) admit it whatever its claims name. A person's sign-in claim names
only their own namespaces (`login._identity_from_rows`), and a bot's or a minted token's
claim is `*`, which covers only the token's own org. A gate that read the role only
through the claim would refuse the person the namespace ops the role stands for, and
refuse every platform administrator another org's namespaces. Covering by authority gives
the person, the bot and the minted token the same platform reach; a `*` claim still adds
what it covers as a claim, its own org's repositories at the token's role. At this gate,
scoped, delegated and impersonated tokens keep their claims: their authority is what a
principal handed on, not the principal's own. A restricted namespace (step 3), a
repository's writes, a collection and a mirror or code store keep their own rules, which
run before step 8 or exclude it. Every other namespace is in reach, a tracker namespace
and its sources' administration included, as they are for a `*` claim in its own org.
A third-party client's session gets none of it: Loom gives such a session nothing that
outlives it (it registers no bot and links no sign-in), and an admin reach over every
org would let it grant lasting access anywhere.

`code.repo.add` names no namespace, so no grant is read for it (a grant is per
namespace, and step 8 has none to read) and the token's own role decides. It asks for
`writer`: the op makes a namespace, its caller's admin grant there and an indexing job
Expand Down Expand Up @@ -376,14 +407,16 @@ that `NamespaceDirectory.code_entry` recognizes in the current configuration or
snapshot. This includes restricted, approval and closed repositories across the orgs the
deployment holds. `authz.is_own_platform_admin` excludes scoped tokens, delegated tokens
and impersonated subjects, even when their flat roles contain `platform_admin`. Namespace
`admin` and `org_admin` confer no such authority. A name beginning with `code-` confers
nothing without a repository entry.
`admin` and `org_admin` confer no such authority. A name beginning with `code-` is no
repository without a repository entry: it is an ordinary namespace
([the gate](#the-gate), step 8).

Repository indexes are deployment reference data, so platform administrators need a read
authority independent of repository membership. Requiring a separate claim and direct
grant for each repository would make this authority depend on token refreshes and grant
provisioning. The exception is limited to viewer reads: writes, refreshes, registration,
grant management and every non-repository namespace keep their existing checks. Collection
provisioning. The exception is limited to viewer reads: writes, refreshes, registration
and grant management keep the claim and grant checks, and a restricted namespace that is
not a repository keeps the four checks above. Collection
and mirror boundaries run before repository admission; a repository read does not expose
its document mirrors or internal data.

Expand Down Expand Up @@ -920,7 +953,9 @@ provisioned. The personal-namespace auto-claim passes over a name in use to its
name, a workload trust's exchange refuses an agent name in use, and a first write's
auto-registration names no owner on a name in use (rows a read or a run leaves aside,
`namespace_autoregister.READ_TRACES`, which a fresh `namespace.register` still counts), so
only an admin of the name completes the registration, a writer that is one included. The
only an admin of the name completes the registration, a writer that is one included. It
names none either for a token of another org (a platform administrator's,
`namespace_autoregister.maybe_autoregister`): a name in a tenant org is that org's to own. The
exchange sets aside the rows a request writes about itself under the name it names
(`namespace_census.REQUEST_TRACES`: a latency reading, an exposure, a search trace), so a
lookup of an agent's name before its first exchange does not take the name from the
Expand Down
25 changes: 15 additions & 10 deletions docs/concepts/identities-and-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ reaches the operation's role, and the token's own subject holds a live direct gr
An authenticated platform administrator using its own unscoped authority can also read
registered repositories, including restricted ones, subject to deployment tenancy and
the restricted serving kill switch. This does not extend to scoped or delegated tokens,
impersonation, writes or other namespace kinds
impersonation, writes or restricted namespaces that are not repositories
([repository read authority](../architecture/security.md#restricted-namespaces)). No
org-readable rule, public visibility, wildcard, inherited service-account grant or
`org_admin` bypasses restriction, and a refusal does not reveal whether the namespace exists. Fan-outs, context packs and rollups skip restricted namespaces the
Expand All @@ -137,13 +137,13 @@ caller cannot read, and each admitted request is audited. The step-by-step setup
Roles are ordered, and a higher role satisfies every check for a lower one. Each
operation declares the minimum role it needs (`GET /v1/operations` lists it).

| Role | Grants | How it is held |
| ---------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `viewer` | Read. | Token claim or namespace grant. |
| `writer` | Read, and write memory, knowledge and the other data planes. | Token claim or namespace grant. |
| `admin` | Administer one namespace: grants, configuration, policy, restores, promotion to the shared layer. | Token claim or namespace grant; registering a namespace makes you its admin. |
| `org_admin` | Org-wide views (for example cost without a namespace). | A recognised gate with no in-product assignment path. |
| `platform_admin` | Cross-org operator views. | Conferred at login to the handles and verified emails in `LOOM_PLATFORM_ADMINS`, and to the tokens of a bot registered `--platform-admin`; minted only for a service account, with an expiry. |
| Role | Grants | How it is held |
| ---------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `viewer` | Read. | Token claim or namespace grant. |
| `writer` | Read, and write memory, knowledge and the other data planes. | Token claim or namespace grant. |
| `admin` | Administer one namespace: grants, configuration, policy, restores, promotion to the shared layer. | Token claim or namespace grant; registering a namespace makes you its admin. |
| `org_admin` | Org-wide views (for example cost without a namespace). | A recognised gate with no in-product assignment path. |
| `platform_admin` | Every namespace of every org but restricted ones and repositories (which it reads), and the cross-org operator views. | Conferred at login to the handles and verified emails in `LOOM_PLATFORM_ADMINS`, and to the tokens of a bot registered `--platform-admin`; minted only for a service account, with an expiry. |

Grants carry only `viewer`, `writer` or `admin`, and so do the tokens Loom mints, but for a
`platform_admin` one: org-wide power is an operator decision in configuration or at bot
Expand All @@ -154,7 +154,11 @@ registration, not something a token can carry away. Code namespaces have readers

A call on `(org, namespace)` is allowed when the namespace is not restricted (or passes
the restricted checks) and either the token's own role for that namespace reaches the
operation's role, or a live grant does.
operation's role, or a live grant does. A platform administrator's own unscoped
authority reaches every namespace of every org but a restricted one or a repository,
whatever its token names, though an `ns_write` claim still bounds its writes and a
third-party client's sign-in session has none of it
([the gate](../architecture/security.md#the-gate), step 8).

- **The token** (`sub`, `org`, `namespaces`, `roles`, optional `ns_roles` and `ns_write`)
says which namespaces the caller reads, in priority order, and with what role. A
Expand All @@ -175,7 +179,8 @@ operation's role, or a live grant does.
a revoked or lowered grant (`grants.revoke`, `grants.create` with `replace=true`,
`namespace.leave`, a released claim, a restore) ends every older token's claim there,
and a pending or rejected request caps it at no access. A scoped token keeps its own
role there, capped at the live grant.
role there, capped at the live grant. No grant caps a `*` claim or a platform
administrator's own authority.
- **What is not touched.** A namespace the subject never held a grant on keeps its
claim; revoke the token to take that away.
- **When it applies.** The process that changed the grant applies it at once, every other
Expand Down
4 changes: 2 additions & 2 deletions docs/features/namespaces-and-sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ re-registering an existing namespace needs admin. A name with no row that alread
refused unless the caller is already its admin ([what a new name may
claim](../architecture/security.md#what-a-new-name-may-claim)). With `LOOM_NAMESPACE_AUTOREGISTER_ENABLED` on
(default), a first write into a namespace with no row registers it, with the token subject as owner (no owner when
the name is already in use) and `retention_days = 0`. That owner may complete the registration while nobody else holds
a live grant on the name.
the name is already in use or the token is of another org, as a platform administrator's is) and `retention_days = 0`.
That owner may complete the registration while nobody else holds a live grant on the name.

Re-registering is a partial update: an omitted field keeps its stored value. `tags` is replaced whole. For
`conflict_threshold`, `capture_generation_io` and `coverage_sweep`, omitted keeps the stored choice and an explicit
Expand Down
Loading
Loading