当前位置: 首页 > Skill >

Vault Enhancements w/ UI

Vault Enhancements w/ UI

Vault Enhancements w/ UI

OpenClaw 的基于保险库的 API 密钥管理。安全的文件型密钥存储,支持一键从明文配置迁移、动态密钥发现、保险库...

3.0.0 2026.11.25 741
获取Skill文件查看使用说明
作 者:顾知 许可证: 更新时间:2026.11.25
本文目录展开

Vault Enhancements w/ UI v3.0.0

Vault-backed API key management for the OpenClaw Control dashboard. Keys are stored in a secure file (~/.openclaw/secrets.json, mode 0600) and referenced via OpenClaw's built-in Secrets System. The AI agent never sees your keys.

Status: ✅ Active

Component Status
Vault File Storage ✅ Working
Secret References (SecretRef) ✅ Working
Dynamic Key Discovery ✅ Working
One-Click Migration ✅ Working
Plugin-Registered Tab ✅ Working
Vault Status Banner ✅ Working
Key Status Badges ✅ Working
Vault-Only Keys Section ✅ Working
Manual "+ Add Secret" Form ✅ Working
Restart Notification Banner ✅ Working
Skills Vault Key Selector ✅ Working
Skills Inline Key Creation ✅ Working
Auth Profiles Display ✅ Working

Features

1. Vault-Backed Storage

Keys are stored in ~/.openclaw/secrets.json (file permissions 0600). When you save a key, the UI:

  1. Writes the value to the vault file
  2. Configures the file secret provider in openclaw.json (if not already present)
  3. Replaces the plaintext config value with a SecretRef object
  4. Shows a restart notification — user must restart gateway for changes to take effect

Config before migration:

{
  "env": {
    "OPENAI_API_KEY": "sk-proj-abc123..."
  }
}

Config after migration:

{
  "env": {
    "OPENAI_API_KEY": { "source": "file", "provider": "default", "id": "/OPENAI_API_KEY" }
  },
  "secrets": {
    "providers": {
      "default": { "source": "file", "path": "~/.openclaw/secrets.json", "mode": "json" }
    },
    "defaults": { "file": "default" }
  }
}

Vault file (~/.openclaw/secrets.json):

{
  "OPENAI_API_KEY": "sk-proj-abc123..."
}

2. One-Click Migration

The "🔒 Migrate to Vault" button appears when plaintext keys are detected. It:

  • Scans openclaw.json for all plaintext API key values
  • Moves each to the vault file
  • Replaces with SecretRef objects in config
  • Auto-configures the file provider if needed
  • Reports what was migrated

3. Dynamic Key Discovery

The UI automatically scans the entire config for API keys — no hardcoded list.

Detection patterns: apiKey, api_key, token, secret, *_KEY, *_TOKEN, *_SECRET

Where it looks:

  • env.* — Environment variables
  • skills.entries.*.apiKey — Skill-specific keys
  • messages.tts.*.apiKey — TTS provider keys
  • Any nested config path

Known providers get friendly names, descriptions, and "Get key ↗" links:

Provider Env Key
Anthropic ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
Google / Gemini GOOGLE_API_KEY / GEMINI_API_KEY
Brave Search BRAVE_API_KEY
ElevenLabs ELEVENLABS_API_KEY
Deepgram DEEPGRAM_API_KEY
OpenRouter OPENROUTER_API_KEY
Groq GROQ_API_KEY
Fireworks FIREWORKS_API_KEY
Mistral MISTRAL_API_KEY
xAI (Grok) XAI_API_KEY
Perplexity PERPLEXITY_API_KEY
GitHub GITHUB_TOKEN
Hume AI HUME_API_KEY / HUME_SECRET_KEY

4. Vault Status Banner

Top of the page shows:

  • 🔒 Vault Active (green) — All keys in vault, provider configured
  • ⚠️ X Plaintext Keys Detected (yellow) — Migration recommended

5. Key Status Badges

Each key row shows:

  • VAULT (green) — Stored in secure vault file
  • PLAINTEXT (yellow) — Still in config as raw string
  • NOT SET (grey) — Not configured

6. Vault-Only Keys Section

Keys stored in the vault that aren't referenced by any config path are displayed in a dedicated "Vault-Only Keys" card. These are keys created manually or by skills that don't have a corresponding env/config entry. Each shows:

  • 🔒 icon with the key name (monospace)
  • Masked value preview
  • Delete button

7. Manual "+ Add Secret" Form

The Vault tab header includes a "+ Add Secret" button that expands an inline form:

  • KEY_NAME input (monospace, UPPER_SNAKE_CASE recommended)
  • Secret value input (password field)
  • Save / Cancel buttons
  • Writes to vault with envEntry: false — no config entry created, no restart triggered
  • Key appears immediately in the "Vault-Only Keys" section

8. Restart Notification Banner

When a vault write triggers a config change, a yellow warning banner appears:

⚠ New secrets require a gateway restart to take effect. [Restart Now]

The banner persists until the user clicks "Restart Now" or refreshes. This replaces the previous auto-reload behavior that caused unexpected gateway restarts.

9. Skills Vault Key Selector

On the Skills tab, skills that declare a primaryEnv get a vault key selector instead of a raw password input:

When unlinked:

  • Dropdown shows all vault keys with 🔒 icons
  • "Select vault key for ENV_NAME…" placeholder
  • Selecting a key writes a SecretRef to skills.entries.<key>.apiKey in config
  • "+ Add new vault key…" option opens inline creation form

When linked:

  • Shows 🔒 KEY_NAME with an "Unlink" button
  • Unlink removes the SecretRef from config

Inline key creation:

  • KEY_NAME + Secret value fields
  • "Save & Link" creates the vault key and links it to the skill in one step
  • Key also appears in the Vault tab's vault-only keys section

10. Skills Expanded by Default

All skill groups (workspace, built-in, managed) render expanded (<details open>) for better discoverability. Previously workspace and built-in were collapsed by default.

11. Auth Profiles Display

Auth profile keys (from auth-profiles.json) that are stored in the vault are listed with their status. Backend RPCs support listing, error reset, and deletion.

Architecture

Security Model

┌──────────────────────────────────────────────────────────┐
│  Browser                                                  │
│  ┌──────────────────────────────────────────────────┐    │
│  │  Vault Tab                                        │    │
│  │  ┌──────────────────────────────────────────┐    │    │
│  │  │ OpenAI: [••••••••••] [Save] [✕]  🟢VAULT │    │    │
│  │  │ Anthropic: [        ] [Save]     ⚪NOT SET│    │    │
│  │  │ + Add Secret  [KEY_NAME] [value] [Save]   │    │    │
│  │  └──────────────────────────────────────────┘    │    │
│  │                                                   │    │
│  │  Skills Tab                                       │    │
│  │  ┌──────────────────────────────────────────┐    │    │
│  │  │ whisper-api: 🔒 OPENAI_API_KEY  [Unlink] │    │    │
│  │  │ sag:         [Select vault key ▾]         │    │    │
│  │  └──────────────────────────────────────────┘    │    │
│  └──────────────────────────────────────────────────┘    │
│                           │                               │
│                           ▼ (direct RPC, not via agent)   │
└───────────────────────────┼───────────────────────────────┘
                            │
                    ┌───────▼───────┐
                    │   Gateway     │
                    │ secrets.write │
                    │ skills.update │
                    └──┬─────────┬──┘
                       │         │
              ┌────────▼──┐  ┌──▼────────────┐
              │ secrets.   │  │ openclaw.json  │
              │ json       │  │ (SecretRef     │
              │ (0600)     │  │  objects only) │
              └────────────┘  └────────────────┘

Backend RPCs

Method Description
secrets.status Vault file status, key count, plaintext count
secrets.list List secret IDs with masked values
secrets.write Store key in vault + optionally update config with SecretRef. envEntry param (default true) controls whether an env block entry is created. Returns restartNeeded flag instead of auto-reloading.
secrets.delete Remove from vault + config
secrets.migrate Batch-migrate all plaintext keys to vault
secrets.authProfiles.list List auth profile keys with vault status
secrets.authProfiles.resetErrors Reset auth profile error state
secrets.authProfiles.delete Delete an auth profile
skills.update Updated with vaultKeyId param — writes a SecretRef to skills.entries.<key>.apiKey or unlinks (empty string)

Skills-Status Integration

SkillStatusEntry includes a vaultKeyId field that reads the raw config JSON (not the runtime-resolved config where SecretRefs are replaced with resolved strings). This is done via extractVaultKeyIdFromConfig() which reads and caches openclaw.json directly, checking for SecretRef objects in skills.entries.<key>.apiKey.

Restart Behavior

No auto-restart on vault save. Previously, secrets.write called reloadSecrets() which could trigger a gateway restart. Now:

  • Vault-only saves (envEntry: false) don't touch config — no restart needed
  • Config-touching saves return restartNeeded: true — UI shows a restart banner
  • Skills vault linking writes to config via writeConfigFile() — triggers the config file watcher which causes a gateway restart (inherent to the config watcher system)

OpenClaw Secrets System Integration

This skill uses OpenClaw's built-in Secrets System (src/secrets/):

  • File provider: { source: "file", path: "~/.openclaw/secrets.json", mode: "json" }
  • SecretRef format: { source: "file", provider: "default", id: "/<KEY_NAME>" }
  • Runtime resolution: prepareSecretsRuntimeSnapshot() resolves all refs at gateway startup
  • Security: File permissions checked (0600), ownership verified, path guards

The secrets system also supports env and exec providers for advanced setups (e.g., environment variables, external vault commands). The file provider is the default for this UI.

Files Modified (Source Locations in OpenClaw Repo)

File Purpose
src/gateway/server-methods/secrets.ts Vault RPCs (status, list, write, delete, migrate, authProfiles)
src/gateway/server-methods/skills.ts Skills update with vaultKeyId param
src/gateway/server-methods/plugins-ui.ts Plugin view registration
src/gateway/protocol/schema/agents-models-skills.ts vaultKeyId in SkillsUpdateParamsSchema
src/agents/skills-status.ts vaultKeyId field on SkillStatusEntry, raw config reader
ui/src/ui/controllers/apikeys.ts Vault-aware state, addVaultSecret, loadVaultOnlyKeys
ui/src/ui/controllers/skills.ts VaultKeyEntry type, loadVaultKeys, linkSkillToVaultKey, addVaultKeyAndLink
ui/src/ui/views/apikeys.ts Vault UI (banners, badges, migration, add form, vault-only keys, restart banner)
ui/src/ui/views/skills.ts Vault key selector dropdown, inline creation, expanded groups
ui/src/ui/app.ts State properties (vault, restart, skill key management)
ui/src/ui/app-render.ts Prop wiring for vault and skills
ui/src/ui/app-settings.ts Tab load triggers for vault keys
ui/src/ui/types.ts vaultKeyId on SkillStatusEntry
ui/src/ui/navigation.ts Vault tab (lock icon), removed 1password/discord standalone tabs

Reference Files

apikeys-ui/
├── SKILL.md                              # This file
├── INSTALL_INSTRUCTIONS.md               # Step-by-step installation (legacy)
└── reference/
    ├── apikeys-controller.ts             # UI controller (vault tab)
    ├── apikeys-views.ts                  # UI view (vault tab)
    ├── secrets-rpc.ts                    # Backend vault RPCs
    ├── skills-controller.ts              # UI controller (skills vault integration)
    ├── skills-views.ts                   # UI view (vault key selector)
    ├── skills-status.ts                  # Backend skill status with vaultKeyId
    └── skills-rpc.ts                     # Backend skills update RPC

Key Design Decisions

  1. No auto-restart on save — secrets.write no longer calls reloadSecrets(). A restart banner with "Restart Now" button lets the user decide when to restart.

  2. Vault-only keys — Keys created with envEntry: false don't appear in config. A separate secrets.list call finds all vault entries and shows orphan keys in a dedicated section.

  3. Raw config reading for vaultKeyId — The runtime resolves SecretRefs to strings, so loadConfig() returns resolved values. extractVaultKeyIdFromConfig() reads the raw JSON file directly (with mtime caching) to detect SecretRef objects.

  4. Skills expanded by default — All <details> groups render open for better UX. Collapsed-by-default hid skills that needed configuration.

  5. Skills use vault references, not plaintext — Skills with primaryEnv get a vault key selector dropdown instead of a password input. Linking writes a SecretRef to skills.entries.<key>.apiKey in config.

  6. Inline key creation from skills — "+ Add new vault key…" in the skills dropdown creates a vault entry and links it in one step, reducing friction.

Changelog

v3.0.0

  • Manual "+ Add Secret" form in Vault tab header — create vault keys without config entries
  • Vault-Only Keys section — shows keys in vault not referenced by config
  • Restart notification banner — yellow warning with "Restart Now" button replaces auto-reload
  • Skills vault key selector — dropdown replaces raw password input for skills with primaryEnv
  • Skills inline key creation — "+ Add new vault key…" creates and links in one step
  • Skills expanded by default — all groups open, no more collapsed-by-default
  • vaultKeyId on SkillStatusEntry — reads raw config JSON to detect SecretRef objects
  • envEntry param on secrets.write — controls whether an env block entry is created
  • vaultKeyId param on skills.update — writes SecretRef or unlinks skill from vault key

v2.0.0

  • Vault-backed storage: Keys stored in ~/.openclaw/secrets.json (mode 0600) instead of plaintext config
  • SecretRef integration: Config values replaced with OpenClaw SecretRef objects pointing to vault
  • One-click migration: "Migrate to Vault" batch-migrates all plaintext keys
  • Vault status banner: Green (all secure) or yellow warning (plaintext detected)
  • Key badges: VAULT / PLAINTEXT / NOT SET per key
  • New RPCs: secrets.status, secrets.list, secrets.write, secrets.delete, secrets.migrate
  • Plugin UI registration: Moved from old nav to plugin architecture (settings group, position 1)
  • Auto-provider config: Saving a key auto-configures the file secret provider if not present

v1.1.0

  • Dynamic key discovery — scans entire config instead of hardcoded list
  • Auto-grouping by category (Environment / Skills / Other)
  • Common env keys shown even if not configured

v1.0.0

  • Initial release with hardcoded provider slots
  • Save/Clear functionality via config.patch

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,037
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,015
Skill 文件
  • SKILL.md
    • Vault Enhancements w/ UI v3.0.0
    • Status: ✅ Active
    • Features
      • 1. Vault-Backed Storage
      • 2. One-Click Migration
      • 3. Dynamic Key Discovery
      • 4. Vault Status Banner
      • 5. Key Status Badges
      • 6. Vault-Only Keys Section
      • 7. Manual "+ Add Secret" Form
      • 8. Restart Notification Banner
      • 9. Skills Vault Key Selector
      • 10. Skills Expanded by Default
      • 11. Auth Profiles Display
    • Architecture
      • Security Model
      • Backend RPCs
      • Skills-Status Integration
      • Restart Behavior
      • OpenClaw Secrets System Integration
      • Files Modified (Source Locations in OpenClaw Repo)
      • Reference Files
    • Key Design Decisions
    • Changelog
      • v3.0.0
      • v2.0.0
      • v1.1.0
      • v1.0.0
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期