dsh-redteam-model
SeaOf0
基于dsh web实现的多种模式,目的是服务于redteam进行授权的安全研究,覆盖渗透测试、红队评估、代码审计等范围领域,请勿用于非法行为。(允许二开,赋予模块各位自己的业务逻辑,方法论只有自己熟练的才好用,好的方法论=好的生态)
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yzhangjy/dsh-path-anonymizer
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
A DeepSeek Harness plugin that detects workspace-external file paths in user messages before model requests, replaces them with numbered placeholders ([PATH_n]), and prompts the user to confirm whether the real paths should be sent to the model.
dsh plugin --profile web add github:yzhangjy/dsh-path-anonymizer
Then restart the web profile.
Detection — regular expressions scan each user message for file paths.
Anonymization — each detected path is replaced with a numbered placeholder:
/Users/alice/Documents/project/src/main.ts → [PATH_1]
/etc/nginx/nginx.conf → [PATH_2]
~/secrets/.env → [PATH_3]
Workspace awareness — paths that resolve inside the agent's working
directory (cwd) are left untouched: the model already sees cwd in the
system prompt and can explore the workspace itself, so anonymizing those
would break coding with no privacy gain. Only paths outside the workspace
(~/..., /etc/..., other projects, …) are anonymized. Set
anonymizeWorkspacePaths: true to revert to anonymize-everything.
Confirmation — before the model request proceeds, a dialog appears listing every detected path and its placeholder. The user chooses:
[PATH_n]Session memory — the dialog includes a "remember" option so the same choice applies for the rest of the session.
Anonymization redacts only the user-message text. That does affect tool calls in one specific way:
[PATH_n] instead of the
real path, so it cannot call read / edit / bash on that path — it does
not know the real path. It will usually ask you to reveal it instead.This plugin is message redaction, not a security sandbox. It does not filter the model's own tool calls, tool arguments, or tool results, and it does not restrict filesystem access (DSH's sandbox governs that separately). A path the model learns from a tool result or from its own exploration is not anonymized.
Workspace paths are untouched, so reading and editing files inside the workspace works as usual.
| Key | Default | Description |
|---|---|---|
enabled |
true |
Enable path detection and anonymization |
confirmEveryTime |
true |
Show the confirmation dialog for every request |
maxPathsPerPrompt |
10 |
Max paths displayed in the confirmation dialog |
autoAnonymize |
false |
Silently replace paths without showing a dialog |
anonymizeWorkspacePaths |
false |
Also anonymize paths inside cwd (default keeps them for coding) |
detector.maxPaths |
50 |
Max distinct paths to detect in one batch |
detector.excludePatterns |
[] |
Extra regex patterns for paths to ignore |
detector.includeSystemPaths |
false |
Also detect system paths (/usr/lib/, /etc/, etc.) |
anonymizer.placeholderFormat |
[PATH_{n}] |
Placeholder format; {n} is the match index |
- id: path-anonymizer
config:
enabled: true
autoAnonymize: true # never shows a dialog
- id: path-anonymizer
config:
detector:
excludePatterns:
- '^/nix/store/'
- '^/home/ci/'
| Pattern | Example |
|---|---|
| Unix absolute | /Users/alice/project/src/index.ts |
| Windows absolute | C:\Users\alice\Documents\file.txt |
| Home directory | ~/.ssh/config |
Relative (./) |
./src/components/App.tsx |
Relative (../) |
../../config/database.yml |
| Windows relative | .\lib\utils.js |
| Env variable | %APPDATA%\MyApp\settings.json |
| WSL | \\wsl$\Ubuntu\home\user\file.txt |
https://, ftp://, file://)/dev/null, /dev/stdout)/usr/lib/, /etc/, /proc/, /sys/, C:\Windows\) when includeSystemPaths is false//)/)CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: privacy。