Repository navigation
Enterprise MCP Gateway – Secretless Agent Identity, Token Exchange and Downstream Authorization #50019
Replies: 5 comments 1 reply
|
I can't speak to AgentCore or to running this in production, but I went through LiteLLM main (527d882) to see which of your pieces exist natively today. Short version: agent → gateway identity, per-agent tool policy, and user OBO are there. Minting downstream tokens as a distinct Entra Agent Identity is not, as far as I can find. 1. Agent → gateway (Q1, first half of Q2) Callers can authenticate with OIDC JWTs ( So the agent never holds a LiteLLM key, but it still needs a JWT from an issuer LiteLLM trusts. For headless AWS agents that probably means an Entra token obtained through workload identity federation, or an AWS STS 2. Which tools an agent may use (Q2, Q4) An agent carries its own 3. Downstream tokens (Q2, Q3)
One question that decides which path fits: for ServiceNow/Elastic/ADO, does the downstream token need to be issued to each agent's own Entra identity (so the tool's own audit log shows the agent)? Or is "LiteLLM's app registration acting on behalf of the user, with the agent recorded on the LiteLLM side" acceptable? |
|
@koentv's breakdown lines up with the LiteLLM OBO docs. Drawn as a picture, the design hinges on the question koentv ended with:
If "LiteLLM's app identity acting for the user, with the agent recorded in LiteLLM's logs" satisfies your auditors, the green path needs config only. If not, the broker is the one custom piece, and it's narrow: everything before it stays native. One thing to test early either way: whether LiteLLM's JWT auth accepts tokens from the AWS STS issuer. That decides whether your AWS agents need Entra workload identity federation first. (Disclosure: I build Archboard and drew this with it.) |
|
for the headless AWS workload identity piece, the standard pattern is IRSA or EKS pod identity to get an OIDC token, then exchange that at your gateway via OAuth token exchange (RFC 8693) for a short-lived scoped token that the gateway uses to fetch downstream credentials on behalf of that specific agent. the key insight is the gateway never hands the raw credential to the agent, it performs the downstream call itself or issues a short-lived proxy token. for Entra OBO, your gateway service principal calls the OBO flow with the agent's inbound token to get a delegated token that carries both user and agent context downstream. on LiteLLM specifically, the MCP OAuth support is still maturing and i'd test the headless OIDC exchange path carefully before committing. if you want something purpose-built for the "agent never sees the raw secret" constraint, we built 1Claw around exactly this: credentials live in an HSM vault, agents reference a path and get a scoped short-lived token, the raw key never touches model context or logs. disclosure: i work on 1Claw. docs at docs.1claw.co?utm_source=github&utm_medium=comment&utm_campaign=growth if it's worth a look. |
|
@RelliFirst, I would try sending the two tokens in separate headers on the direct MCP endpoint: x-litellm-api-key: Bearer <AWS-workload-JWT>
Authorization: Bearer <Entra-user-access-token>Despite the header name, the MCP auth code passes the explicit Configure the target MCP server with You still need to verify which users each agent is allowed to act for. Sending both tokens alone does not enforce that policy. Test a denied agent/user pair as well as an invalid workload JWT and an expired user token. This is based on an AI-assisted review of |
|
Alongside the denied-pair case, I’d test revocation on a cache hit: obtain an OBO token for an allowed agent/user pair, revoke the agent’s tool access, then repeat the same request. Our work on Sinaps Studio at SinapsData checks current per-agent permissions at dispatch. A cached downstream token should supply credentials, while the gateway still makes a fresh authorization decision; token lifetime and permission lifetime need not coincide. |

Uh oh!
There was an error while loading. Please reload this page.
Hi,
We're evaluating LiteLLM as a central enterprise MCP gateway and comparing it with AWS AgentCore Gateway.
Our agents run in AWS, across multiple accounts, and need access to tools such as ServiceNow, Elastic, and Azure DevOps.
The goal is to centralize authentication and authorization without giving agents direct credentials or permissions to downstream tools.
The flow we're aiming for:
We're looking for a solution that can scale to many agents, with centralized policies, auditing, and minimal custom authentication code.
A few questions:
I'd also be interested in hearing from anyone running a similar architecture in production, particularly if you've evaluated LiteLLM against AgentCore Gateway.
Thanks!
All reactions