In the plugin-based ecosystem of DeepSeek Harness (DSH), API key management and security exposure are frequent pain points in agent development. Manual management or hard-coding keys in configuration files is not only inefficient but also makes sensitive information prone to accidental leakage in conversation context or tool output. The dsh-keyring plugin solves this problem through automatic masking and a global collection mechanism, providing DSH with a persistent key management solution that survives restarts.

Plugin Positioning

dsh-keyring is a key vault plugin for DeepSeek Harness (DSH), maintained by developer re-ITRT. It belongs to the admin-security category and uses the MIT license. The plugin exists as an official profile bundle (npm package), supporting automatic key masking, automatic storage in the global keyring, settings UI management, and persistence across restarts.

Core Features

1. Automatic Key Masking and Collection

The plugin includes a built-in masking engine that covers common sensitive prefixes and formats, implemented with reference to Hermes rules. When a key appears in a user message (agent/pre-step) or tool output (tools/post-execute), it is automatically masked, while the original value is stored in the global keyring.

Supported sensitive items include:
* Vendor prefixes: ghp_ / github_pat_ / gho_, sk- / sk-ant-, AIza, AKIA, xox* / xapp-, hf_, glpat-, etc.
* Assignment forms: environment variables (KEY=value), YAML/JSON fields (password, apiKey), and request headers (Authorization:, x-api-key:).
* Others: database connection string passwords and raw URL tokens.

Masking rules:
* Short tokens (<18 characters): the entire segment is shown as ***.
* Long tokens: the first 6 and last 4 characters are preserved, with **** replacing the middle.

2. Two-level Storage

The plugin supports two storage scopes to meet different scenario requirements:
* Global storage (scope=global): persistent across sessions and restarts. Data is stored in the dsh credentials file (.credentials.yaml), with file permissions set to 0600.
* Session-level storage (scope=session): exists only within the current session and is not written to the global file. When the session ends or is cleaned up, the entries automatically disappear.

3. Model Tools

The plugin provides four model tools for Agent invocation:
* keyring_store: save or update a key.
* keyring_get: retrieve the original key value for current operations.
* keyring_list: list key names and metadata without returning values.
* keyring_unset: delete a specified key.

4. Settings Page “Keyring”

In the DSH Web interface, this feature can be accessed via “Settings → Keyring”.
* Management: supports adding, editing, and deleting global entries.
* Interaction: supports showing/hiding original values, one-click copying, and generating random strong passwords.
* Styling: follows the DSH theme, supports light/dark mode adaptation, and provides bilingual Chinese and English text.

Installation and Enablement

Install it as an official profile bundle; after restarting dsh web, it is loaded automatically.

dsh plugin --profile web add dsh-keyring

After installation, the plugin is automatically added to dsh.profile.bundles. Restarting dsh web makes it effective.

Typical Usage

Managing Keys with Tools

An Agent can directly call the model tools to perform operations.

# 保存密钥
keyring_store(scope="global", key="GITHUB_TOKEN", value="ghp_xxxxx")

# 获取密钥
token = keyring_get(scope="global", key="GITHUB_TOKEN")

# 列出所有键
keys = keyring_list(scope="global")

# 删除密钥
keyring_unset(scope="global", key="GITHUB_TOKEN")

Managing Credentials via UI

  1. Open the DSH Web interface.
  2. Go to the “Settings” menu.
  3. Click the “Keyring” tab.
  4. View global entries in the list, and click “Copy” or “Show/Hide” to perform actions.

Notes

  • Storage security: The plugin does not perform true encrypted storage; it only prevents unauthorized access via file system permissions (0600). Ensure that system user permissions are secure.
  • Key rotation: It does not provide automatic expiration or rotation for keys; they require manual management.
  • URL tokens: Tokens in Web URL query parameters are not masked by default, to support legitimate OAuth callback scenarios (consistent with Hermes behavior).
  • Session cleanup: Session-level entries are not automatically cleaned up; they naturally disappear with the session lifecycle.

Summary

dsh-keyring is a practical tool in the DSH ecosystem for handling sensitive information. Through automatic masking and two-level storage, it reduces the risk of key leakage while preserving developer convenience. Developers can manage credentials uniformly via CLI tools or the Web UI, making it suitable for scenarios in agent development where multiple API keys need to be switched or handled frequently.

Related links:
* Plugin directory: https://www.skillhub.cn/plugins/re-ITRT/dsh-keyring
* GitHub repository: https://github.com/re-ITRT/dsh-keyring