Community plugin

casualjim / dsh-heimdall

Heimdall secret-exposure guards for DeepSeek Harness tool calls (ported from pi-heimdall)

  • TypeScript
  • MIT
  • 1 stars
  • Sep 20, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

dsh-heimdall is a DSH plugin published from the dsh-heimdall package in the casualjim/dsh-plugins repository.

  • Listing statusManifest verified
  • Manifest checkedNov 16, 2026
  • Packagedsh-heimdall
  • Package pathdsh-heimdall
  • Repository createdAug 23, 2026

Capabilities and topics

dsh-pluginsdsh-skilldsh-web
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

dsh-heimdall

Guardian plugin for DeepSeek Harness that protects against accidental secret exposure through tool calls. Ported from pi-heimdall.

The sandbox-guard half is intentionally omitted: DSH owns a native sandbox seam (ctx.sandbox, fail-closed, approval escalation). This bundle ships only the secret-hygiene guards pi's sandbox does not cover.

Guards

GuardTypeToolBlocks / redacts
env-protectopt-outreadReading .env, .env.*, .envrc, *.env — except .env.example, .env.sample, .env.template, .env.dist, .env.defaults
kubectl-secret-guardopt-outbashkubectl get secrets, kubectl patch ... finalizers, kubectl exec dumping env / /var/run/secrets / app.ini
sops-secret-guardopt-outbashsops decrypt, sops -d, sops --decrypt, sops exec-env, sops exec-file, sops edit, bare sops <file>
command-policy-guardopt-outbashCommands that violate repo policy (see below)
secret-guardopt-outall text resultsCommands referencing secret env var names from .env.json; redacts their values from tool result text before the model sees it (plaintext, base64, rot13, reversed, hex, hexdump)

When a guard blocks a call the reason is delivered back to the model as the tool result. It instructs the model to ask the user to run the command directly and never to attempt a bypass.

Install

dsh plugin --profile <name> add link:/path/to/dsh-plugins/dsh-heimdall

Restart the profile for the host row to activate.

Configuration

Row config (in cordis.patch.yml) is deep-merged over the universal heimdall config chain: ~/.config/heimdall/default.jsonc (GENERATED deny corpus, regenerated on every load — never hand-edit), ~/.config/heimdall/config.json(c) (user level), and <workspaceRoot>/.config/heimdall.json(c) (per workspace). Legacy .pi/.omp/.dsh heimdall files — user and workspace level — are migrated (merged, written to the universal location, deleted) on first load and never read as a fallback. The files are multi-plugin: dsh-heimdall-sandbox reads the sandbox section from the same chain, so all harnesses share one understanding of what they can and can't touch.

{
  // These guard ids are opt-out.
  "disabled": ["env-protect", "kubectl-secret-guard"],
  "commandPolicies": [],
  "dotenv": ".env.json",
  "sandbox": { /* consumed by dsh-heimdall-sandbox */ }
}

command-policy-guard

Repo-specific command policies from the universal config chain:

{
  "commandPolicies": [
    {
      "name": "no-cargo-test",
      "blocked": ["cargo", "test"],
      "message": "Use `mise test` instead of `cargo test`."
    },
    {
      "name": "bare-kubectl-apply",
      "blocked": ["kubectl", "apply"],
      "bare": true,
      "message": "kubectl apply must run bare; no pipe or redirect."
    }
  ]
}

blocked tokens prefix-match each shell segment after tokenization with bypass hardening (env prefixes, wrappers, shell groups, -c recursion, quotes, heredocs, multiline scripts). bare: true blocks the command only when its output is piped or redirected. Known gaps (no full shell interpreter): timeout 60 cargo test, docker run ..., indirect execution.

secret-guard

.env.json at the workspace root listing environment variables treated as secret. Values in the JSON are ignored — only the keys matter; actual values are captured from process.env when a call runs. A sops key is skipped.

{
  "GITHUB_TOKEN": "",
  "OPENAI_API_KEY": ""
}

Even without .env.json, bash output still gets generic trailing-pattern redaction for *(SECRET|KEY|TOKEN|PASSWORD|PASS|APIKEY|CREDENTIAL|PRIVATE)=....

Scope notes (differences from pi)

  • env-protect covers the read tool only, like pi — bash cat .env is not blocked by it (sandbox filesystem deny patterns are the DSH-native layer for that; see sandbox-local policy).
  • Redaction runs on the tools/post-execute waterfall for every tool result with text content (bash, read, grep, job_output, job_list, web_search, web_fetch, ...), so secrets never reach the model-facing tools/result snapshot or the durable transcript. Raw output already stored by an earlier listener (e.g. a spill policy) is not retroactively redacted on disk.

Development

pnpm install
pnpm build
pnpm test

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/casualjim/dsh-plugins/dsh-heimdall)