keyward

io.github.arturayupov由 GitHub 账号 arturayupov 发布v0.1.1更新于 Oct 24, 2026

Local encrypted secret broker for AI agents: request keys by name, approve each use over MCP.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

本地加密密钥代理:AI 代理可按名称申请 API 密钥,每次使用需在系统原生弹窗中批准,模型始终看不到密钥值。

可以做什么
  • 列出已保存的密钥名称与命名空间,不返回密钥值
  • 按项目申请指定密钥,批准后将其注入目标 env 文件
  • 在本地审计日志中记录每次请求与批准决定
  • 通过配套 CLI 在代理之外管理保险库:初始化、从 .env 文件导入、添加或列出密钥、注入单个密钥
适用场景
适合为编码代理保管 API 密钥、希望避免把密钥粘贴进对话或在新会话、项目、IDE 中反复输入,同时保留逐次人工批准和本地加密存储的场景。
运行要求
需本地安装二进制(Homebrew、Scoop、go install 或发布包),以 stdio MCP 服务器方式通过 command 与 args 注册到客户端。需要操作系统密钥库(macOS Keychain、Windows 凭据管理器或 Linux libsecret),并先用 CLI 创建保险库。仅限桌面,无远程端点。
安装前请注意
它保管真实 API 密钥:保险库以 age 加密,主密钥存于系统密钥库,需保护好该密钥库。批准的请求会把密钥写入磁盘上的目标 env 文件。批准弹窗失败即拒绝,出错或取消均视为拒绝。审计日志记录密钥名、命名空间与目标,但不记录密钥值。

安装

在 SourceWeft 中

  1. 打开 控制台中的 keyward,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[keyward — a secret broker for AI agents]

keyward

Store your API keys once. Let any AI tool request them with your approval — without ever seeing the value.

[CI] [MIT] [MCP compatible] [cross platform]


keyward is an open-source, local, encrypted secret broker for AI coding agents. Instead of pasting API keys into chat (where they leak into context and transcripts) or re-entering the same key in every new session, project, and IDE, you keep your keys in one encrypted vault. When Claude Code, Cursor, Gemini CLI, or any MCP-capable tool needs a key, it requests it by name, you approve that single request in a native OS prompt, and keyward injects only that key into your project. The model never receives the value.

The problem

  1. Leaking keys into AI chat — paste a key into a prompt and it lands in context, transcripts, and logs.
  2. Re-entry tax — you type the same key again in every new session, project, IDE, and machine.
  3. Scattered .env files — no single source of truth; you forget which key lives where.
  4. Zero control — an agent can read or grab every secret at once instead of the one it needs.
  5. Tool lock-in friction — switch IDE or model and you redo all key setup.

How it works

AI tool ──request_key("STRIPE_KEY", project)──▶ keyward ──native approval──▶ you                                                    │ approved        ◀── "injected STRIPE_KEY → ./.env" ─────────┘   (value never shown to the model)
  • Vault — an age-encrypted file (~/.keyward/vault.age, 0600). The master key lives in the OS keystore (macOS Keychain / Windows Credential Manager / Linux libsecret), never on disk in plaintext.
  • Two faces — an MCP server (list_keys, request_key) for AI tools, and a keyward CLI for everything else.
  • Out-of-band approval — the approval dialog is fired by keyward itself, not rendered in the agent's stream, so the agent cannot auto-approve. Choose Approve once, Approve for session, or Deny.
  • Value-free by construction — list_keys returns names only; request_key returns a confirmation; the audit log records the decision but never the value.

Install

bash
# Homebrew (macOS / Linux)brew install arturayupov/tap/keyward
# Scoop (Windows)scoop bucket add arturayupov https://github.com/arturayupov/scoop-bucketscoop install keyward
# Gogo install github.com/arturayupov/keyward/cmd/keyward@latest

Pre-built binaries (macOS/Windows/Linux, amd64+arm64) are also attached to each release. See INSTALL.md for per-OS notes (incl. Linux libsecret) and TROUBLESHOOTING.md if something doesn't work.

Quickstart

bash
# 1. create the encrypted vault (master key goes into your OS keystore)keyward init
# 2. import keys you already have scattered in .env fileskeyward import ~/projects
# 3. point your AI tool at keyward's MCP server (see below), then just ask:#    "use my STRIPE_KEY for this project" → approve the prompt → done

Use it as an MCP server

keyward is a standard stdio MCP server, registered the same way as the official MCP servers. Two steps:

1. Install the binary (once) — go install above, or Homebrew/Scoop (soon), or a release binary.

2. Register it with your AI tool:

bash
# Claude Code — one command:claude mcp add keyward -- keyward serve-mcp

Or add it to the config by hand (~/.claude.json, or a project .mcp.json):

json
{ "mcpServers": { "keyward": { "command": "keyward", "args": ["serve-mcp"] } } }

Cursor, Windsurf, Cline, and other MCP clients use the same command/args shape in their MCP settings. Restart the tool and ask it to use a key by name.

Why not "paste a repo URL"? No MCP client auto-installs a server from a GitHub link — by design, clients won't run arbitrary remote code. keyward is also intentionally local (it needs your OS keystore and writes to your local files), so it isn't a remote/hosted URL server. The two steps above are the standard, secure install path. Full walkthrough in USAGE.md.

CLI reference

CommandDescription
keyward initCreate the encrypted vault and master key
keyward import [root]Import secrets from .env files under root, grouped by project
keyward add NAME --ns NSAdd/update one secret, value read from stdin (for non-.env creds)
keyward ls [--ns NS]List key names and namespaces (never values)
keyward inject NAME --ns NS --into PATHInject one key into a target env file (prompts for approval)
keyward serve-mcpRun the MCP server over stdio

Security model

  • The secret value is never returned to the AI agent — request_key injects it into a target file and returns only a confirmation.
  • The value is never written to the audit log (~/.keyward/audit.jsonl records tool, key, namespace, target, decision — no value) and never printed by ls/inject.
  • Approval is out-of-band: a native OS dialog the agent cannot click. All dialog backends fail closed — any error or cancellation is a Deny.
  • The vault is encrypted at rest with age; the master key lives in the OS keystore.

These invariants are enforced by automated tests. Details and threat model in SECURITY.md.

How it compares

keywardenvchainpass / sops1Password CLI
Encrypted local store✅✅ (Keychain)✅✅ (cloud)
Agent requests a key by name✅❌❌❌
Per-request human approval✅❌❌❌
Value never reaches the model✅n/an/an/a
MCP server for AI tools✅❌❌❌
Open source✅ (MIT)✅✅❌

The encrypted-storage problem is solved; keyward adds the missing agent-facing, approval-gated broker on top. See docs/comparisons for honest long-form comparisons (including when each alternative is the better choice).

Roadmap

Full detail in ROADMAP.md. Highlights:

  • v0.2 — signed/notarized binaries (no keystore prompt), Homebrew/Scoop, biometric approval (Touch ID / Windows Hello), Windows ACL hardening.
  • v1.0 — tray/menubar app, per-key policy & allowlists, rotation reminders, target: "env" injection.
  • v2.0 — encrypted multi-device sync (user-owned backend), team mode.

Contributing

Contributions welcome — see CONTRIBUTING.md. Found a security issue? See SECURITY.md for responsible disclosure.

License

MIT © 2026 Artur Ayupov

来源:README.md,提交 8877a0d

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分