Introduction¶
In the DeepSeek Harness (DSH, Cordis) environment, handling API keys (such as OpenRouter Key or Discord Bot Token) requires a security mechanism separate from Git credentials. dsh-wsl-cred focuses on credential prompts for Git push/pull, while this plugin (dsh-wsl-secret) is intended for application-level API keys. It allows securely reading keys in pass and age formats in WSL/Linux environments.
Core Features¶
- Securely read
pass/agekeys. - List key names.
- Check whether a key exists.
- Load a key into environment variables.
- Preview key values.
- Decrypt
agekeys. - Configure a whitelist via
allowPrefixes. - Do not automatically display full keys by default (
reveal: false).
Installation and Enablement¶
This plugin runs in a WSL/Linux environment and requires the pass and/or age tools to be included in the system PATH.
- Install the necessary command-line tools:
sudo apt install pass age
- Enable the plugin and configure the whitelist in the DSH profile. Edit
cordis.patch.yml(for example, at~/.dsh/profiles/web/cordis.patch.yml) and add the following content:
plugins:
dsh-wsl-secret:
enabled: true
path: /path/to/dsh-wsl-secret
config:
allowPrefixes:
- dsh
reveal: false
timeoutMs: 15000
Changes take effect after restarting or reloading the profile. Note: if `allowPrefixes` is not configured, `secret_status` will return `ready=false`.
Tools and Usage¶
The plugin provides the following commands:
secret_status: Checks whether thepass/agetools are ready, the whitelist configuration, and overall status.secret_pass_list: Lists the names of allpasskeys.secret_pass_exists: Checks whether the specifiedpasskey exists.secret_to_env: Loads apasskey into environment variables (recommended).secret_pass_get: Previews the content of apasskey (use with caution becausereveal: falseby default).secret_age_to_env: Loads anagekey into environment variables.secret_age_decrypt: Decrypts anagekey and previews it.
Typical Workflow¶
- Insert keys into
pass:
pass insert dsh/openrouter
pass insert dsh/discord-bot
- Check the status in DSH:
{ "name": "secret_status" }
- Load the key as an environment variable (recommended):
{ "name": "secret_to_env", "arguments": { "name": "dsh/openrouter", "envKey": "OPENROUTER_API_KEY" }}
Other tools within the same DSH process can access the value via `process.env.OPENROUTER_API_KEY`.
Security Model¶
- Whitelist mechanism:
allowPrefixesmust be explicitly configured before keys can be read. IfallowPrefixesis empty, all access is denied. - Hidden by default:
reveal: falseby default; unless explicitly enabled in the configuration, the full plaintext key will not be returned in the chat. - Usage recommendation: Prefer using
secret_to_envto inject keys into environment variables, avoiding pasting plaintext keys directly into the chat context.
License¶
MIT License