routing_mode is role_based: instead of
the consumer owning registries directly, each request’s IDP token is matched to a role, and
the role decides what that caller can reach.
This lets one consumer (one endpoint) serve many identities — each user or group routed to
different models and tools based on their token — without minting a consumer per tenant.
What a role defines
| Field | Meaning |
|---|---|
name | Display name. |
registry_ids | The registries this role may use. |
model_policies | Per-registry allow-list and default model (same shape as on a consumer). |
mcp_policies | MCP toolkit and fail mode for agent traffic. |
idp_mapping | Claim-match rules: which IDP token claims select this role. |
How selection works
- A client calls a
role_basedconsumer with anAuthorization: Bearer <idp-jwt>. - The
idpauth validates the token (issuer, audience, JWKS, scopes). - The token’s claims are matched against each role’s
idp_mapping. - The matched role’s
registry_ids,model_policies, andmcp_policiesgovern routing for that request.
Managing roles
CRUD lives under/v1/gateways/{gateway_id}/roles, plus registry binding:
…/roles/{role_id}/registries/{registry_id}(POST/DELETE) — attach/detach a registry to the role.- Attach a role to a consumer via
…/consumers/{id}/roles/{role_id}.