Skip to content

feat(agent-vault): ask the service's hook before attaching the credential - #500

Merged
saifsmailbox98 merged 8 commits into
mainfrom
saif/agent-vault-hooks
Nov 13, 2026
Merged

saifsmailbox98 merged 8 commits into
mainfrom
saif/agent-vault-hooks

Conversation

@saifsmailbox98

@saifsmailbox98 saifsmailbox98 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Description 📣

The proxy now asks a service's hook before it attaches the credential, and only sends the request on if the hook allows it. Companion to Infisical/infisical#9408, which adds hooks to services and sends them on /resolve

  • New hook.go: signs each call with Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature: v1,<base64>) plus Idempotency-Key, so Go can resend on a pooled connection the hook server closed. 3 s timeout, no redirects, Proxy: nil, answer capped at 64 KB, decision must be exactly allow or deny
  • HTTP and MCP: every request to a hooked service asks the hook, after the proxy's own checks and before substitutions and the credential. The hook gets the first 1 MB of the body, and the rest is still forwarded
  • Deny is a 403 hook_denied carrying the hook's message, failure a 503 hook_failed with Retry-After: 5. MCP tools/call gets a tool result with isError: true, so clients pass the message to the model, and other MCP requests get a JSON-RPC error
  • Postgres, MySQL and SSH ask once per connection, after registerNative and before the tunnel opens. connect now reads refusals up to 8 KB
  • The hook outcome goes on the existing request log line (hook URL logged as scheme://host only) and into the session log record; deny counts as blocked, failure as error
  • A hook config the proxy can't use always fails, never turns into "no hook"

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

  • New or changed commands follow CLI.md, and new commands and flags are recorded in packages/cmd/testdata/command_surface.json
  • Updated AGENTS.md files (if needed)
  • I have read the contributing guide, agreed and acknowledged the code of conduct. 📝

@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-500-feat-agent-vault-ask-the-service-s-hook-before-attaching-the-c

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

@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Fixed/addressed: 4 · PR risk: 0/10

Reviews

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The update appears safe to merge; no blocking issue remains.

Summary

Adds service hooks before the proxy uses stored credentials.

  • HTTP requests wait for the service hook before credentials are attached.
  • MCP clients receive hook refusals in MCP’s own response formats.
  • Database and SSH connections wait for the service hook before the tunnel opens.
  • Hook denials and failures appear in request and session logs.

Reviews (8) · Last reviewed commit: "fix(agent-vault): decide whether to watc..." · Reviewed by Greptile

Comment thread packages/agentvault/proxy.go Resolved
Comment thread packages/agentvault/mcp_tools.go Resolved
Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/mcp_tools.go Resolved
Comment thread packages/agentvault/mcp_tools.go Resolved
Comment thread packages/agentvault/hook.go Resolved

@scott-ray-wilson scott-ray-wilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of the proxy side of hooks, paired with Infisical/infisical#9408. Four correctness comments and two cleanups (marked as such).

Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/proxy.go Resolved
Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/proxy.go Resolved
Comment thread packages/agentvault/hook.go Resolved
Comment thread packages/agentvault/discovery.go Resolved
…sals, share batch, text-cut and Retry-After helpers
Comment thread packages/agentvault/proxy.go Resolved

@scott-ray-wilson scott-ray-wilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@saifsmailbox98
saifsmailbox98 merged commit 2d09861 into main Nov 13, 2026
35 checks passed
@linear

linear Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

AGE2-364

AGE2-120

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