Skip to content

Commit e400c52

Browse files
authored
Merge pull request #138 from codeflash-ai/codex/human-auth-architecture
Document managed human auth and team roles
2 parents b23ed84 + 81b53c2 commit e400c52

1 file changed

Lines changed: 57 additions & 21 deletions

File tree

docs/cloud-sandbox-data-plane.md

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -453,16 +453,21 @@ The authorization vocabulary is:
453453
- **principal**: a human or service identity that can authenticate and be
454454
audited; every workload binds a service principal even when it also acts for
455455
a human;
456+
- **tenant membership**: a Locality-owned `Owner`, `Admin`, or `Developer`
457+
control-plane role for one human principal. Identity providers authenticate
458+
humans and report upstream membership, but Locality rechecks the current
459+
product role for every privileged transaction;
456460
- **group**: a tenant-owned set of principals, usually synchronized from an IdP
457461
or explicitly managed in Locality; and
458462
- **grant**: an administrator-owned, versioned rule assigning subjects a maximum
459463
resource scope and action set. A `DataGrant` never contains provider
460464
credentials and never implies that every resource visible to a connector is
461465
visible to its subjects.
462466

463-
Provider identities and groups link to Locality IDs through stable provider
464-
subject IDs. Display names are never identity, and email addresses are used for
465-
linking only after issuer/domain verification.
467+
Provider organizations, identities, memberships, and groups link to Locality
468+
IDs through explicit mappings and stable provider subject IDs. They do not
469+
replace tenant or principal primary keys. Display names are never identity, and
470+
an invitation email is metadata rather than an account-linking key.
466471

467472
### Stable Source Scopes
468473

@@ -1825,14 +1830,25 @@ sizes, or operation counts.
18251830

18261831
### Who Configures A Sandbox Job
18271832

1828-
Responsibility is deliberately split:
1829-
1830-
| Role | Decision |
1831-
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
1832-
| Tenant administrator | Connects sources, chooses the source visibility ceiling, manages principals/groups, and publishes `DataGrant` revisions. |
1833-
| Workflow owner | Publishes a `WorkspaceProfile` selecting mounts, filters, requested actions, and limits inside that ceiling. |
1834-
| Sandbox orchestrator | Starts a session for an approved workload, immutable profile revision, acting principal, TTL, and optional narrowing filters. |
1835-
| Agent | Uses the already materialized view and proposes changes. It cannot edit grants, change `actingFor`, or broaden filters/actions. |
1833+
Responsibility is deliberately split. The Locality organization roles are
1834+
`Owner`, `Admin`, and `Developer`; there is no read-only Viewer persona because
1835+
an agent developer must be able to launch assigned Workspace Profiles:
1836+
1837+
| Role | Decision |
1838+
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
1839+
| Owner | Manages authentication, Owners, Admins, Developers, sources, grants, profiles, assignments, and organization settings. |
1840+
| Admin | Manages Developers, sources, grants, profiles, assignments, and operations, but cannot add, demote, or remove an Owner. |
1841+
| Developer | Uses assigned Workspace Profiles and manages only their own launch keys, sandbox sessions, and activity. |
1842+
| Workflow owner | A capability, not an organization role: publishes a `WorkspaceProfile` selecting mounts and limits when their role permits it. |
1843+
| Sandbox orchestrator | Starts a session for an approved workload, latest published profile revision captured immutably at launch, acting principal, TTL, and optional narrowing filters. |
1844+
| Agent | Uses the materialized view and proposes changes. It cannot edit grants, change `actingFor`, or broaden filters or actions. |
1845+
1846+
No organization role alone grants source data. A Developer launch requires an
1847+
explicit assignment to the stable Workspace Profile, and the effective data is
1848+
still the intersection of the immutable session-captured profile revision, Data
1849+
Grants, provider ACL, source state, and session limits. Removing a membership or
1850+
assignment revokes the affected launch authority. Concurrent changes must never
1851+
leave a tenant without an active Owner.
18361852

18371853
`actingFor` is never arbitrary request text. For an interactive launch it comes
18381854
from the authenticated launcher; for a scheduled job it is an administrator-
@@ -1898,22 +1914,26 @@ unverified email matching never confer access.
18981914
### Policy Changes
18991915

19001916
Each tenant has one monotonic active authorization epoch. Grant, group,
1901-
principal-disablement, provider-credential-ceiling, source-scope activation/
1917+
principal-disablement, tenant-membership activation/deactivation/role, Workspace
1918+
Profile assignment, provider-credential-ceiling, source-scope activation/
19021919
revocation, or provider ACL/access-set observation changes publish their
1903-
immutable facts and advance that epoch in one transaction. Sessions retain the
1904-
epoch they were issued under for audit, but
1920+
immutable facts and advance that epoch in one transaction. Membership demotion
1921+
and assignment removal also revoke affected reusable launch keys and active
1922+
session capabilities in that transaction. Sessions retain the epoch they were
1923+
issued under for audit, but
19051924
export-attempt creation and retry require it to equal the tenant's active head
19061925
and re-evaluate the selected scopes. This coarse v1 invalidation may revoke more
19071926
sessions than strictly necessary, but it cannot leave a stale grant usable and
19081927
does not require rewriting content. A later dependency-aware invalidation index
19091928
may reduce blast radius without changing the session/scope protocol.
19101929

19111930
Changing profile selection creates a new profile revision and changes only the
1912-
next parameterized export query. Changing a `DataGrant`, group membership, or
1913-
native ACL updates indexed policy/access facts and invalidates affected session
1914-
capabilities; content rows are not rewritten. New sessions always evaluate the
1915-
new revision/ACL epoch. Existing sessions may continue to read bytes already
1916-
delivered until sandbox destruction, but:
1931+
next parameterized export query. Changing a `DataGrant`, group membership,
1932+
tenant membership role/state, Workspace Profile assignment, or native ACL
1933+
updates indexed policy/access facts and invalidates affected launch keys and
1934+
session capabilities; content rows are not rewritten. New sessions always
1935+
evaluate the new revision/ACL epoch. Existing sessions may continue to read
1936+
bytes already delivered until sandbox destruction, but:
19171937

19181938
- an invalidated session cannot open or restart its export;
19191939
- backend search uses current policy;
@@ -2135,8 +2155,20 @@ source-controlled namespaces.
21352155

21362156
### Authentication
21372157

2138-
- Humans authenticate through enterprise OIDC/SAML; groups arrive through SCIM
2139-
or explicit mapping.
2158+
- Humans authenticate through a managed OIDC/SAML boundary. V1 uses WorkOS
2159+
AuthKit for Google login, enterprise SSO, and MFA. WorkOS owns credential and
2160+
upstream membership lifecycle; Locality owns tenant routing, product roles,
2161+
Workspace Profile assignments, RLS, and audit.
2162+
- A verified provider instance, organization ID, and subject ID resolve to one
2163+
active Locality membership. Email and display name never supply tenant or
2164+
principal authority. The database rechecks current membership during every
2165+
privileged transaction, so demotion or revocation does not wait for the
2166+
browser session to expire.
2167+
- Browser sessions are server-created, sealed, secure, HTTP-only host cookies
2168+
shared across API tasks. OAuth state and PKCE verifier material are sealed and
2169+
short lived. Provider tokens never enter the administration JavaScript app.
2170+
- Signed identity-provider webhooks are idempotent reconciliation hints; a
2171+
worker reads authoritative provider state before changing Locality membership.
21402172
- A Workspace Profile may have a revocable reusable launch key. The key binds
21412173
the stable profile identity, not one immutable revision: each successful
21422174
launch resolves and captures the latest published profile revision. Updating
@@ -3037,6 +3069,10 @@ verification, and dedicated-cell operational runbooks are complete.
30373069

30383070
- Grant/profile narrowing and revocation during session creation, export,
30393071
search, changeset submission, and apply.
3072+
- Membership demotion/deactivation and Workspace Profile assignment removal
3073+
during launch, export creation/retry, search, changeset submission, and push;
3074+
affected reusable keys and active sessions are revoked in the same epoch
3075+
transaction and cannot resume under stale authority.
30403076
- Pilot-grant replacement by narrower grants without content rewrite or export-
30413077
protocol migration; workload/`actingFor` intersection and forged claims.
30423078
- Expired, stolen, replayed, cancelled, and over-quota bootstrap/session

0 commit comments

Comments
 (0)