enclave

io.github.AVGVSTVS96由 GitHub 账号 AVGVSTVS96 发布v0.2.13更新于 Nov 7, 2026

Your agent asks for a password by one-time link, not in chat, and uses it without seeing it.

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

概览

AI 生成的概览

让助手通过一次性链接向用户索取密码、API 密钥、2FA 码和通行密钥,并在不看到明文的情况下使用它们。

可以做什么
  • 索取密钥:生成一次性链接,让用户在浏览器里填写密码或密钥而不是在对话中,然后等待其保存进本地保险库。
  • 查看保险库:列出已保存条目的名称和字段名(不含值),可按名称或网站筛选。
  • 使用密钥:在环境变量中注入保险库密钥运行命令,输出中这些值会被遮蔽,并可读取 totp 字段的当前 2FA 码。
  • 通行密钥登录:为一次登录启用已保存的通行密钥,五分钟内有效,随后由助手点击网站的通行密钥登录。
适用场景
适合助手需要凭据才能完成任务、而你希望这些凭据不进入聊天记录和工具结果的场景,例如登录某个服务、用密钥调用 API 或提供 2FA 码。适用于与保险库运行在同一台机器上的桌面端和编码类助手。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js;默认使用托管中继,因此无需账号或密钥。可选环境变量:ENCLAVE_FROM(页面上显示的索取者名称)、ENCLAVE_HOME(保险库位置,默认 ~/.enclave)、ENCLAVE_RELAY(自建中继地址)。通行密钥登录需在 Linux 上安装该项目的 Chrome 扩展,工具超时较短的客户端需调高超时以等待。
安装前请注意
保险库的密钥文件可解锁所有已存条目,应像 SSH 私钥一样保管。中继方负责下发加密输入内容的页面,若中继被接管可能被篡改,自建中继可避免这一信任。任何拿到链接的人都能抢先作答,链接也可冒充索取者,因此只回应你预期的请求。同一台机器上有 shell 权限的助手仍可能读取自己的保险库,此工具防的是意外泄露而非蓄意窥探。密钥默认写入磁盘。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[enclave]

Your AI agent needs your Netflix password. Instead of asking in chat, it sends you a link. You type the password (or your password manager fills it) and tap Send. It's locked in your browser before it leaves, so only your agent can open it. The agent keeps it in a vault of its own, next to 2FA codes and passkeys, and uses it later without seeing it.

[The enclave page in the ledger theme: hex is asking for Netflix, with email and password fields, a Send to hex button, and a ledger showing who holds the secret] [The same page in the field theme, on a full blue background]

hex   I need your Netflix login to finish this: https://moonlit-lynx-37.convex.site/k3Jd8vQ2…you   open it, type, tap Sendhex   saved Netflix: email, password

It works out of the box with a hosted relay. No accounts, no keys to set up, nothing for the person to install.

Set up your agent

Agents with a shell (Claude Code, Codex, Cursor, Gemini CLI, OpenCode and 30 more) get it as a skill:

sh
npx skills add AVGVSTVS96/enclave

It runs enclave with npx, so there's nothing else to install.

Agents that use MCP get the same thing as tools. Add the server below, and add this line to the agent's instructions, because tools alone don't stop a model from asking in chat:

When you need a password, API key or other secret, ask for it with the enclave tools rather than in chat.

Claude Code
sh
/plugin marketplace add AVGVSTVS96/enclave/plugin install enclave@enclave

Or as MCP tools:

sh
claude mcp add enclave -- npx -y enclave-link mcp
Codex
sh
codex mcp add enclave -- npx -y enclave-link mcp

Codex stops a tool after 60 seconds by default, and wait_for_secret can wait 25 minutes, so add this under [mcp_servers.enclave] in ~/.codex/config.toml:

toml
tool_timeout_sec = 1800
Cursor, Claude Desktop, Windsurf, Cline, Roo Code, Kiro, Junie, Factory

They all take the same JSON:

json
{  "mcpServers": {    "enclave": { "command": "npx", "args": ["-y", "enclave-link", "mcp"] }  }}
AppWhere it goes
Cursor~/.cursor/mcp.json, or .cursor/mcp.json in a project
Claude DesktopSettings → Developer → Edit Config
Windsurf~/.codeium/windsurf/mcp_config.json
ClineMCP Servers → Configure MCP Servers
Roo Code.roo/mcp.json
Kiro~/.kiro/settings/mcp.json
JetBrains Junie~/.junie/mcp/mcp.json
Factory~/.factory/mcp.json
VS Code and GitHub Copilot

.vscode/mcp.json:

json
{  "servers": {    "enclave": { "type": "stdio", "command": "npx", "args": ["-y", "enclave-link", "mcp"] }  }}
Gemini CLI
sh
gemini extensions install https://github.com/AVGVSTVS96/enclave
Grok Build
sh
grok mcp add enclave -- npx -y enclave-link mcp
OpenCode

opencode.json:

json
{  "mcp": {    "enclave": { "type": "local", "command": ["npx", "-y", "enclave-link", "mcp"] }  }}
Zed

In Zed's settings.json:

json
{  "context_servers": {    "enclave": { "command": "npx", "args": ["-y", "enclave-link", "mcp"], "env": {} }  }}
OpenClaw, Hermes and other chat assistants

Assistants that talk to you through Telegram, Discord or WhatsApp should use the skill (npx skills add AVGVSTVS96/enclave), so the link reaches you in the chat. For MCP instead:

sh
openclaw mcp add enclave --command npx --arg -y --arg enclave-link --arg mcp

Hermes, in ~/.hermes/config.yaml:

yaml
mcp_servers:  enclave:    command: npx    args: ["-y", "enclave-link", "mcp"]    timeout: 1800
Goose

Run goose configure, choose Add Extension → Command-line Extension, enter npx -y enclave-link mcp, and set the timeout to 1800 seconds.

ChatGPT, Claude.ai and the Gemini and Grok apps can't use enclave yet: they run in the cloud, and the vault lives on the computer where the agent runs. Their desktop and coding-agent versions above work.

Your own code can use the TypeScript SDK; see SDK.

How it works

agent                          relay (Convex)                   person's browser─────                          ──────────────                   ────────────────makes a one-time key pairenclave ask ─── open ──────────▶  stores an empty request         ◀── link ───────────sends https://…/<id>#key=…  ──────────────────────────────────▶ opens the link                                                                 reads the key after #                                                                 (browsers never send it)                                                                 encrypts the answer                               stores encrypted bytes ◀───────── POST, onceenclave wait ◀── live update ───decrypts, saves to its vaultdeletes the request ────────▶  gone
  • The relay can't read anything. The key it would need never leaves the agent's computer. The public key travels in the part of the link after #, which browsers don't send to servers, so the relay doesn't even learn what was asked for.
  • Links work once and expire. The first answer wins, and the request is deleted as soon as the agent picks it up, or after 24 hours.
  • No polling. enclave wait holds a live Convex subscription and wakes up the moment the answer lands.

Using a secret without seeing it

sh
enclave run KEY="OpenAI API key/key" sh -c 'curl -s https://api.openai.com/v1/models -H "Authorization: Bearer $KEY"'

run works like env, except the values come from the vault, and anywhere one shows up in the command's output it's replaced with [hidden KEY]. Quote the command so your own shell doesn't expand $KEY first.

To type a password into a login form, pipe it straight into whatever does the typing: enclave get Netflix password | <typer>. A field named totp holds a 2FA setup key, and enclave get GitHub totp gives its current 6-digit code.

Passkeys

A field named passkey holds a passkey, and the agent signs in with it in Chrome without ever seeing its key:

sh
enclave passkey GitHub    # then click the site's passkey sign-in

enclave passkey arms the passkey for one sign-in, for up to 5 minutes. When the site asks for a passkey, enclave's Chrome extension hands the request to enclave sign, which signs it inside the vault and disarms the passkey. The private key never leaves the vault: enclave get and enclave run refuse passkey fields.

A passkey keeps working in Proton Pass and enclave side by side.

Install the extension once per machine, with Google Chrome on Linux, from a clone of this repo at the release the vault runs. Every release is tagged v<version>. It's force-installed through Chrome's policy, so it loads in every profile:

sh
git clone https://github.com/AVGVSTVS96/enclave && cd enclavegit checkout "v$(enclave --version)"extension/install                   # signs with that release on this machine, through npx

or with a vault on another machine:

sh
git checkout "v$(ssh my-server enclave --version)"extension/install ssh my-server enclave sign

Bring your Proton Pass vault

sh
enclave import proton            # every vaultenclave import proton Work       # or just the ones you name

copies Proton Pass in through pass-cli: logins, 2FA, passkeys, notes, cards, SSH keys and custom fields, one item per Proton item, named by its title. Proton keeps everything. Run it again to bring in what changed: names stay the same, renames follow, items deleted in Proton leave enclave too, and anything you saved yourself is kept. A value you save over one of Proton's stays until that field changes in Proton.

2FA comes in as a totp field, so enclave get <name> totp gives the current code, and passkeys as a passkey field.

CLI

sh
npm install -g enclave-link      # or run any of these with npx -y enclave-link
CommandDoes
enclave ask <name> [field…]Prints a link asking for <name>. Fields default to password.
enclave wait <name>Waits for the answer and saves it. Exits 1 if the link expires first.
enclave run VAR=<name>/<field>… <command…>Runs a command with secrets in its environment, hidden in its output.
enclave get <name> <field>Prints a saved value, for a pipe or $(…).
enclave save <name> <field>Saves a value piped in, like a token the agent just made, without it passing through the chat.
enclave passkey <name> [field]Arms a saved passkey for the next sign-in on its site, through the extension.
enclave signSigns a passkey request (JSON on stdin) with an armed passkey. The extension runs it.
enclave import proton [vault…]Copies Proton Pass in through pass-cli: every vault, or the ones named.
enclave list [search]Saved names and their fields, never values. A search matches names and websites.
enclave rm <name>Deletes a saved item.
enclave mcpServes the tools below over MCP (stdio).

ENCLAVE_FROM sets the name the page shows ("hex is asking for…"), ENCLAVE_HOME sets where the vault lives (~/.enclave), and ENCLAVE_RELAY points at your own relay.

MCP tools

ToolDoes
request_secretMakes the link. If the client supports URL elicitation, it offers to open the link for the person right there; otherwise it gives the agent the link to send.
wait_for_secretReturns the moment the person taps Send, with the field names it saved.
run_with_secretsRuns a command with secrets in its environment and hides them in the output.
sign_in_with_passkeyArms a saved passkey for the next sign-in on its site, then returns so the agent can click sign in.
list_secretsNames and fields, never values, optionally only those matching a name or website.

There's no tool that returns a secret's value.

SDK

ts
import { vault } from "enclave-link"
const { url, wait } = await vault.ask("Netflix", ["email", "password"])// send url to the personawait wait()
await vault.run(["sh", "-c", 'curl -u "$EMAIL:$PASSWORD" https://example.com'], {  EMAIL: "Netflix/email",  PASSWORD: "Netflix/password",})

vault reads ENCLAVE_FROM, ENCLAVE_HOME and ENCLAVE_RELAY. For anything else, openVault({ from, home, relay, store }) makes one of your own. It also has get, list and remove, the same as the CLI.

Answers are saved to ~/.enclave by default. To keep them somewhere else, pass a store: any object with get, put, remove and names, like your own database. For a one-time answer that's never written to disk, keep it in memory:

ts
const answers = new Map()const oneTime = openVault({  store: {    get: async (name) => answers.get(name),    put: async (name, item) => void answers.set(name, item),    remove: async (name) => void answers.delete(name),    names: async () => [...answers.keys()],  },})

Security

The encryption is HPKE (RFC 9180) with X25519, HKDF-SHA256 and AES-128-GCM, built on the browser's own Web Crypto with no libraries, and tested against the RFC's test vectors. Answers are padded, so the relay can't even tell how long a password is.

The vault keeps each item encrypted in ~/.enclave/items, sealed to the vault's own key in ~/.enclave/key.json and bound to the item's name. The item files are safe to back up anywhere. The key is what unlocks them, so treat it like an SSH key.

What enclave can't protect against:

  • Whoever runs the relay sends you the page. Your browser downloads the page, including the code that locks your password, from the relay each time you open a link. What the relay stores can't be read, but if someone took over the relay's Convex account, they could change the page to copy what you type before locking it. The page's script is 128 lines in page/page.ts plus the encryption in src/hpke.ts, served as one file with a strict Content Security Policy, so you can read exactly what it runs. If you'd rather trust nobody's relay, host your own.
  • Anyone with the link can answer it first. They still can't read anything, but they could send a fake answer. If that happens, the page says "This link doesn't work anymore" when you open it.
  • Phishing. A link can say anyone is asking. Only send secrets to agents you asked for help.
  • An agent that wants to see a secret can. enclave keeps secrets out of the chat and out of tool results, and run hides their exact values in output. But an agent with a shell on the same computer could still read its own vault. enclave stops secrets from leaking by accident, not a model that's trying.

Host your own

The relay is a Convex app, so self-hosting is a few commands, on Convex's cloud or the open-source Convex backend:

sh
git clone https://github.com/AVGVSTVS96/enclave && cd enclavenpm installnpm run dev -- --once    # sign in to Convex and create your projectnpm run deploy

Then point agents at it with ENCLAVE_RELAY=https://<your-deployment>.convex.cloud.

Themes

The page comes in two themes, both following the system's light or dark mode:

  • ledger (the default): calm and white. A highlighter marks what's readable, and a small ledger shows who holds the secret: you, the relay, or your agent.
  • field: the whole screen is one color. After you send, a track shows where it went, and a used link turns gray.

Pick one, and optionally one color, when you deploy:

sh
ENCLAVE_THEME=field ENCLAVE_COLOR=#ff4a2e npm run deploy

ENCLAVE_COLOR is ledger's highlight or field's background, and text on it switches between white and ink to stay readable. To make your own theme, copy page/themes/ledger.css and point ENCLAVE_THEME at your file. A theme is plain CSS over the page's fixed markup, and any fonts or images it links to get built into the page, which loads nothing from anywhere else.

Develop

sh
npm run dev      # builds the page and runs a Convex dev deploymentnpm run check    # typecheck and testsnpm run build    # bundles the CLI, SDK and types into dist/npm version 0.3.0  # a release: sets every version, commits and makes the signed tag v0.3.0
PathWhat's there
convex/The relay: requests, rate limits and two HTTP routes, in 154 lines
page/The page people see and its two themes, built into one HTML file by scripts/page.ts
src/hpke.tsThe encryption, shared by the page and the agent
src/vault.tsask, wait, get, run and the rest of the SDK
src/mcp.tsThe MCP server
src/passkey.tsSigning a passkey sign-in
extension/The Chrome extension that sends passkey requests to enclave sign
src/proton.tsReading a Proton Pass vault, passkeys included
skills/enclave/The Agent Skill

License

MIT

来源:README.md,提交 fac1e03

工具

5

request_secret

Ask for a secret

Use this whenever you need a password, API key, 2FA key or other secret from the person, instead of asking in chat. It returns a one-time link; what they type there is locked in their browser for this vault. Then call wait_for_secret.

输入参数name必填fields

wait_for_secret

Wait for a secret

Wait until the person sends the secret from request_secret, then save it to the vault. It returns the moment they tap Send. After 25 minutes it returns so you can call it again, and the link stays open for 24 hours.

输入参数name必填

run_with_secrets

Run a command with secrets

Run a program with saved secrets in its environment. Their values are replaced with [hidden VAR] in the output, so you can use a secret without seeing it. A "totp" field gives its current 2FA code. Example: {"command": ["sh", "-c", "curl -H \"Authorization: Bearer $KEY\" https://api.example.com/me"], "secrets": {"KEY": "Example/api key"}}

输入参数command必填secrets必填

sign_in_with_passkey

Sign in with a passkey

Let the browser sign in once with a saved passkey, in the next 5 minutes. Call it, then click the site's passkey sign-in: enclave's browser extension asks the vault to sign, and the passkey's key stays in the vault.

输入参数name必填field

list_secrets

List saved secrets

List what's saved in the vault: names and their fields, not their values. Check here before asking the person for something.

输入参数search

版本历史

2
  1. v0.2.13最新Nov 4, 2026
  2. v0.2.6Nov 3, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分