vaultguard

io.github.ashishrao-4由 GitHub 账号 ashishrao-4 发布v0.1.2更新于 Oct 24, 2026

AI agents use your Obsidian secrets by name — values never reach their context.

概览

AI 生成的概览

让 AI 助手在运行命令时使用 Obsidian 保险库中的密钥,密钥值以环境变量注入,不会进入对话内容。

可以做什么
Vaultguard 是一个本地 stdio MCP 服务器,读取以 markdown 形式存放在 Obsidian 保险库中的 AES-256-GCM 加密密钥块。主要工具 run_with_secret 会把指定名称的密钥注入命令的环境变量,并把输出中意外出现的密钥值替换为 [REDACTED:NAME]。另有 get_secret 工具,但默认关闭,使原始值不会到达助手。每次调用都会写入审计日志,还可选配置主机与命令白名单来限制可执行内容。
适用场景
当你希望助手运行需要凭据的命令(例如数据库连接串),又不想把值粘贴进对话、留在记录、日志或检查点中时,适合使用。它面向已经在 Obsidian 中记笔记、并接受助手等同于本人操作的用户。
运行要求
本地需 Node.js 18 或更高版本,通过 npx 或 npm 安装 @ashishrao-4/vaultguard。需要 Obsidian 保险库路径,以及用于解密密钥块的通行短语,通过环境变量 VAULTGUARD_PASSPHRASE 提供。可选变量:VAULTGUARD_VAULT_PATH、VAULTGUARD_HOME、VAULTGUARD_ALLOW_GET_SECRET。无需云服务或账号。
安装前请注意
通行短语是全部密钥的钥匙,一旦丢失密钥块无法恢复;以你的身份运行的任何进程都能解密保险库。run_with_secret 默认需要审批,get_secret 默认关闭(除非设置 VAULTGUARD_ALLOW_GET_SECRET),建议保持这些默认值。恶意助手仍可通过正常渠道外传密钥值,且 vaultguard init 会从 GitHub releases 下载 Obsidian 插件,存在供应链风险。它是便利层,而非完整的密钥管理系统。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[vaultguard]
🔐 vaultguard
Your Obsidian vault, guarded for your AI agents.

npx @ashishrao-4/vaultguard init · zero dependencies · pure Node · cross-platform


The problem

Your AI agents are powerful. They ship code, run commands, and one day they will ask: "give me the database URL."

You hand it over. Now that value lives in every transcript, log, checkpoint, and backup of your conversations. Rotate it a month later — a year later — and the old one is still out there.

The vault itself — Obsidian — is encrypted only if you make it so, and your agent reading your notes means your agent reading your secrets.

What vaultguard does

Secrets live in your Obsidian vault as AES-256-GCM ciphertext. Your agents get them by name over MCP — they run commands with the values injected into the environment and never see them, while every access is audited.

[vaultguard architecture]
The simple version: your agent asks by name, vaultguard decrypts on demand, the value stays out of the conversation.

  • You own the data. No cloud, no SaaS, no server. The encrypted blocks are plain markdown.
  • Readable in Obsidian. Encrypted blocks look like notes; reveal them with one click.
  • Tell your agent to run things using secrets — values never surface in transcripts.
  • Zero npm dependencies. Pure Node ≥ 18. Windows / macOS / Linux.

Quickstart

1 · Install

bash
npm install -g @ashishrao-4/vaultguard

2 · Point it at your vault

bash
vaultguard init --vault "C:\Users\you\Documents\Obsidian Vault"

It asks for a passphrase — the key that encrypts and decrypts every block in this vault. Then it:

  • creates Secrets.md in your vault,
  • installs the Inline Secret Block plugin into the vault automatically,
  • writes ~/.vaultguard/config.json — without the passphrase (you provide it via VAULTGUARD_PASSPHRASE).

Restart Obsidian and enable the plugin: Settings → Community plugins → Inline Secret Block → Enable.

The passphrase is never written to disk by default. Prefer env vars: VAULTGUARD_PASSPHRASE (or DOORMAN_PASSPHRASE). If you want it conveniently stored anyway — at the cost of weaker security — run vaultguard init --store-passphrase instead (see Threat model).

3 · Add your first secret — the Obsidian way

In Obsidian, open Secrets.md and add a plaintext block:

markdown
```secret DATABASE-URLMydatabaseurl@postgres```

Click Show — the plugin instantly replaces it with an encrypted secret-lock block. Your raw value is gone; what remains:

markdown
```secret-lock DATABASE-URLNx60U4Ph/+1CO+58Zr00HXhEW9GZ6voHlpS+bEXPpP69avbJaSfafZCC2dpPn6UgdMN+3PJUd+UPm39YAXhFTbHvLUpHDndzbODsL8fOm7IMWC16zjSQCW7CbRWklmUxOGl0lX2qpQ==```

That's it. Same value, later, forever: click Show again.

No Obsidian? Use the CLI instead:

bash
vaultguard add DB_URL     # hidden promptvaultguard set DB_URL     # rotate in place

4 · Connect your agent

bash
vaultguard mcp

prints ready-made config for your harness:

opencode — in opencode.json (or globally via the app):

json
{  "mcp": {    "vaultguard": {      "type": "local",      "command": ["node", "C:/path/to/vaultguard/src/server.mjs"],      "environment": { "VAULTGUARD_PASSPHRASE": "your-passphrase" }    }  }}

Claude Code:

bash
claude mcp add vaultguard -e VAULTGUARD_PASSPHRASE=your-passphrase -- node C:/path/to/vaultguard/src/server.mjs

Cursor: add the same server to your project's .cursor/mcp.json (or the MCP settings tab):

json
{  "mcpServers": {    "vaultguard": {      "command": "node",      "args": ["C:/path/to/vaultguard/src/server.mjs"],      "env": { "VAULTGUARD_PASSPHRASE": "your-passphrase" }    }  }}

5 · Use it

text
you : "run a quick sanity check against DB_URL"agent: run_with_secret(command: "psql $DB_URL -c 'SELECT 1'", secrets: ["DB_URL"])you :  ✔ exit 0  ·  audit entry written  ·  no secret leaked
  • run_with_secret — secrets injected into the command's environment only.
  • Output is scrubbed — any accidental echo of a secret is replaced with [REDACTED:NAME].
  • get_secret — disabled by default so values never reach the agent; opt in with allowGetSecret: true in the config if a tool insists on the raw value.

Security model

LayerWhat stops it
At restAES-256-GCM, PBKDF2-SHA-256 (250,000 iterations, 16-byte salt, fresh 12-byte IV per value). Byte-compatible with the Inline Secret Block plugin.
Approval gaterun_with_secret is denied by default unless you set requireApproval: false (or VAULTGUARD_REQUIRE_APPROVAL=0).
Secret access gateget_secret is disabled by default — values never reach the agent; enable only via allowGetSecret: true. The intended path is run_with_secret (env injection, values never seen).
Host allowlistOnly named clients (from MCP clientInfo) may call tools. Empty list = allow all.
Command allowlistOnly command prefixes you list may run (e.g. ["psql", "node", "git"]). Empty = allow all.
Audit logEvery call — who (host), what, which secrets, outcome — appended to ~/.vaultguard/audit.jsonl. View with vaultguard audit.
Output scrubbingSecret values and their first 8 chars are redacted from command output.

Configuration

Edit ~/.vaultguard/config.json:

jsonc
{  "vaultPath": "C:/Users/you/Documents/Obsidian Vault",  // passphrase is NOT stored here by default — provide VAULTGUARD_PASSPHRASE instead  "allowlist": { "hosts": [], "commands": ["psql", "node"] },  "requireApproval": false,          // true (default) = gate run_with_secret  "audit": true,  "allowGetSecret": false            // false (default) = values never reach the agent}

The only way the passphrase lands in this file is vaultguard init --store-passphrase, which sets "storePassphraseOnDisk": true and includes "passphrase". Everything else reads the passphrase from the VAULTGUARD_PASSPHRASE env var or the CLI prompt.

Env varOverrides
VAULTGUARD_VAULT_PATH / VAULT_PATHvault path
VAULTGUARD_PASSPHRASE / DOORMAN_PASSPHRASEpassphrase
VAULTGUARD_HOMEconfig dir (default ~/.vaultguard)
VAULTGUARD_REQUIRE_APPROVAL=0auto-approve
VAULTGUARD_AUDIT=0disable audit
VAULTGUARD_ALLOW_GET_SECRET=1enable get_secret (default: off)

Passphrase hygiene: vaultguard never writes the passphrase to disk unless you opt in (init --store-passphrase). Supply VAULTGUARD_PASSPHRASE in each harness config (see step 4) and protect ~/.vaultguard like an SSH key. Changed passphrase? vaultguard rekey re-encrypts every block, then update the env var wherever you set it.


CLI reference

CommandWhat it does
vaultguard initConfigure vault + passphrase, create Secrets.md, install plugin
vaultguard add <NAME>Encrypt + store a new secret (interactive or --value)
vaultguard set <NAME>Rotate a secret in place
vaultguard rekeyRe-encrypt every block with a new passphrase (interactive, or --old-passphrase/--new-passphrase)
vaultguard listList secret names (no values)
vaultguard audit [--lines n]Tail the audit log
vaultguard mcpPrint harness-specific MCP config
vaultguard infoShow config + security posture
vaultguard testCrypto self-test

Threat model — and when NOT to use it

vaultguard is a thin convenience layer, not a secrets manager. Its job is to keep secret values out of your AI-agent transcripts, logs, and checkpoints.

What it does NOT protect against:

  • A compromised machine or harness. The passphrase (or an opted-in stored config) lives on your disk. Any process running as you — a backup tool, ransomware, a compromised plugin, your IDE — can read your files and decrypt the vault.
  • A hostile agent. The entire idea is that the agent runs commands with secrets in the environment. Treat that as "the agent is you." Start with command allowlists and review vaultguard audit; don't grant access you wouldn't grant yourself.
  • Weak passphrases. AES-256-GCM + PBKDF2 is only as strong as the passphrase. Use a long random one (your password manager can generate and store it).
  • Exfiltration through legitimate channels. A determined agent can copy ciphertext or raw values anywhere that's reachable. vaultguard is a barrier, not a boundary.
  • Plugin supply chain. vaultguard init downloads the Inline Secret Block plugin from its GitHub releases. A malicious plugin that knows your passphrase can decrypt everything — pin/verify it if you care.

Use it when: you want "agents run things with secrets without me pasting values into the chat" and the residual risks above are acceptable to you.

Don't use it when: you need real secrets-management guarantees — rotation policy, hardware-backed keys, no procedure that makes plaintext reachable to a native plugin — when your threat model includes a hostile agent on a shared or CI machine, or when the vault itself needs encryption at rest (Obsidian's own vault encryption, or an encrypted volume, is the answer there).


FAQ

Is my vault git-safe? The encrypted blocks are plain markdown — safe to commit, sync, or put anywhere Obsidian works. Since the passphrase no longer lives in ~/.vaultguard/config.json by default, committing that file leaks your vault path and settings but not your key.

What if I forget the passphrase? The blocks are AES-256-GCM. It cannot be recovered — that's the point.

Which Obsidian plugin? Inline Secret Block — vaultguard init installs it for you.

Do I need a server? No. It's a local stdio MCP server (node src/server.mjs). Nothing listens on a port.


License

MIT © vaultguard contributors.

The bundle installs the Inline Secret Block plugin (also MIT), downloaded at init time from the plugin's official releases — it is not vendored into this package. This project uses Node.js built-ins only (crypto), so there are no dependency licenses to track.


Guard your vault. Let your agents work.

来源:README.md,提交 39e6bd9

工具

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

版本历史

1
  1. v0.1.2最新Sep 18, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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