DeepSeek Harness Credential Routing Hub: Metadata Management for SSH Hosts and PATs

Introduction

In DeepSeek Harness (DSH), agents need to access SSH hosts and PAT tokens to complete deployment, operations, and API calls. The conventional approach often writes credential values directly into configuration files or prompts, resulting in bloated inventories, difficult management, and leak risks. pandaboby/dsh-credential-hub provides a “credential routing hub” that matches SSH hosts and PAT tokens by tag, allowing the model to find the correct alias through natural language, while the Host internally resolves the private key or token and hands it off to the system.

What Is It

dsh-credential-hub is a DSH plugin maintained by PandaBoby, categorized under admin-security. It maintains a metadata inventory of SSH hosts and PAT tokens. The system prompt only contains metadata (alias, tags, description, credentialRef), while credential values are held by the DSH credential service and resolved only on the Host side before being used for ssh or fetch—thus ensuring “the prompt contains only metadata; secrets stay on the Host.”

Core Features

  • Tag-based routing: Chinese and English tags, descriptions, aliases, and host/platform fields participate in matching; environment terms (production/testing) won’t cross-contaminate.
  • Metadata-only prompts: The system prompt lists only alias, tags, description, and credentialRef—never host, port, or keys.
  • Host-side resolution: SSH/PAT tools read credentials internally on the Host; values never enter tool parameters, tool results, or model context.
  • Settings page management: Record CRUD, search, write-only credential values, runtime configuration, and encrypted import/export.
  • No build step: The Host is ESM, the Client uses React.createElement—no separate bundling required after installation.

Installation & Enablement

On the desktop client, go to “Settings → Plugins → Add Plugin → Install Local Plugin Directory” and select this repository’s directory.

From the command line, use the official install command:

dsh plugin --profile <profile> add dsh-credential-hub

After installation, the bundle inserts a credential-hub line. See cordis.patch.yml for the default configuration.

Typical Usage

  1. Add records (YAML):

File path: $DSH_HOME/credential-hub/inventory.yml (typically ~/.dsh/credential-hub/inventory.yml).

Example content:

version: 1

ssh:
  - alias: prod-web-01
    tags: ["env:production", "service:web"]
    description: 生产环境 Web 应用主机
    host: 10.0.0.10
    port: 22
    username: deploy
    credentialRef: SSH_PROD_WEB_KEY

pat:
  - alias: github-prod-token
    tags: ["platform:github", "env:production"]
    description: GitHub 生产环境令牌
    platform: github
    baseUrl: https://api.github.com
    authScheme: bearer
    credentialRef: PAT_GITHUB_PROD

Field descriptions:

  • alias: Globally unique, must match [A-Za-z0-9][A-Za-z0-9._-]{0,63}.
  • tags: Array of strings, up to 32 entries; recommended namespaces: env:*, service:*, platform:*.
  • description: Human-readable description, up to 500 characters.
  • credentialRef: DSH credential reference—write only the reference name, never the value.
  • For SSH, host/username are required; port is optional, defaults to 22.
  • For PAT, baseUrl is optional but strongly recommended; PAT requests are sent only to that origin.
  • PAT authScheme: bearer (default), token, basic, header.
  • headerName/username: Required for header/basic mode respectively.
  1. Write actual values:

Real private keys/tokens are stored in the DSH credential store; the inventory retains only references.

  • The “Credential Value” field on the settings page is write-only: after pasting, it writes to the credential store only—no echo-back, no writing to the inventory.
  • You can also configure them in the credentials section under “Settings → Account.”
  • Or call ctx.credentials.set() from a trusted Host plugin:
import { credentialRef } from '@deepseek-ai/dsh-credentials'

await ctx.credentials.set(credentialRef('SSH_PROD_WEB_KEY'), await readFile('id_ed25519', 'utf8'))
await ctx.credentials.set(credentialRef('PAT_GITHUB_PROD'), 'github_pat_...')

For testing or CI, you can use startup environment variables as a fallback: SSH_PROD_WEB_KEY=... PAT_GITHUB_PROD=... dsh .... Stored values take priority over environment values; after rotation, the next operation takes effect immediately.

Do not write private keys or PATs into inventory.yml. Inventory validation rejects fields such as privateKey, token, password, secret, passphrase, etc.

Applicable Scenarios & Cautions

Suitable for scenarios that require unified management of SSH hosts and PAT tokens, separation of credential values from prompts, tag-based routing, and encrypted synchronization. Before installing, review the source code and license (MIT), and ensure the current DSH version meets the requirement (>= 0.2.2-rc.1), Node.js >= 20, and the profile has a credential service mounted (e.g., @deepseek-ai/dsh-credentials-local or an equivalent implementation).

In Short

dsh-credential-hub isolates credential values from prompts through a metadata inventory and Host-side resolution, routes SSH and PAT by tags, and supports encrypted synchronization. Enable it with the official install command. For more details, see: https://www.skillhub.cn/plugins/PandaBoby/dsh-credential-hub and https://github.com/PandaBoby/dsh-credential-hub.

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

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

Xiaoye