Expand description
Internal execution work orders for the Model→Inference single-service boundary (user-approved D5, PR1678).
Model is the authorization authority for Model-routed operations. Its
pinned, allocated Inference instances are subprocessors: they execute work
only for their owning controller and never form an independent authority
domain. When Model forwards an already-authorized operation to one of its
pinned instances, it mints a short-lived, Model-signed internal work
token (typ: "iw+jwt") instead of relaying the caller’s credential:
- the token is bound to the pinned controller key (
cnf.jwk) and is verified against that pinned key — not against the CA key source; audnames exactly one allocated instance;tenant/modelmust match that instance’s binding;resource/operationpin the exact downstream dispatch coordinate the controller already authorized at ingress;expis capped by the caller’s own expiry and a hard 120 s lifetime;jtiis admitted once per worker process;- the original caller’s verified claims snapshot rides along so subject-keyed TTT state, stream ownership, and ledger accounting keep attributing to the ORIGINAL caller — never to Model.
This token is authority nowhere else. The generic verify_claims
pipeline rejects iw+jwt at every service (the trait hook defaults to
deny); only a service operating a pinned execution boundary overrides the
hook. It is never a bearer for Policy, Registry, Discovery, OAI, or any
other control-plane surface, and it is never a substitute for a holder
credential crossing an EXTERNAL boundary.
Structs§
- Internal
Work Claims - Claims of one internal execution work order.
- Internal
Work Context - The verified work order installed on an
crate::service::EnvelopeContext. - Internal
Work Scope - The exact downstream dispatch coordinate one work order authorizes.
Constants§
- INTERNAL_
WORK_ ISSUER - Informational issuer marker. Verification is pinned-key, not issuer-based; a non-empty issuer deliberately avoids the #328 empty-iss in-process shortcut so a future subprocess/UDS leg needs no locality exception.
- INTERNAL_
WORK_ JWT_ TYP - JOSE
typfor internal execution work orders. - MAX_
IAT_ SKEW_ SECS - Maximum accepted clock skew between mint (
iat) and admission. - MAX_
LIFETIME_ SECS - Hard upper bound on one work order’s lifetime. Model caps
expby the caller’s own expiry as well; this bound keeps a leaked token’s window short regardless of the caller credential.
Functions§
- admit_
internal_ work_ jti_ once - Admit a work-order
jtiexactly once. Entries expire at the token’s ownexp; the cache reclaims in expiry order, is capacity-bounded (deployment-configurable), and fails closed when full of unexpired entries or misconfigured. This is worker-local defense in depth ON TOP of the envelope replay gates, not a replacement for them. - configure_
internal_ work_ replay_ capacity - Configure the deployment replay-cache capacity (validated, once-only — it must be set before the first admission materializes the cache).
- encode_
internal_ work - Encode and sign a work order (
typ: "iw+jwt", pinned Ed25519). - validate_
replay_ capacity - Validate a requested replay-cache capacity.
- verify_
internal_ work - Verify a work order against the PINNED controller key (never a CA key source) and bind it to one expected instance audience.