Headless Bitwarden (rbw) — Skill (addon)
Goal: safely retrieve secrets from Bitwarden without pasting passwords/tokens into chat.
This skill is intentionally small and non-overlapping:
- - Use the existing Bitwarden skill for installation / account setup.
- This skill only adds an ephemeral remote unlock web helper for
rbw.
This skill standardizes a workflow around:
- -
rbw (local encrypted cache + unlock) - an ephemeral unlock web helper that you can start on-demand and shut down automatically.
Core rules (must)
1) Never paste secrets into chat
- - No master password, no session keys, no JSON secrets.
2) Ephemeral by default
- - Unlock helper must be localhost-only, token-gated, and auto-expire.
- Default TTL: 600s (10 minutes).
3) No secret logging / no secret persistence
- - Do not log request bodies.
- Do not write secrets to disk.
4) Always restore rbw config
- - If a temporary
pinentry override is used, it must be restored even on failure.
Prereqs
1) Follow the workspace Bitwarden skill for setup (install, register/login):
2) Additional requirements for the unlock helper:
- -
rbw installed and registered/logged-in (device approved) - INLINECODE5 available
- INLINECODE6
- Optional (recommended for remote):
cloudflared (for an ephemeral HTTPS URL)
Fast paths
A) If the vault is already unlocked
CODEBLOCK0
B) If the vault is locked: start the ephemeral web unlock helper
From your workspace:
CODEBLOCK1
You will see:
- - INLINECODE8
- If
cloudflared exists: a INLINECODE10
Open the Public URL on your phone/laptop, enter the master password, and press Unlock.
The helper will:
- - run INLINECODE11
- respond to the browser as soon as
rbw unlock finishes - optionally run
rbw sync after the browser response (so the page shouldn’t spin) - exit immediately on success (or auto-exit on TTL)
Security notes (residual risk, be explicit)
Even with HTTPS tunnel and no logs, this is not “zero risk”. Remaining risks include:
- - password exists briefly in process memory
- password is passed briefly to a child process via env (in same-user scope)
- token URL leakage during TTL would allow access to the form
- tunnel provider is within the trust boundary (even though traffic is HTTPS)
Mitigations implemented:
- - localhost bind only (
127.0.0.1) - high-entropy path token
- request body size limit
- no request-body logging
- TTL auto-exit + exit-on-success
- pinentry override always restored
Treat the Public URL as sensitive
The Public URL includes the one-time token. Anyone who obtains it during the TTL window can access the unlock form.
- - Do not paste the Public URL into GitHub issues, logs, screenshots, or shared channels.
- Share it only to the person who is unlocking, and only for that one session.
Autofill note
The password input is configured to discourage browser/password-manager autofill (best-effort), but some managers may still try to fill.
If you want to avoid accidental autofill, use a private/incognito window or temporarily disable the password manager for that page.
Retry / “unlock in progress” note
An unlock attempt can take a bit of time. If you submit twice quickly, you may see an “unlock attempt already in progress” message.
Wait for the attempt to finish (default timeout is ~30s) before retrying.
Files
Implementation lives in:
Troubleshooting / operational notes
pinentry restore reliability
The helper does not call rbw config set/unset (which can hang in non-interactive environments). Instead, it temporarily edits:
- -
~/.config/rbw/config.json → INLINECODE18
and then restores it back.
If something crashes mid-flight, the quickest manual recovery is:
CODEBLOCK2
Agent state
If rbw unlocked says agent not running, restart/refresh the agent by running:
CODEBLOCK3
Headless Bitwarden (rbw) — 技能(插件)
目标:无需将密码/令牌粘贴到聊天中,即可安全地从 Bitwarden 检索密钥。
此技能特意设计为小巧且无重叠:
- - 使用现有的 Bitwarden 技能进行安装/账户设置。
- 此技能仅为 rbw 添加一个临时的远程解锁 Web 助手。
此技能标准化了围绕以下内容的工作流程:
- - rbw(本地加密缓存 + 解锁)
- 一个临时的解锁 Web 助手,您可以按需启动并自动关闭。
核心规则(必须遵守)
1) 切勿将密钥粘贴到聊天中
2) 默认临时性
- - 解锁助手必须是仅限本地主机、令牌门控且自动过期的。
- 默认 TTL:600秒(10分钟)。
3) 无密钥日志记录 / 无密钥持久化
4) 始终恢复 rbw 配置
- - 如果使用了临时的 pinentry 覆盖,即使在失败的情况下也必须恢复。
前提条件
1) 按照工作区 Bitwarden 技能进行设置(安装、注册/登录):
- - skills/bitwarden/SKILL.md
2) 解锁助手的额外要求:
- - 已安装并注册/登录 rbw(设备已批准)
- 可使用 node
- 可使用 bash
- 可选(推荐用于远程):cloudflared(用于临时的 HTTPS URL)
快速路径
A) 如果密码库已解锁
bash
rbw unlocked
rbw sync
rbw search <关键词>
rbw get <项目名称> --field <字段名称>
B) 如果密码库已锁定:启动临时的 Web 解锁助手
从您的工作区:
bash
TTLSECONDS=600 SYNCAFTER_UNLOCK=1 \
skills/headless-bitwarden/scripts/rbw-remote-unlock/start.sh
您将看到:
- - 本地 URL:http://127.0.0.1:<端口>/<令牌>/
- 如果存在 cloudflared:公共 URL:https://<随机>.../<令牌>/
在您的手机/笔记本电脑上打开公共 URL,输入主密码,然后按解锁。
助手将:
- - 运行 rbw unlock
- 在 rbw unlock 完成后立即响应浏览器
- 可选地在浏览器响应之后运行 rbw sync(这样页面不应旋转)
- 成功时立即退出(或在 TTL 时自动退出)
安全说明(剩余风险,明确说明)
即使有 HTTPS 隧道且无日志,这也不是“零风险”。剩余风险包括:
- - 密码在进程内存中短暂存在
- 密码通过 env 短暂传递给子进程(在同一用户范围内)
- TTL 期间令牌 URL 泄露将允许访问表单
- 隧道提供商在信任边界内(即使流量是 HTTPS 的)
已实施的缓解措施:
- - 仅绑定本地主机(127.0.0.1)
- 高熵路径令牌
- 请求体大小限制
- 无请求体日志记录
- TTL 自动退出 + 成功时退出
- pinentry 覆盖始终恢复
将公共 URL 视为敏感信息
公共 URL 包含一次性令牌。在 TTL 窗口期间获取该 URL 的任何人都可以访问解锁表单。
- - 不要将公共 URL 粘贴到 GitHub 问题、日志、截图或共享频道中。
- 仅与执行解锁的人员共享,且仅用于该会话。
自动填充说明
密码输入已配置为阻止浏览器/密码管理器自动填充(尽力而为),但某些管理器可能仍会尝试填充。
如果您想避免意外自动填充,请使用隐私/无痕窗口或暂时禁用该页面的密码管理器。
重试 / “解锁进行中”说明
解锁尝试可能需要一些时间。如果您快速提交两次,可能会看到“解锁尝试已在进行中”的消息。
在重试之前,请等待尝试完成(默认超时约为 30 秒)。
文件
实现位于:
- - skills/headless-bitwarden/scripts/rbw-remote-unlock/{start.sh,server.mjs,pinentry.sh}
故障排除 / 操作说明
pinentry 恢复可靠性
助手不会调用 rbw config set/unset(这在非交互式环境中可能会挂起)。相反,它会临时编辑:
- - ~/.config/rbw/config.json → pinentry:
然后将其恢复。
如果某件事在半途中崩溃,最快的手动恢复方法是:
bash
rbw config set pinentry pinentry
代理状态
如果 rbw unlocked 显示 agent not running,请通过运行以下命令重启/刷新代理:
bash
rbw stop-agent || true
rbw unlocked