Skip to main content
J

dsh-passbook

jsdvjx/dsh-passbook

密码本 for the DeepSeek Harness: an end-to-end encrypted personal secrets book on a private gist (age format, node:crypto only), with a browser page for people and value-free tools for the agent.

Install

dsh plugin --profile web add github:jsdvjx/dsh-passbook

README

dsh-passbook · 密码本

npm version license

English: an end-to-end encrypted personal secrets book for the DeepSeek Harness (dsh). Secrets live as age ciphertext in your own private GitHub gist (node:crypto only, zero runtime dependencies, interoperable with the age CLI). People get a native dsh page (search / reveal with auto-hide / copy / edit); the agent gets value-free tools — inventory, save, note, run (the value is injected into one command's environment and masked in its output), remove — and never a get. Decryption happens only inside the local dsh host; routes are loopback-only. Configuration lives in dsh settings (⚙ in the panel, or 设置 → 密码本).

给 DeepSeek Harness (dsh) 的个人敏感信息保管插件:端到端加密、存在你自己的私密 gist 里、人有界面可查、agent 拿不到明文。

  • 密文格式是 age v1,用 node:crypto 实现,零第三方依赖;和 age CLI 互通。
  • 直接读写现有 gist-secrets 的 gist:同一个 gist、同样的 <名字>.age + _manifest.json,终端 secrets.sh 照常能用,一条数据不用迁移。
  • 解密身份是 ~/.ssh/id_ed25519(无口令 → 无感);也支持 AGE-SECRET-KEY-1… 身份文件和 age1… recipient。
  • 浏览器端:会话头右上角"密码本"胶囊(会话日志旁)→ 面板,搜索 / 筛选 / 待整理 / 一次性显示(倒计时遮回)/ 复制(30 秒清剪贴板)/ 新增 / 编辑 / 改名 / 删除。所有路由仅本机回环可访问。
  • agent 端只有 5 个工具,没有"读取值"
    工具作用
    passbook_inventory清单(名字 / 说明 / 敏感级 / 用途 / 标签),永不含值
    passbook_save把会话里出现的凭据加密存入,名字要求中文"哪家 · 干什么用"
    passbook_note改说明 / 敏感级 / 用途 / 标签 / 改名
    passbook_run用某条凭据运行一条命令:值以环境变量注入该命令,输出里的值被遮蔽;critical/high 先请用户审批
    passbook_remove删除(需审批)

安装

dsh plugin --profile web add dsh-passbook        # 或本地路径

配置(在界面里改)

所有配置都在 dsh 设置里:密码本面板右上角 ⚙,或 dsh 设置 → 密码本。保存到 settings.yamlpassbook 命名空间,改完立即生效,不用重启。第一次打开、或连接有问题时,面板会自动跳到设置页并显示原因。

默认说明
Gist ID~/.config/gist-secrets/gist-id私密 gist 的 id
后端GitHub GistGitee 代码片段下一阶段
写入 token存为 dsh 凭据 GIST_SECRETS_TOKEN~/.dsh/.credentials.yaml,0600),不进 settings.yaml;未配置时回退到环境变量 GH_TOKEN/GITHUB_TOKEN,再回退 gh auth token
解密身份~/.ssh/id_ed25519无口令的 ed25519 私钥
recipients 文件~/.config/gist-secrets/recipients多设备:每行一个公钥路径
age 身份文件可选的 AGE-SECRET-KEY-1…
需审批的敏感级critical, highagent passbook_run 前弹审批
显示后自动遮回10 秒

cordis.patch.ymlpassbook 行的 config 只是部署默认值(可用 PASSBOOK_GIST_ID / PASSBOOK_TOKEN_REF / PASSBOOK_IDENTITY 环境变量覆盖默认),设置里的值优先。

存储格式(与 gist-secrets 相同)

<名字>.age          age 加密(armor),名字明文、值密文
_manifest.json      { 名字: { desc, sensitivity, used_by, tags, added, updated, last_used } }
gist-secrets.meta   占位,保证 gist 非空

敏感级词汇:critical / high / medium / low

测试

npm test    # age 自测 + 与 age CLI 双向互通 + 真实 gist 只读校验 + 插件路由/工具(假 ctx)
PASSBOOK_WRITE_TEST=1 npm test   # 额外跑一次写入→secrets.sh get→改名→删除的真实往返

安全边界(如实说明)

  • 密文对 gist 提供方零信任;本机安全依赖 ~/.ssh/id_ed25519 的文件权限和磁盘加密。
  • dsh 的 bash 工具与你同用户运行,今天仍能读到 ~/.ssh(dsh 沙箱只管写不管读);passbook_run 只是让模型的对话里不出现明文,不是对本机进程的隔离。沙箱拒读是下一阶段。
  • passbook_save 的值会经过模型的工具参数;这条路径用于"值本来就已经在会话里"的收编场景。

MIT

Related plugins