Skip to content

feat: agent vault mcp support - #436

Open
sheensantoscapadngan wants to merge 3 commits into
mainfrom
feat/agent-vault-mcp-support
Open

sheensantoscapadngan wants to merge 3 commits into
mainfrom
feat/agent-vault-mcp-support

Conversation

@sheensantoscapadngan

Copy link
Copy Markdown
Member

No description provided.

@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-436-agent-vault-mcp-support

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@sheensantoscapadngan sheensantoscapadngan changed the title Agent vault mcp support feat: agent vault mcp support Oct 15, 2026
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Adds MCP call names to encrypted session logs and refreshes rejected OAuth tokens before retrying once.

  • The proxy refreshes rejected OAuth credentials and retries eligible requests once.
  • MCP session logs show bounded method and tool names without recording tool arguments.

Reviews (3) · Last reviewed commit: "misc: addressed feedback" · Reviewed by Greptile

Comment thread packages/agentvault/cache.go Outdated
Comment thread packages/agentvault/upstream_auth.go Outdated
Comment thread packages/agentvault/proxy.go Outdated

// No WWW-Authenticate goes with it: passing the upstream's challenge on would start the agent's MCP client
// on an OAuth flow of its own, when the credential belongs to Infisical.
const upstreamAuthFailedBody = `{"error":"upstream_auth_failed","message":"The MCP server rejected the credential Infisical provided. Reauthorize this service in Infisical Agent Vault."}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every refresh failure ends with this message, even when the provider just blipped, infisical was unreachable, the endpoint 401s for another reason, or the body was too big to replay. credential-refresh already returns status, could refreshCredential pass it up (it's only logged right now) and use two messages:
needs-reauthorization or a 403 insufficient_scope -> "The service needs to be reauthorized in Infisical Agent Vault."
anything else -> "Couldn't get a valid credential for the service. Try again in a moment." with its own error code, e.g. upstream_auth_unavailable

}
if injectCredential(req, &matched.credential) {
outcome.brokered = true
if matched.credential.refreshable {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bearer MCP services skip this, so the upstream 401 and its WWW-Authenticate go straight to the agent, and the agent's MCP client starts its own oauth login (Inspector did exactly that). the proxy overwrites its token anyway, so that can never work. for MCP services where a bearer was injected, could the 401 become a 502 "The service's credential was rejected. Update it in Infisical Agent Vault.", same as the oauth path

Comment thread packages/agentvault/cache.go Outdated
// instead, and Infisical answers with the current token unrefreshed. hostPattern is that of the cached
// service whose credential the rejected request carried: a token minted for wherever the service points now
// must never be sent to where it used to point.
func (c *sessionCache) refreshCredential(sessionToken, serviceID, hostPattern string, rejected *credential, requiredScopes []string) (credential, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve remembers a refusal for 5s (refusedTTL), but a failed refresh isn't remembered. so while infisical is slow or down and the token's expired, every agent request does upstream 401, then credential-refresh (up to 15s if infisical hangs), then 502, over and over. could a failed refresh be remembered per service + rejected token for a few seconds like resolve does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants