dsh-wsl-secret: DeepSeek Harness WSL Plugin

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/age keys.
  • List key names.
  • Check whether a key exists.
  • Load a key into environment variables.
  • Preview key values.
  • Decrypt age keys.
  • 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.

  1. Install the necessary command-line tools:
    sudo apt install pass age
  1. 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 the pass/age tools are ready, the whitelist configuration, and overall status.
  • secret_pass_list: Lists the names of all pass keys.
  • secret_pass_exists: Checks whether the specified pass key exists.
  • secret_to_env: Loads a pass key into environment variables (recommended).
  • secret_pass_get: Previews the content of a pass key (use with caution because reveal: false by default).
  • secret_age_to_env: Loads an age key into environment variables.
  • secret_age_decrypt: Decrypts an age key and previews it.

Typical Workflow

  1. Insert keys into pass:
    pass insert dsh/openrouter
    pass insert dsh/discord-bot
  1. Check the status in DSH:
    { "name": "secret_status" }
  1. 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: allowPrefixes must be explicitly configured before keys can be read. If allowPrefixes is empty, all access is denied.
  • Hidden by default: reveal: false by default; unless explicitly enabled in the configuration, the full plaintext key will not be returned in the chat.
  • Usage recommendation: Prefer using secret_to_env to inject keys into environment variables, avoiding pasting plaintext keys directly into the chat context.

License

MIT License

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye