Skip to content

Exchange

This content is for v1.0. Switch to the latest version for up-to-date documentation.

Every agent action starts with exchange — validate the inbound credential, apply policy, mint a short-lived WIMSE JWT scoped to one audience. That is Starfly’s core job on the fabric.

  • One front door — Kubernetes, SPIFFE, OIDC, and MCP agent creds all use the same RFC 8693 shape.
  • Scoped by defaultaudience at exchange time becomes aud on the JWT; blast radius is chosen up front.
  • Fast by design — lookup, policy, and sign stay on the hot path; everything else is async.
Workload credential → POST /v1/exchange/token → WIMSE JWT
(inbound) OPA + validators (outbound, aud-scoped)
  1. Client sends an RFC 8693 token exchange request.
  2. Starfly identifies credential type (subject_token_type).
  3. Validators check signature, expiry, and trust domain match.
  4. OPA policy allows or denies — see policies/.
  5. Starfly signs a WIMSE JWT with sub, aud, td, exp, and optional delegation claims.

Background work (graph, behavioral profiling, federation relay) runs on NATS consumers — never inside the exchange request.

The exchange path is optimized for sub-millisecond end-to-end latency in production fabrics. Do not add synchronous dependencies (remote calls, blocking I/O) to this pipeline.

Async integrator surfaces — dashboard, graph, UTC — sit beside exchange, not in it.

ModeCredentialPolicy
--devStub JWTs acceptedpolicies/dev/ permissive
ProductionReal platform credentialsOperator-authored Rego
PathPurpose
POST /v1/exchange/tokenExchange
GET /v1/identity/jwksVerify issued tokens
GET /metricsstarfly_exchange_* histograms

Full reference: OpenAPI — exchange.

Terminal window
make build-dev && ./bin/starfly --dev
./sandbox/run.sh exchange

Integrator walkthrough: token exchange.

PathRole
pkg/exchange/Exchange pipeline
policies/OPA Rego bundles