Skip to content

Z5 dependency: Cortex as the identity-keyed injector (S6, replaces moca-egress) #241

Open

Description

@cwiklik

Tracking stub for the third slice of #220, so all of its replacements are discoverable from this repo.

The work itself lives in rossoctl/cortex#905 — originally per-subject credential resolution in AuthBridge's static-inject, now rescoped (2026-10-05) to connection-bound caller identity + identity-keyed credential resolution, the deferred per-user half of Z5 (docs/specs/2026-06-19-m13-generalized-credentialed-egress-design.md; docs/specs/README.md:152 records RC1 as implementing only the static single-tenant slice).

Note: the P5 spec §6 and ADR-0032 still name that repo kagenti-extensions. It has been renamed and redirects to rossoctl/cortex.

Why this stub exists — the claim boundary

From the P5 spec §7: #239 makes the harness send a per-request subject and carry an inert placeholder instead of a real key. Nothing resolves that subject into a credential until cortex#905 lands.

So #239 makes the system tenancy-neutral; it does not make it multi-tenant safe. End-to-end multi-tenant safety is not claimable — and must not be advertised — until a verified identity is resolved into a credential at egress: by moca-egress (MI1 S4/S5, not yet implemented) or by Cortex via S6, and only once the §12.3 conformance suite passes. This stub exists so that boundary stays visible from the repo where the density and isolation claims are made.

Relationships

Activity

  1. added
    enhancement
    on Sep 8, 2026
  2. pdettori commented on Sep 17, 2026

    @pdettori
    Member

    Epic: rossoctl/rossoctl#2546 (Stream 1 — multi-tenancy/session isolation)

    Status update (2026-09-17)

    No change — still blocked on #239. The injector cannot key
    on a subject the harness never sends, and #239 (which introduces X-SH-Subject) has
    not been implemented yet. rossoctl/cortex#905 (the other half of this dependency)
    is unaffected by anything merged on this repo since this issue was filed.

    Assisted-By: Claude (Anthropic AI) [email protected]

  3. cwiklik commented on Oct 5, 2026

    @cwiklik
    ContributorAuthor

    Status update (2026-10-05) — supersedes the 2026-09-17 comment

    The previous status comment is out of date on both of its claims. Correcting it rather than
    editing it, so the history stays readable.

    It said: "still blocked on #239 … #239 (which introduces X-SH-Subject) has not been implemented
    yet. rossoctl/cortex#905 … is unaffected by anything merged on this repo since this issue was
    filed."
    Neither holds now.

    What has landed on this repo

    • Caller authentication on /turn exists — packages/knative-server/src/turn-auth.ts, with
      tests (turn-auth.test.ts, turn-auth-route.test.ts). The subject is token.sub from a
      verified signed token, never an inbound header
      ; X-SH-Subject is honoured only for a trusted
      orchestrator, and a request carrying both a token and a conflicting header is rejected rather
      than resolved by precedence.
    • Per-user credentials are plumbed — packages/control-plane/src/exchange.ts has a credential
      store and a per-turn exchange with a subject-derived placeholder (placeholderFor(subject) →
      sh-placeholder-<subject>).
    • Placeholder mode is now preferred, not optional: it wins whenever the deployment has an
      injector configured, so adding one strictly narrows what the harness may hold. The remaining
      direct-credential path is the documented ADR-0033 divergence, and MU3 deletes it.

    So the harness does now send a per-request subject, and it is cryptographically verified rather
    than client-asserted. That is a stronger starting point for the injector than this issue originally
    assumed — cortex#905 can key on a verified identity, not a trusted-orchestrator convention.

    #239 stays open for its remaining sub-parts; this comment is not a claim that it is finished.

    What this changes for the dependency

    cortex#905 is no longer blocked, and its blocked label has been removed. The remaining work is
    Cortex-internal; it has been retitled and rescoped to
    "connection-bound caller identity + identity-keyed credential resolution in static-inject", with an
    ordered breakdown in
    this comment. Four of its
    five steps need nothing further from this repo; only the last (verifying MOCA's signed grant format
    and passing the §12.3 conformance suite) waits on us.

    One correction worth carrying here, because it is the reason the Cortex work is not a one-liner: the
    injector must not key resolution on the inbound placeholder. sh-placeholder-<subject> is
    predictable and arrives from a model-influenced workload, so any sandbox could present another
    user's placeholder and receive their real credential. The verified subject exists at /turn; what is
    still missing is a way for Cortex to learn it from the connection at egress. Invariant I3 —
    caller identity comes from the connection, never the request.

    Claim boundary — unchanged

    The boundary this stub exists to keep visible still holds: end-to-end multi-tenant safety is not
    claimable until the injector can resolve per-identity. The harness half narrows the exposure; it does
    not close it.

    Assisted-By: Claude (Anthropic AI) [email protected]

  4. pdettori commented on Oct 15, 2026

    @pdettori
    Member

    Status update (2026-10-15)

    Builds on the 2026-10-05 correction, which stands. This one records where the work now sits and what the issue should be read as.

    Where this stands

    • No longer blocked on P5: session identity isolation — per-request subject, no ambient credential #239. The harness half that this stub waited on has landed: /turn takes its subject from a verified signed token (packages/knative-server/src/turn-auth.ts), and packages/control-plane/src/exchange.ts issues the sh-placeholder-<subject> placeholder. P5: session identity isolation — per-request subject, no ambient credential #239 stays open for its remaining sub-parts, but it no longer gates Cortex.
    • cortex#905 has not moved. It is open, was rescoped on 2026-10-05 to connection-bound caller identity + identity-keyed credential resolution in static-inject, and has no linked PRs as of today.
    • Cortex is not in the multi-user credential path. The 2026-09-28 isolation spec (§2.4) surveyed Cortex at 403d5d2. It cannot select a credential from a verified caller identity, cannot carry an identity from a CONNECT into the requests bridged inside the tunnel, and listens only on TCP. That reading is dated and is not a conformance result.
    • The in-repo path is moca-egress (spec D4, MI1 S4/S5). It is not implemented yet: it appears only in docs and deploy comments (for example deploy/vm/README.md, deploy/compose/docker-compose.yml). Cortex replaces it only if it passes MI1's conformance suite (S6, spec §12.3) at the release being adopted.
    • The only Cortex use in this repo today is the AuthBridge demo under deploy/knative/. That path is deprecated (ADR-0041) and covers the static single-tenant slice (RC1) only.

    What this changes for this issue

    This stub no longer tracks a blocked dependency. It tracks an optional, later replacement of moca-egress. Two consequences:

    1. The multi-tenant safety claim is now gated on moca-egress shipping and passing its own conformance suite, not on cortex#905.
    2. Cortex becoming the injector (S6) is a separate decision, made later and only on passing results.

    Claim boundary — unchanged

    End-to-end multi-tenant safety is still not claimable. Nothing in this repo resolves a verified identity into a credential at egress yet. The harness half narrows the exposure; it does not close it. This must not be advertised until moca-egress (or Cortex via S6) does that resolution and passes the §12.3 suite.

    Proposed follow-ups

    Assisted-By: Claude (Anthropic AI) [email protected]

  5. changed the title [-]Z5 dependency: per-subject credential resolution at the injector[/-] [+]Z5 dependency: Cortex as the identity-keyed injector (S6, replaces moca-egress)[/+] on Oct 15, 2026
  6. pdettori commented on Oct 21, 2026

    @pdettori
    Member

    Status update (2026-10-21): gap analysis for Cortex as the SBX0 egress proxy

    This builds on the 2026-10-15 update, which still holds. The full gap table, with code references at Cortex 15da639, is on cortex#905. This comment covers what it means for MOCA.

    Where things stand on MOCA main (95ff373)

    • SBX0 has no egress. The microVM launcher never issues PUT /network-interfaces (launcher_firecracker.go:411). Egress is SBX0 increment 2: E12, then P4.1's vsock transport with an operator allowlist of package registries (SBX0 spec §11).
    • moca-egress and the §12.3 conformance suite do not exist yet. The Exec.grant field (MI1 §8.2) is not in proto/sandbox/v1 either. Cortex has nothing to be tested against yet.
    • SBX0's sandbox control-plane profile has no credential store or token endpoint (SBX0 spec §4, "needs no credential store, KEK…"). User-key injection in SBX0 needs MOCA work before any proxy question comes up: somewhere for users to register keys, and an endpoint that resolves them.

    Cortex gaps, in summary

    • Blocking per-user injection: identity taken from the connection (G1), a Unix-socket listener with descriptor handover (G2), identity carried into bridged requests (G3), and resolution by identity and host (G4). These are cortex#905 steps 1, 3 and 4, and they change Cortex's listener core, not a plugin. Also in the breakdown: one audit event per injection (G6).
    • Not in docs(sandbox): split the user guide into task and concept pages; add lease mode and a generated CLI reference #905's breakdown; raised there today: Basic/x-api-key header bindings (git over HTTPS fails today, G5), refusing to inject over plain HTTP (G7), and failing closed instead of falling back to a tunnel on hosts that have a credential (G8; GitHub is in Cortex's default passthrough list).
    • Egress policy, none of it present: deny-by-default allowlist, an SSRF/DNS-rebinding guard, per-VM and per-session caps, WebSocket upgrades.
    • Plugins as extensions: the plugin model is a good fit; downstream builds can link MOCA plugins without a fork. But plugins see only intercepted traffic, session-budget and ibac key on a session id the client sets in headers, and the body-reading plugins conflict with "stream, never buffer".

    What this means for this issue

    1. Increment 2 does not need Cortex. An allowlist-only proxy needs only the infrastructure gaps (G2, allowlist, SSRF, caps). None of those are Cortex-specific, and they are exactly what moca-egress provides. D4 stands.
    2. Cortex plugins are what would justify S6. The smaller path is a MOCA front end that owns sockets, binding, allowlist and SSRF, with Cortex behind it for injection and plugins (P4.1 §12.2's "Go shim"). That reduces the Cortex work to G1 (scoped down), G3–G7, and dialing the address the front end pinned.
    3. Order: write the §12.3 suite as part of moca-egress. That gives cortex#905 step 5 something concrete to run against.

    Claim boundary: unchanged

    End-to-end multi-tenant safety is still not claimable. Nothing in this repo resolves a verified identity to a credential at egress.

    Assisted-By: Claude (Anthropic AI) [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions