2026-11-26 15:40 UTC

MCP-warden brokers credentials for agent actions; a reported config-bypass test raises caveats

state: watchingheat: mediumuncertainty: mediumrelevance: highagent-security credential-brokering mcpermoluk

What is this?

MCP-warden is an open-source, local-first credential broker for MCP-based AI agents, maintained by GitHub user ermoluk. Its project documentation says credentials are stored in the operating system keychain; agents request named, scoped actions, and the tool validates requests before injecting credentials. It documents HTTP, SSH, SFTP and database tools, approval prompts and a local audit log, and says it can be installed from crates.io or GitHub releases. A newer Reddit post describes a security test in which an agent with shell access could alter configuration for a later session and switch a preset to auto-approval; the post says fixes are listed in version 0.5.4, but the supplied sources do not include that changelog or independently verify the fix. The documentation describes safeguards, not an independent security audit.

Why it matters

Credential brokering could let agents take useful real-world actions without placing raw API keys or database credentials in their context, reducing exposure through transcripts or prompt injection. Scoped actions, human approvals and audit trails offer a practical layer of control. But the newer reported test highlights a boundary that matters: protecting secrets inside the broker does not secure mutable permissions or a privileged shell the agent can access. This is a useful development in agent-security tooling, not evidence that agent actions are made safe overall.

Current assessment

The project is available now as open-source software; its README documents installation, multiple MCP clients, OS-keychain storage, allow-list checks before credential injection, approval policies and append-only local audit logging. It supports HTTP requests, SSH commands, SFTP transfers and named database queries. These are project-described capabilities, not independently validated security guarantees. The README also documents configuration risks: an HTTP preset without allowed paths permits every path under its base URL, and an agent able to modify configuration could undermine intended approval policy. A Reddit post dated Nov. 2 reports that a Claude Code adversarial test found an agent could edit configuration read by a later session and change a preset to auto-approve; it also says approval prompts initially omitted the host and notes that screen-controlling agents may click dialogs. The poster says fixes appear in the 0.5.4 changelog, but that changelog is absent from the supplied evidence, so the current fix status and prompt details remain unconfirmed. The same post's shell-access caveat is important: a broker cannot enforce boundaries against an agent that can change its policy or operate privileged interfaces. Evidence of availability and design is first-party; HN listings and the Reddit account provide discovery and a reported test, not adoption metrics or independent audit evidence.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady3 platformsage 725h
points/hour across evidence ยท reading as of 2026-11-27 02:23:58.509736+11:00 ยท deterministic, not a model opinion

How the heat travelled

10-27 11:29 (minted)โญ origin echo-reconstructedA local-first MCP credential broker stores secrets in the OS keychain, validates requests against scoped presets before injecting credential
ermoluk on github (echo) ยท attributed from hn.story.50256991 ยท published time unknown
โ€”
10-27 10:28first on hacker news ยท published ยท lag ?MCP-warden local credential broker so AI agents never see your secrets
ermoluk
โ€”
11-02 12:29first on r/ClaudeAI ยท published ยท lag ?I asked Claude Code to break the tool that hides my secrets from Claude Code
Relevant_Mousse_9117
โ€”
10-27 10:28amplified on hacker newshn.story.50256991
ermoluk
peak 1 ยท 0 comments ยท 11% of case engagement
11-02 12:29amplified on r/ClaudeAI ๐Ÿ‘‘reddit.post.1xlvvbm
Relevant_Mousse_9117
peak 4 ยท 9 comments ยท 78% of case engagement
11-02 12:44amplified on hacker newshn.story.50336079
ermoluk
peak 1 ยท 0 comments ยท 11% of case engagement
10-27 11:26our radar first saw it ยท lag ?discovery anchor: hn.story.50256991โ€”
pace: p50 vs 879 stories at the 720h mark (now 725h old) โ€” ahead of 1password-for-ai-agents (1.1x), behind blastloop-structure-first-coding-method (0.9x)

Evidence (4) โ€” โญ canonical anchor

sourceobjectauthorscorecomments
๐ŸŸง hnMCP-warden local credential broker so AI agents never see your secrets
Retrieved article excerpt

Open article ยท Retrieved 2026-10-27T11:28:01.957406+00:00

# mcp-warden

> A local-first credential broker for the Model Context Protocol โ€” lets any AI coding agent (Claude Code, Cursor, Cline, Codex, Continue, Zed) take real actions without ever seeing your secrets.

The agent calls high-level tools (`proxy_http`); `mcp-warden` injects the secret server-side, executes the action, and returns only the result. Your context window stays clean. A leaked transcript leaks nothing useful.

[ci](https://github.com/ermoluk/mcp-warden/actions/workflows/ci.yml)
[crates.io](https://crates.io/crates/mcp-warden)
[License: Apache-2.0](https://opensource.org/licenses/Apache-2.0)

[mcp-warden demo: the agent calls the GitHub API through a preset without seeing the token, a prompt-injected DELETE is refused before any request is sent, and an SSH deploy runs after approval in Telegram](https://github.com/ermoluk/mcp-warden/blob/main/docs/demo.gif)

## How it works

1. You store a credential once in the OS keychain via the `mcp-warden` CLI.
2. You define **presets** โ€” named, scoped actions (e.g. `github-read`, `stripe-charges`).
3. The AI agent connects to `mcp-warden` as an MCP server (stdio).
4. When the agent wants to act, it calls `proxy_http` with a preset name and a path/method.
5. `mcp-warden` validates the request against the preset's allow-list, injects the credential, executes, and returns only the response.
6. Sensitive presets trigger an approval prompt (desktop notification on Linux, TUI prompt on macOS/Windows). Opt in to **time-boxed approvals** per preset so one OK can cover a short burst of follow-up calls without re-prompt spam.
7. Every action lands in a local SQLite audit log โ€” including a `windowed` decision for calls authorised by an active approval window, and a `refused` decision (with the raw requested path or command) for calls the allow-list turned away.

The agent's context window contains zero secrets.

## Install

```
cargo install mcp-warden          # from crates.io
cargo install --path .            # or from a clone
```

Pre-built binaries for macOS (x86\_64, aarch64) and Linux (x86\_64), each with a SHA-256 checksum, are attached to every [GitHub release](https://github.com/ermoluk/mcp-warden/releases).

## 90-second quickstart

```
mcp-warden init
mcp-warden secret add gh_pat                  # paste your GitHub PAT when prompted
mcp-warden preset add github-read \
  --type http \
  --base-url https://api.github.com \
  --auth-bearer gh_pat \
  --allowed-methods GET \
  --allowed-paths /user/repos \
  --approval auto --confirm-auto
```

The preset auto-approves only `GET /user/repos`; any other path is refused before the token is touched. To let the agent read more, widen the allow-list (e.g. `--allowed-paths '/user/repos,/repos/OWNER/[^/]+'`) and prefer a fine-grained PAT limited to specific repos. Patterns match the whole path, as exact strings or regexes anchored as `^(?:โ€ฆ)$`, never as prefixes; `[^/]+` is safer than `.*` for one segment. They see the percent-decoded path, so `%2F` is a separator: a GitLab-style id like `/projects/group%2Fproject` needs `/projects/[^/]+/[^/]+`. An HTTP preset with no `allowed_paths` allows every path under `base_url` โ€” `preset add` and `doctor` warn about it, and the built-in `github-read` / `gitea-read` / `stripe-read` templates ship with `approval = "prompt"` for that reason.

Wire `mcp-warden` into your agent โ€” see [`docs/claude-code-setup.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/claude-code-setup.md) or [`docs/cursor-setup.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/cursor-setup.md).

In your agent: ask "list my GitHub repos via mcp-warden". Watch the agent call `list_presets`, then `proxy_http` โ€” and watch your PAT stay out of the prompt.

```
mcp-warden audit --last 5                     # see what the agent did
```

## CLI reference

| Command | Description |
| --- | --- |
| `mcp-warden init` | Create the config directory and a template config |
| `mcp-warden secret add <name>` | Store a secret (value read from stdin, never argv) |
| `mcp-warden secret list` | List secret names (never values) |
| `mcp-warden secret remove <name>` | Delete a secret from the keychain |
| `mcp-warden preset add <name> ...` | Define a preset (`--confirm-auto` required for `auto`) |
| `mcp-warden preset list` | Show all presets |
| `mcp-warden preset test <name>` | Validate a preset against the current keychain |
| `mcp-warden preset scaffold <template>` *(v0.3.0)* | Generate a preset from a built-in template (`--list` to discover) |
| `mcp-warden preset from-openapi <src>` *(v0.3.0)* | Bootstrap a preset from an OpenAPI 3.x spec (URL or file) |
| `mcp-warden approval <preset> <policy> [--window N]` | Set approval policy; `--window N` (sec) enables time-boxed approvals for `prompt` |
| `mcp-warden audit [--last N | --since T]` | Read-only view of the audit log (append-only by design), with what the agent asked for โ€” including refused calls |
| `mcp-warden doctor [--deep]` *(v0.3.0 for `--deep`)* | Diagnostic summary; `--deep` runs safe read-only HTTP probes per preset |
| `mcp-warden web [--port N]` *(v0.3.0)* | Local read-only web UI (binds 127.0.0.1 only) |
| `mcp-warden mcp` | Run the MCP server over stdio (consumed by the AI agent) |

## MCP tools exposed

- **`list_presets`** โ€” read-only catalogue of available actions.
- **`proxy_http`** โ€” execute an HTTP request through a preset; allow-list validation runs before credential injection.
- **`ssh_exec`** *(v0.2.0)* โ€” run a shell command on an SSH host; command must match preset's anchored regex allow-list; key-based auth + host-key verification.
- **`sftp_transfer`** *(v0.2.0)* โ€” get/put a file over SFTP; remote path matches preset's `sftp_allowed_paths`, local path under `$HOME` or `/tmp`.
- **`db_query`** *(v0.2.0)* โ€” run a NAMED QUERY against PostgreSQL / MySQL / Redis. SQL/command is fixed at preset definition; agent supplies only `query_name` + positional params.
- **`get_secret_for_env`** โ€” last-resort tool when a child process must read a secret from `env`. Always prompts for approval, regardless of preset policy.

## Claude Code plugin

For [Claude Code](https://claude.com/claude-code) there is a plugin that bundles the MCP server config, a skill that teaches Claude to use mcp-warden correctly (discover presets first, never ask for tokens, respect approvals, treat `get_secret_for_env` as a last resort) and a guided `/mcp-warden:setup` command. Install the binary first, then in Claude Code:

```
/plugin marketplace add ermoluk/mcp-warden
/plugin install mcp-warden@mcp-warden
```

Restart Claude Code and run `/mcp-warden:setup`. If you previously added the server with `claude mcp add`, remove that entry so it isn't registered twice. Details: [`plugins/mcp-warden/`](https://github.com/ermoluk/mcp-warden/blob/main/plugins/mcp-warden).

Other MCP clients: see [`docs/claude-code-setup.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/claude-code-setup.md) and [`docs/cursor-setup.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/cursor-setup.md) for manual setup.

## What's new in v0.4.0

- **Workspace split.** The project is now two crates: `mcp-warden-core` (library โ€” trait surfaces + shared types) and `mcp-warden` (binary โ€” CLI, MCP server, executor, web UI, concrete approval transports). Alternate implementations of `KeychainStore`, `ApprovalTransport`, `AuditSink`, or `PresetSource` now depend only on `mcp-warden-core` and don't drag the binary's GUI/runtime stack.
- **Telegram approval transport wired in.** The impl already existed in v0.3.0; v0.4.0 makes it actually selectable. Add to your config file (`mcp-warden doctor` prints its path: `~/.config/mcp-warden/` on Linux, `~/Library/Application Support/io.mcp-warden.mcp-warden/` on macOS):

  ```
  [approval.telegram]
  bot_token_secret = "tg_bot_token"   # name of the keychain entry, not the token value
  chat_id = 123456789                  # your numeric Telegram chat id
  timeout_seconds = 120                # optional
  ```

  then `mcp-warden secret add tg_bot_token` (pastes the bot token into the keychain). `prompt`-policy presets now send Approve / Deny inline-button messages to that chat; TUI is the fallback if the Telegram prompt times out (see [`docs/approval-transports.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/approval-transports.md)). Override at runtime with `MCP_WARDEN_APPROVAL_TRANSPORT={telegram|desktop|tui}`.

## What's new in v0.3.0

- **`preset scaffold`** โ€” 8 built-in templates for the most common APIs (`github-read`, `github-write`, `notion-read`, `stripe-read`, `openai-chat`, `anthropic-messages`, `gitea-read`, `cloudflare-dns`). Generate a working preset in one command instead of copy-pasting from the cookbook.
- **`preset from-openapi <url-or-file>`** โ€” point it at an OpenAPI 3.0/3.1 JSON or YAML spec and it derives `base_url`, `allowed_paths`, `allowed_methods`, and the auth scheme (Bearer or APIKey-Header). Filter by HTTP method or tag.
- **`doctor --deep`** โ€” for each HTTP preset, runs a safe read-only probe (GET against base URL or first literal allowed path), reports ok / auth\_failed / auth\_ok\_404 / network\_error / tls\_error / skipped, with elapsed time and a redacted body snippet. Skips `prompt`-policy presets unless `--include-prompt` is passed.
- **`web`** โ€” a small local-only web UI (binds `127.0.0.1`, hardcoded) for browsing presets and the audit log without spawning a TUI. Read-only in this release; approval over WebSocket is on the roadmap.
- **Telegram approval transport** โ€” new `ApprovalTransport` impl that sends approval prompts to a Telegram chat with inline Approve / Deny / Approve-for-window buttons. Bot token lives in the OS keychain. Foreign-chat callbacks are rejected. Message uses `protect_content: true`. The wiring (selecting Telegram over Desktop / TUI in `cli/mcp.rs`) is a small follow-up; the impl + tests are merged.

See `docs/web-ui.md` for the web UI design notes.

## Security model

`mcp-warden`'s threat model and security invariants live in [`docs/threat-model.md`](https://github.com/ermoluk/mcp-warden/blob/main/docs/threat-model.md). At a glance:

- Secrets in the OS keychain only โ€” never on disk in plaintext, never in logs.
- Allow-list validation runs **before** credential injection.
- Default approval policy is `prompt`; `auto` requires `--confirm-auto` at preset creation.
- Audit log is append-only โ€” the trait surface itself contains no `delete` / `clear` method.
- Stdout is the MCP protocol channel; all logs go to stderr.

## Links

- crates.io: [`mcp-warden`](https://crates.io/crates/mcp-warden)
- MCP Registry name: `mcp-name: io.github.ermoluk/mcp-warden`

## License

Apache-2.0 โ€” permanent commitment for the OSS core. See [LICENSE](https://github.com/ermoluk/mcp-warden/blob/main/LICENSE).

mcp-warden stays fully functional for free, forever โ€” see our [open-core commitment](https://github.com/ermoluk/mcp-warden/blob/main/docs/open-core.md).
ermoluk10
๐ŸŸง echo.github โญA local-first MCP credential broker stores secrets in the OS keychain, validates requests against scoped presets before injecting credentialermolukโ€”โ€”
๐ŸŸง hnMCP-warden AI agents use your API keys without seeing themermoluk10
๐ŸŸ  redditI asked Claude Code to break the tool that hides my secrets from Claude Code
ClaudeAI
Relevant_Mousse_911749

Interpretation history

Decision trace