Skip to content
Latest (currently 2026.10.2) has the newest features, bug fixes, and CVE patches of Solo Enterprise for agentgateway.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Delegation

Page as Markdown

Configure agentgateway to perform RFC 8693 delegation, issuing a token that carries both the user’s identity and the agent’s identity in an act claim so that downstream services can see who acted on whose behalf.

Solo Enterprise for agentgateway implements On-Behalf-Of (OBO) token exchange through its own built-in security token service (STS). The STS ties into your existing OpenID Connect (OIDC) flows through your enterprise identity provider (IdP). This way, you don’t need to set up a separate IdP or worry about whether your IdP natively supports RFC 8693 token exchange.

About OBO

OBO token exchange enables agents and MCP servers to act on behalf of users through token delegation. This feature is defined by RFC 8693 (OAuth 2.0 Token Exchange) and is relevant for communication between agents and MCP servers, or between agents.

With OBO, you can:

  • Exchange a user’s OAuth access token (JSON Web Token (JWT)) for a delegated token that an agent can use.
  • Apply fine-grained policies that reference both the user identity and the agent identity.
  • Generate audit logs that track the full call chain identity.
  • Enforce least-privilege access by downscoping tokens to specific audiences and scopes.

Example OBO token exchange flow

Review the following example flow to understand how OBO token exchange works.

    sequenceDiagram
    participant User as User
    participant Agent as Agent
    participant STS as Agentgateway STS
    participant MCP as MCP Tool Server

    User->>Agent: Call with OAuth access token (JWT)
    Note over Agent: Agent authenticates as the actor<br/>with a Kubernetes service account token
    Agent->>STS: Exchange subject token for delegated token
    STS->>Agent: Return delegated token (downscoped)
    Agent->>MCP: Call with delegated token
    Note over Agent,MCP: Policies reference both<br/>User and Agent identity
  
  1. The User calls the Agent with an OAuth access token (JWT) from their identity provider.
  2. The Agent performs a token exchange request to the token exchange server and includes the user’s token as the subject token, along with the Agent’s actor identity.
  3. The token exchange server validates the subject token (such as with an OpenID Connect (OIDC) JSON Web Key Set (JWKS) URL) and validates the actor identity (such as with Kubernetes service account tokens).
  4. The Agent calls the MCP Tool Server with the delegated token.
  5. Policies can reference both the User’s identity and the Agent’s identity for authorization decisions.

Step 1: Set up an IdP

To use OBO token exchange, you can use your existing IdP that supports OpenID Connect (OIDC). The user authenticates with the IdP to get a JWT, includes the JWT when calling an agent that accesses a backend service through agentgateway, and agentgateway validates and exchanges the JWT for a delegated token via the STS. The agent then uses the delegated token that includes both the user and agent identities.

You can use any OIDC-compliant identity provider.

If you don’t have an IdP set up, try out Keycloak.

  1. Set up Keycloak as an IdP.

  2. Save and open the JWKS endpoint, which is typically formatted as the following example.

    export KEYCLOAK_JWKS_URI=${KEYCLOAK_URL}/realms/${KEYCLOAK_REALM_NAME}/protocol/openid-connect/certs
  3. Copy the keys as an environment variable.

    export KEYCLOAK_CERT_KEYS={"keys":[{"kid":"_YYA...","kty":"RSA","alg":"RSA-OAEP","use":"enc","n":"r4AXlC9sR..."}]}

Microsoft Entra ID requires additional setup steps to use for token exchange. For more information, see OBO with MS Entra ID.

You can also integrate with other IdPs. Make sure to get the JWKS URI for remote JWKS or the JWKS keys for an inline JWKS policy.

In many providers, these follow a typical endpoint style. For example, Okta and Auth0, the endpoint to retrieve the JWKS keys is usually as follows.

https://integrator-${OKTA_ID}.okta.com/oauth2/${AUTH_SERVER}/v1/keys

If you are unsure how to set up your IdP, refer to the documented examples for Keycloak as an example of an IdP that is compliant with RFC 8693 or MS Entra ID as an example of an IdP that is non-compliant with RFC 8693.

Step 2: Set up token exchange

To use OBO token exchange, you need to set up the STS token exchange server in Solo Enterprise for agentgateway.

  1. Get your existing or create a Helm values file.

    helm get values enterprise-agentgateway -n agentgateway-system -o yaml > values.yaml
  2. Add the following token exchange configuration to the Helm values file.

    
    tokenExchange:
      enabled: true
      issuer: "enterprise-agentgateway.agentgateway-system.svc.cluster.local:7777"
      tokenExpiration: 24h
      subjectValidator:
        validatorType: remote
        remoteConfig:
          url: "${KEYCLOAK_JWKS_URI}"
      actorValidator:
        validatorType: k8s
      apiValidator:
        validatorType: k8s
    Review the following table to understand this configuration.
    SettingDescription
    enabledEnable the security token service (STS).
    issuerThe issuer of the STS token exchange server, typically the address of the control plane service on port 7777.
    tokenExpirationThe expiration time of the STS token, such as 24h for 24 hours.
    subjectValidatorThe remote type and OIDC JWKS URL of the remote validator, such as the Keycloak instance that you created in the previous section.
    actorValidator.validatorTypeSet the validator type to k8s so that the STS can validate the actor token by using Kubernetes service account tokens.
    apiValidator.validatorTypeThe validator for the elicitations CRUD API endpoints. This value is required even though the RFC 8693 delegation flow does not use elicitation. If you omit it, the STS server cannot build the validator and the controller fails to start in a CrashLoopBackOff state. Set to k8s to validate these calls with Kubernetes service account tokens, which requires no additional configuration. Alternatively, set to remote with a remoteConfig.url JWKS endpoint (for example, when the Solo Enterprise for agentgateway UI sends IdP-issued JWTs to the elicitations API), or static with an inline JWKS.
  3. Install or upgrade Solo Enterprise for agentgateway with the token exchange configuration.

    helm upgrade -i enterprise-agentgateway oci://us-docker.pkg.dev/solo-public/enterprise-agentgateway/charts/enterprise-agentgateway \
      -n agentgateway-system \
      --create-namespace \
      --version v2026.10.2 \
      -f values.yaml
  4. Verify that Solo Enterprise for agentgateway is running and that the control plane service has port 7777 for the STS token exchange server.

    kubectl get deploy -n agentgateway-system enterprise-agentgateway
    kubectl get svc -n agentgateway-system enterprise-agentgateway

    Example output:

    NAME                                                       READY   STATUS    RESTARTS   AGE
    enterprise-agentgateway-5ff668476b-jvrdn                   1/1     Running   0          2m51s
    
    NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
    enterprise-agentgateway   ClusterIP   10.96.195.136   <none>        9978/TCP,9093/TCP,7777/TCP   17h
    

Step 3: Set up your agent to use STS

Now that STS is enabled for agentgateway, you need to set up your agent to use STS.

  1. Integrate your agent with the agentsts-adk python package.

  2. Deploy your agent with an agent management tool, such as kagent.

  3. Configure your agent to use an MCP tool that runs in your cluster, such as the sample static MCP fetcher tool.

  4. Apply a JWT policy to the MCP tool that requires a token from the IdP provider that you set up in Step 1.

    kubectl apply -f- <<EOF
    apiVersion: enterpriseagentgateway.solo.io/v1alpha1
    kind: EnterpriseAgentgatewayPolicy
    metadata:
      name: jwt-policy
    spec:
      targetRefs:
        - group: gateway.networking.k8s.io
          kind: HTTPRoute
          name: mcp
      traffic:
        jwtAuthentication:
          mode: Strict
          providers:
          - issuer: enterprise-agentgateway.agentgateway-system.svc.cluster.local:7777
            jwks:
              inline: '${KEYCLOAK_CERT_KEYS}'
    EOF
    Review the following table to understand this configuration.
    SettingDescription
    targetRefsSelect the route that you want to protect, such as the mcp HTTPRoute for the static MCP fetcher tool.
    issuerThe issuer of the STS token exchange server, typically the address of the control plane service on port 7777.
    jwksThe JSON Web Key Set (JWKS) to use to verify the JWT. In this example, a local JWKS is provided inline from the Keycloak IdP, ${KEYCLOAK_CERT_KEYS}. To use JWTs with Solo Enterprise for agentgateway, make sure that the JWTs return Key ID (kid) and expiration date (exp) values in the JWT header.
  5. As a user, send a request to the agent that accesses the MCP tool. In your request, include a JWT from the IdP provider that you set up in Step 1. The agent exchanges the JWT for a delegated token via the STS endpoint and uses the delegated token to call the MCP tool.