Introduction

In the DeepSeek Harness (DSH) Web profile, when sensitive strings like keys and tokens are pasted into the composer, they may appear in plaintext directly in the messages and session history sent to the model. dsh-secret-paste addresses this scenario: it detects keys pasted into the composer, stores the key values in the official credentials seam, and replaces them with the [secret:REF] placeholder in the draft. The model only parses the real value when necessary, via a dedicated tool.

What is this

dsh-secret-paste is a DSH plugin maintained by zhujiaqi under the MIT license. It is used to reduce the occurrence of sensitive strings appearing in plaintext in messages and session history within the DSH Web profile.

Core Capabilities

  • Detect keys pasted into the composer.
  • Scan pasted text using @sanity-labs/secret-scan.
  • Store key values in the official credentials seam:
~/.dsh/.credentials.yaml

The file permissions are mode 0600.

  • Replace matched scope with the [secret:PASTE_N] placeholder in the draft.
  • Provide the secret_resolve(ref) tool for the model to resolve real values on demand.
  • Support recursive resolution of nested placeholders.
  • When a “medium confidence” hit occurs, preserve the draft text and prompt for confirmation to Hide or Ignore.
  • Support manually marking text not recognized by the detector and Hide & store.
  • Use collision-safe refs to avoid overwriting already configured refs.

The real value exists only in the current tab’s memory and ~/.dsh/.credentials.yaml (mode 0600). The tool description for secret_resolve instructs the model not to echo, repeat, or write the value back into the response, files, commands, or tool arguments.

Installation & Enablement

Requires a DSH Web profile; this article’s examples use web.

Prerequisites:

dsh CLI
pnpm

The dsh CLI and pnpm must be in your PATH. The dsh plugin command is a forwarder for pnpm.

Install the plugin:

dsh plugin --profile web add dsh-secret-paste

After installation, restart the dsh web process, as the server-side secret_resolve tool is loaded at startup. Then force refresh the browser tab to reload the browser-side bundle.

Typical Usage

  1. Paste a GitHub token (e.g., ghp_...) in the composer. After a detection hit, the text is replaced with [secret:PASTE_N] and a chip is displayed.

  2. When a “medium confidence” hit occurs, the draft text is preserved, and a prompt is shown to confirm Hide or Ignore.

  3. For text not recognized by the detector, select the text and use Mark selection as secret, then choose Hide & store.

  4. When the model needs the real value, it calls:

secret_resolve(ref)

Returns:

{ found, value, source }
  1. If the selection already contains [secret:REF], secret_resolve recursively resolves nested placeholders.

Applicable Scenarios & Notes

Suitable for scenarios in the DSH Web profile where sensitive strings like keys and tokens need to be handled, and you want to avoid plaintext appearing in messages and session history.

Notes:

  • The plugin runs with the permissions of the current dsh process; check the source code and license before installing.
  • The license is MIT; vendor/secret-scan.cjs is @sanity-labs/secret-scan v1.1.0 (MIT). The license is retained in:
vendor/secret-scan.LICENSE
  • After installation, you need to restart the dsh web process and force refresh the browser tab.
  • This plugin targets the DeepSeek Harness Web profile; the examples all use web.

Project Repository:

https://github.com/zhujiaqi/dsh-secret-paste