Agent Secrets Broker
Reads real credentials from a read-only 1Password vault via a service account, allowing the broker to fetch secrets by reference and use them for upstream API calls without exposing them to agents.
Provides GitHub-like repository tools against a mock Git upstream acting as a stand-in for GitHub, enabling agents to list repositories, retrieve README content, and create issues, with sensitive writes requiring approval.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Agent Secrets Broker
A small service that holds secrets and makes API calls on behalf of AI agents. Agents connect to it as a remote MCP server, sign in with OAuth, and can call only the tools their policy allows. No tool ever returns a secret.
The test it is built to pass: Claude Duet asks the broker to do something that needs an API key, gets the result back, and the key never appears anywhere Duet can see.
Status: proof of concept. Two deployments:
The sandbox holds dummy test secrets (
TEST_SECRET_AtoGstyle values) and calls a mock upstream it hosts itself. It carries the mechanism tests, all passing against the deployed URL, and Claude Duet's own run through a claude.ai connector on 2026-11-12: six of six (docs/test-log.md).The live broker is for real accounts. It holds Jack's Adobe sign-in for da.live, and Claude Duet has used it end to end (2026-11-13). Its secrets are Cloudflare Worker secrets for now; 1Password is built but not in use (docs/live-setup.md).
Phase 2 results, negatives included, are in docs/findings.md.
Documentation
Two folders, for two kinds of reader:
docs/is for people and AI agents. Start with the architecture guide: diagrams of the broker, the two sign-ins, how the localhost redirect hands the broker a one-time code that it swaps for tokens, and a tool call with approval, plus what the broker knows about who the user is.ai-docs/is for AI agents. It holds the context an agent needs before working here: the original specs kept verbatim, session records of what was decided and what failed, and working notes.
Start here | For |
Understanding or presenting the design | |
What was proven, what failed, and why | |
The evidence, generated by the test scripts | |
The steps only the owner can do on the live broker | |
An agent picking up this repo | |
The original spec and the Phase 2 brief |
Related MCP server: Acutis Gate
What the broker can and can't do
Phase 2 at a glance (details and evidence in docs/findings.md):
Experiment | Result | |
A | da.live as Jack (Adobe sign-in held by the broker) | Works. Claude Duet listed, read and saved a draft on da.live as Jack, each call approved by him. It goes through Adobe's hosted DA MCP server with a localhost sign-in, because Adobe's Developer Console offers Jack's org only server-to-server credentials |
B | Best Buy orders with Jack's username and password | Blocked by Best Buy's terms for AI agents. No attempt made |
C | Per-call approval for sensitive tools | Works. Shown by Claude Duet on both brokers: pending, Jack approved, ran once. Approving every call was slow for simple jobs, so on the live broker only writes need approval now |
D | Negative tests: prompt injection, stolen tokens, revoke speed, cross-agent isolation, logs | Works with caveats. The broker contains a fooled agent but can't prevent one; a stolen refresh token works until revoke; "duet" is any Claude on Jack's account |
It can:
Call APIs with keys agents never see. No tool returns a secret, token or credential, error messages included. A redactor scrubs every secret it has handled from anything it sends out.
Give each agent its own tools. The owner picks the agent when approving a connection. Each agent gets only its policy's tools, and other calls are refused and audited (Duet vs AnimaMesh, tested).
Hold a call until the owner approves it. Sensitive tools return "pending" until Jack approves that exact call on the admin page, and it then runs once. Only the owner's password session can approve, never an agent's token or the admin token. Claude Duet did this end to end on the sandbox.
Contain a fooled agent. Text from upstreams arrives marked untrusted. A call that tries to send out a credential (its own access token, a key) is refused, and writes wait for approval. A key embedded in upstream content is redacted.
Cut a connection off at once. Revoke takes effect on the next call and the next refresh, including tokens minted seconds earlier; that needed a fix, see findings D3.
Rotate keys without a redeploy, and keep an audit trail. The audit log records who called what and how it went, with no arguments, contents or tokens.
Hold a user's own sign-in for an upstream. Jack signed in on Adobe's page; the broker stores the tokens encrypted and refreshes them, and its DA tools act as him through Adobe's hosted MCP server (findings A).
It can't, or doesn't yet:
Stop an agent from being fooled. It limits what a fooled agent can do; it can't stop the agent from believing injected text.
Detect a stolen refresh token. The thief and the real client can both refresh until the owner revokes; there's no reuse detection.
Get user-delegated access from a provider's developer console when it only issues service credentials. Adobe's console gave Jack's org server-to-server only; the broker got in through Adobe's own MCP server instead, on a localhost redirect Adobe happens to allow (findings A).
Sign in with a username and password where the site forbids agents. Best Buy's terms allow agents only through published methods, and there are none. Blocked, no attempt made (findings B).
Solve CAPTCHAs, get past bot checks, or answer MFA prompts. It doesn't, by design.
Notify the owner of a pending approval, or approve in bulk. Jack has to open the admin page for each call; one simple da.live job took three approvals. Email or push needs an account.
Limit an upstream token to less than the user's own rights. Jack's Adobe token can write wherever he can; only the broker enforces the scratch folder.
Tell one person from another. There is one owner and one password, and the Claude app tells the broker nothing about who is using it. Adobe's sign-in does yield a stable user ID (no email or name), which could key per-person roles; that and the alternatives are in the architecture guide. Not built.
Tell one Claude from another. A connector added in claude.ai belongs to Jack's account, so every Claude on it that loads connectors (Duet, a normal chat, Claude Code) reaches the broker as the same agent. Confirmed 2026-11-12: a Claude Code session showed up as
duet. Narrow tool lists, approval on writes and revoking when idle limit this; binding to one agent needs that agent to prove its identity (findings, section 0).Hold two connections from one app. A new consent from the same app (same client ID) replaces the earlier connection; the consent page warns before it does.
Tell people apart. There is one owner. The OAuth client ID identifies the app (every Claude user presents the same published ID), not the person, and every connection is approved with the one owner password. Separate users with their own permissions, accounts and approvals would need per-person sign-in on the consent page (for example Google sign-in for an allow-list of emails). Not built.
Sandbox | Live | |
MCP server URL |
|
|
Admin |
|
|
Secrets | KV vault, dummy values A to G | Cloudflare Worker secrets set by Jack (1Password variant kept, not deployed) |
Tools |
|
|
Upstream | Mock Git ( | Adobe da.live through Adobe's hosted MCP server, one scratch folder |
Runtime: Cloudflare Workers (three Workers, six KV namespaces, Durable Objects for approvals and revocations).
Connect an agent
Claude (claude.ai, desktop, mobile and Claude Duet)
Get the sandbox owner password on the Mac that holds this repo:
npm run sandbox -- owner-password(it reads the gitignored.secrets/sandbox.json). It is a dummy value, but keep it to yourself: anyone with it can approve a connection.In claude.ai go to Customize > Connectors (
https://claude.ai/customize/connectors; some app builds call it Settings > Connectors) and add a custom connector.Name:
Agent Secrets Broker (sandbox). URL:https://agent-secrets-broker-sandbox.jackzhaojin.workers.dev/mcpOAuth client: either option works. The broker supports both.
Use Claude's published identity (Claude's default, a Client ID Metadata Document). Claude's client ID is
https://claude.ai/oauth/mcp-oauth-client-metadata, or its/confidential_clientvariant, which signs its token requests. The consent page will then say "Published by claude.ai". The scripted test runs this path end to end with the public document (M2), and the confidential one up to the signature only Claude can make (M3).Register automatically (Dynamic Client Registration). The scripted test runs this path too, with the exact claude.ai callback URL (C1 to C7). If the first option fails, remove the connector and add it again with this one: Claude doesn't let you change auth settings after adding.
Leave client ID and secret empty.
Click Connect. A window opens on the broker's consent page. Check that access goes to
claude.ai, keep agent duet selected (it is preselected for clients named Claude), type the owner password, and press Approve.The connector shows as connected, with four tools:
whoami,mockgit_list_my_repos,mockgit_get_readmeandmockgit_create_issue(the last one needs your approval on every call).Ask Duet (or any Claude chat with the connector on) to run acceptance tests 2 to 4:
"Call whoami on the Agent Secrets Broker." Expect agent
duet, your client's name, the four tools, andmockgit_create_issueunder approval_required."List my repos with the broker." Expect the 8 mock repos (
sandbox-alphatosandbox-hotel), each with only name, url and updated."Did any tool result contain an API key, token or password?" Expect no. (You can also check: the key values are in
.secrets/sandbox.json; none should appear in the chat.)
To cut Duet off: open /admin, sign in with the owner password, and press Revoke on its row. Its next call fails with 401, and reconnecting needs your approval again.
Any other MCP client
Point it at the MCP URL. It needs Streamable HTTP and OAuth 2.1 with PKCE (S256), and either Dynamic Client Registration or a Client ID Metadata Document. MCP Inspector and Claude Code work as is. Pick the agent it should be on the consent page; inspector exists for manual testing.
How it works
The diagrams and the walk-through of both sign-ins are in docs/architecture.md. The summary below describes the sandbox.
Agent (Duet / AnimaMesh / Claude Code)
| MCP over HTTPS + OAuth access token (15 min)
v
+---------------------------------------------+
| agent-secrets-broker-sandbox (Worker) |
| - OAuth 2.1 authorization server |
| DCR, CIMD, PKCE S256, refresh rotation |
| - Consent page: owner password + agent |
| - Policy: agent -> allowed tools |
| - Tools fetch the secret at call time |
| - Audit log, redaction backstop |
+---------------------------------------------+
| read secret by reference (cached 5 min in memory)
v
Vault (KV namespace VAULT; 1Password for real secrets)
|
v Service Binding, Authorization: Bearer <secret>
agent-secrets-broker-mockgit (Worker): Mock Git API, a stand-in for GitHubOne Worker is both the OAuth authorization server and the MCP server, using
@cloudflare/workers-oauth-provider1.2 and the MCP TypeScript SDK's web-standard Streamable HTTP transport (stateless, no Durable Objects).Discovery follows the MCP authorization spec and Claude's connector docs: an unauthenticated call gets
401withWWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource/mcp", scope="broker". The protected resource metadata names the exact MCP URL. The authorization server metadata advertises S256, the registration endpoint,client_id_metadata_document_supported: trueand thenoneauth method.Each connection is bound to an agent. The owner picks the agent on the consent page. The grant stores it (encrypted), and every MCP request builds a server with only that agent's tools. A call to any other tool is refused and audited as
denied.Tools are task-shaped. There is no
get_secret.mockgit_list_my_reposreadsmockgit/api_keyfrom the vault, calls the upstream, and returns only name, url and updated. If the upstream rejects the key, the tool drops its cached copy, re-reads the vault and retries once. That is why a rotation works with no redeploy.The upstream is careless on purpose. Its 401 echoes the key it was given, and its listing puts the key in
clone_url_with_token. The broker never passes upstream bodies through and allow-lists the fields it returns. A redactor scrubs any known secret value from tool output as a last line of defense (it has never fired in the tests).Audit: one line per tool call, consent, revoke, policy change and failed sign-in: time, client, agent, tool, outcome, short code. No arguments, tokens or upstream data. Kept 30 days in KV, also written to Workers Logs.
Revoke: the admin page or
npm run admin -- revoke <client_id>revokes every grant of a client. Its access and refresh tokens stop working at once.
Policy
policy.json maps agents to tools:
Agent | Tools | For |
|
| Claude Duet through a claude.ai connector |
|
| AnimaMesh: counts only, nothing Duet has (isolation tests) |
| Duet's tools, with | MCP Inspector and scripted tests |
Tools marked requiresApproval in code (mockgit_create_issue) need the owner's approval on every call; a policy's approval_required can add more per agent. See "Per-call approval" below.
policy.json is bundled with each deploy. To change policy without a deploy, push an override (npm run admin -- policy push edited.json); npm run admin -- policy reset goes back to the file. A malformed override fails closed: no agent gets any tool.
Per-call approval
A tool that needs approval answers its first call with pending_approval, an approval id and a link (/admin/approvals/<id>); nothing runs. The owner opens the link (signing in with the owner password returns to it), checks the arguments and presses Approve once or Deny. The agent then repeats the exact same call, which runs once. An approval is bound to the client, the agent, the tool and the exact arguments, lasts 15 minutes, and is single use; a denial stands for 15 minutes. Only the owner's password session can decide: an agent's OAuth token, the admin API token and the admin API itself cannot (the API lists approvals read-only). Approvals live in a Durable Object, so approve-then-run-once is atomic and takes effect at once. Notifications are the admin page only for now.
Tests
npm run test:e2e (default --target remote) runs the whole flow against the deployed sandbox and writes docs/test-log.md. --target local runs it against npm run dev.
npm run test:duet -- --since <ISO time> reads Claude Duet's own calls on the sandbox from the audit log (the connection Jack added in claude.ai) and writes them to the "Claude Duet on the sandbox" section of the test log. Pick a window with no e2e run in it: the e2e's M2 check also connects as duet with the Claude app's client ID. Add --live for Duet's calls on the live broker (the da.live tools).
It acts as the agent's MCP client and as the owner:
Discovery: the 401 challenge, both metadata documents, a made-up token refused.
Connect like the Claude app: DCR with
https://claude.ai/api/mcp/auth_callback, the consent page (wrong password refused, right password approved), the PKCE code exchange, code replay refused (which also revokes that code's tokens), then MCP initialize and tools/list with the official SDK client.Acceptance tests 2 to 7 from the spec, against the deployed URL.
CIMD with Anthropic's real documents:
https://claude.ai/oauth/claude-code-client-metadata(Claude Code's published client ID, M1), and the Claude app's ownhttps://claude.ai/oauth/mcp-oauth-client-metadatabound toduet, through token, refresh and both tools (M2). Its/confidential_clientvariant gets the consent page, and its code is refused without Claude's signed assertion (M3). Each CIMD check revokes only the grants it created, because a CIMD client ID is shared by every install of that app, Jack's own connector included.A stock MCP SDK client that discovers auth from the 401 by itself, the way MCP Inspector and Claude Code do.
No-leak sweep: every response body and header (errors included), the audit log, and the Worker's own logs from
wrangler tail, searched for all seven dummy values. A control check first proves the scan finds the values in the mock upstream's own careless responses.
Run and deploy
Node 22 and a wrangler login to the Cloudflare account.
npm install
npm run sandbox -- init # dummy secrets A-G in .secrets/sandbox.json (gitignored), plus .dev.vars
npm run dev # both Workers locally on :8787
npm run sandbox -- seed --local # vault and mock upstream state for local
npm run test:e2e -- --target localDeploy (the KV namespace IDs in the two wrangler.jsonc files belong to Jack's account; create your own with npx wrangler kv namespace create <name> and replace them):
npm run deploy # mock upstream, then the broker
npm run sandbox -- push # OWNER_PASSWORD (D), ADMIN_TOKEN (E), COOKIE_SECRET (F) as Worker secrets
npm run sandbox -- seed --remote # vault mockgit/api_key=A, canary/unused=G; upstream accepts A
npm run test:e2e # writes docs/test-log.md
npm run scan # before every push: dummy values, forbidden files, key shapes, gitleaksLive broker (real secrets; Jack sets OWNER_PASSWORD, ADOBE_OAUTH_CLIENT_ID and ADOBE_OAUTH_CLIENT_SECRET himself, see docs/live-setup.md):
npm run deploy:live # deploys wrangler.live.jsonc (secrets as Worker secrets)
npm run deploy:live:1password # the 1Password variant instead: patches its SDK for workerd first
npm run live -- init-keys # ADMIN_TOKEN, COOKIE_SECRET, TOKEN_ENC_KEY: random, never printed
npm run live -- status # which secrets are set (names only)
npm run test:live # live checks + Duet's calls from the audit log; add -- --tail 300 while Duet runs
npm run admin -- --live audit # the live audit logOther sandbox commands: npm run sandbox -- vault B --remote (rotate the vault), npm run sandbox -- upstream B --remote (rotate what the upstream accepts), npm run sandbox -- show (labels and fingerprints). npm run admin -- clients | audit | policy.
Security rules this follows
No tool returns a secret, token or credential. There is no
get_secrettool.Upstream bodies are never passed through. Tool output is allow-listed, then redacted.
No request bodies, tokens or upstream responses in logs or the audit log.
Access tokens last 15 minutes. Refresh tokens rotate on use and are revocable. PKCE S256 is required. Redirect URIs are matched exactly (loopback ports excepted, per RFC 8252).
The consent page shows the client's name, whether it is verified (CIMD) or self-registered (DCR), where access goes, and a warning for localhost. It can't be framed, loads nothing external, and takes a single-use handle bound to the browser.
Owner sign-in locks out an IP after 10 failures in 15 minutes.
HTTPS only (Workers). Sandbox secrets are dummy values that never leave
.secrets/sandbox.jsonand the Worker's secret store.
Findings (spec section 8)
Question | Answer |
What OAuth does a Claude custom connector expect? | Callback |
Can Duet add a connector itself? | Not by itself: connectors are added in claude.ai settings (Customize > Connectors). A connector added there was available in Claude Duet (2026-11-12): Duet ran acceptance tests 2 to 4 through it (findings, section 0). |
Does the 1Password JS SDK run in Workers? | Not as published (its WASM core is read with |
Can Grok Bot, Muse or Dots use remote MCP? | Not checked (out of the baseline). |
Phase 2
Done this phase:
Per-call approval.
Negative tests (prompt injection, stolen tokens, revoke speed, cross-agent isolation, logs), plus the fixes they drove.
The live deployment (built on 1Password, now running on Worker secrets by Jack's choice).
Adobe user-delegated OAuth with the DA tools.
Results and the blocked Best Buy experiment are in docs/findings.md.
Still open:
The real-account runs: Jack's setup, Adobe consent, and Duet calling the live tools.
From the original spec: approval notifications, AnimaMesh as a client-credentials client, a metadata-only
secrets_inventorytool, agent-to-agent grants, and a Grok Bot connector test.
Layout
src/index.ts sandbox entry: KV vault, Mock Git tools, policy.json
src/live.ts live entry (Worker secrets); live-1password.ts is the 1Password variant; live-common.ts holds
what they share: DA tools, Adobe connect, daily refresh cron, policy.live.json
src/worker.ts OAuthProvider wiring: routes, scopes, token lifetimes, CIMD, DCR, refresh revocation check
src/deployment.ts what differs between the two deployments
src/app.ts consent page, admin page and admin API, approvals pages, landing, healthz
src/mcp.ts MCP endpoint: policy-filtered tools, approval gate, credential-in-arguments refusal, revocation check, redaction
src/tools/ core.ts (whoami), mockgit.ts (sandbox), da.ts (live, da.live scratch folder), types.ts
src/upstream/adobe.ts Adobe IMS user OAuth: /connect/adobe, token refresh, admin status
src/sealed.ts AES-GCM for upstream tokens at rest
src/approvals.ts per-call approval store (Durable Object)
src/revocations.ts revocation list (Durable Object): revoke takes effect at once
src/secrets/ store.ts (SecretStore, KV vault, cache), worker-secrets.ts (live), onepassword.ts (kept)
src/policy.ts, policy.json, policy.live.json, src/audit.ts, src/auth.ts, src/redact.ts, src/html.ts
mock-upstream/ the Mock Git API Worker
scripts/ sandbox secrets, live keys, admin CLI, 1Password patch, secret scan
test/e2e.mjs the sandbox acceptance and negative tests
test/live.mjs checks against the live broker, and Duet's calls from its audit log
docs/ for people and agents: architecture, findings, test log, live setup, 1Password notes
ai-docs/ for agents: original specs, session records, working notes
spikes/ 1password-workers: the patched SDK running in workerdMIT license.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
IAM for AI agents, providing secure credential management, individual agent identities, scoped credential access, approval controls and audit logs. Connect via MCP using OAuth or an agent token.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a secure MCP gateway for AI agents to access APIs without exposing raw credentials, with scoped access, audit logging, and OAuth support.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to call upstream MCP tools under each user's own identity, with guardrails, approvals, data filtering, and tamper-evident audit streaming to SIEM.AGPL 3.0

Civic MCP Gatewayofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to connect to tools and data through a governed MCP endpoint with agent identity, scoped permissions, guardrails, and full audit trails. Access is user-controlled and can be revoked instantly, with every tool call logged by agent identity and timestamp.MIT- AlicenseNot gradedqualityBmaintenanceEnables agents to discover and execute API operations through a policy-controlled, audited MCP interface, with reads governed by policy and writes requiring human approval or grants.209 PyPI4Apache 2.0