Borrowing it
Nothing to install: this file belongs to ShanHaiFish/dsh-plugin-security-review. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ShanHaiFish/dsh-plugin-security-review/main/AGENTS.mdgit clone --depth 1 https://github.com/ShanHaiFish/dsh-plugin-security-reviewWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/shanhaifish/dsh-plugin-security-review/agents-md)<a href="https://agentmods.dev/instructions/shanhaifish/dsh-plugin-security-review/agents-md"><img src="https://agentmods.dev/badge/instructions/shanhaifish/dsh-plugin-security-review/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/shanhaifish/dsh-plugin-security-review/agents-md"><img src="https://agentmods.dev/badge/instructions/shanhaifish/dsh-plugin-security-review/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01751 | $0.01751 |
| Opus 5.5 | $0.00700 | $0.00700 |
| Sonnet 5.5 | $0.00350 | $0.00350 |
| Haiku 4.5 | $0.00175 | $0.00175 |
Grade A, and why
dsh-plugin-security-review AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — dsh-plugin-security-review
DSH 插件安装安全审查守卫:对 cordis_define / cordis_run 安装或运行的动态插件源码做静态安全审查,按安全优先策略拦截;同时提供 plugin_security_review / plugin_security_audit 两个审查工具。
仓库形态
本项目包含两种可安装形态,静态 bundle 是推荐形态(v1.5.0 起):
| 路径 | 形态 | 说明 |
|---|---|---|
package.json + cordis.patch.yml + lib/ |
静态 bundle(推荐) | dsh plugin add 安装后随 profile 层栈自动加载,开机自启动,跨 DSH 进程存续 |
manifest.json + package-source.js |
动态插件回退形态(v1.4.0) | 仅用于无 bundle 能力的 profile,需在每次重启后重新 cordis_define / cordis_run |
tests/gate.test.mjs |
动态形态行为测试 | node tests/gate.test.mjs |
tests/static.test.mjs |
静态形态行为测试 | node tests/static.test.mjs |
常用命令
# 安装(静态 bundle,推荐)
dsh plugin --profile web add dsh-plugin-security-review
dsh plugin --profile web add file:/path/to/dsh-plugin-security-review # 本地未发布时(路径不能含空格)
# 测试(两种形态各自的行为测试,无需构建)
node tests/gate.test.mjs
node tests/static.test.mjs
# 升级守卫(静态)
dsh plugin --profile web update dsh-plugin-security-review
本项目无构建步骤:
lib/index.js是直接可运行的 ESM 源码。
代码结构
lib/index.js— 守卫全部实现(约 1070 行,单文件)。命名导出name/inject/apply(Cordis 静态插件约定):经ctx.tools.register(defineTool(...))注册工具,经ctx.on('tools/pre-execute')拦截安装;v1.7.0 起经ctx.inject(['webServer'], cb)挂审批弹窗路由,并携带client/client.jsClient 半端(dsh.client声明 +exports["./client"])。lib/index.d.ts— 类型声明。client/client.js— 浏览器审批弹窗(拒绝 / 同意+白名单 / 同意),__ModuleLoader__bundle 格式(照 dshmarket),无构建步骤;经shell.overlay浮层渲染。重试消息经connection.api.sessions.prompt注入到来源会话(entry.agentId,守卫拦截时从exec.agent记录),不依赖全局session/subscribed帧。cordis.patch.yml— bundle patch,把插件以id: plugin-security-gate插入 profile 层栈。package-source.js— 动态形态的 host 源码(与lib/index.js功能同源,含LINEAGE_TOKEN谱系令牌)。manifest.json— 动态形态的插件元数据(plugin/name/purpose/tools/notes)。tests/— 两种形态的行为测试,直接node运行,无测试框架依赖。
核心规则(修改时必须保持的约定)
- 判定策略(安全优先,fail-closed):BLOCK = critical>0 或 high≥2 或 总分≥100;ASK = high≥1 或 总分≥40;WARN = 总分≥10;其余 ALLOW。审批禁用时 seam 模式 ASK 等效拒绝。
- 审批弹窗 askMode(静态 bundle,v1.8.0):ASK 判定默认
popup——挂起审批(记录来源会话 idagentId+ 白名单类型whitelistType)+ deny + 浏览器「拒绝/同意+白名单/同意」弹窗。approve(同意)只写approved指纹;approveTrusted(同意+白名单)另把插件族写入 trusted-local(new→prefixes,existing/run→pluginIds),同族安装/开发不再重复弹窗;白名单写入 best-effort,失败不影响指纹批准,读取侧 fail-closed 不变。同意/同意+白名单后由守卫注入到来源会话让 agent 自动重试(修复多会话下投错会话 Bug)。config.json设{"askMode":"seam"}回退官方审批 seam。BLOCK 一律硬拒绝不经弹窗;弹窗仅静态 bundle 提供,动态回退形态 ASK 仍走 seam。禁止把弹窗/同意逻辑接到 BLOCK 或自动放行。 - 风险权重:critical=100, high=40, medium=15, low=4,总分上限 300;
CAPABILITIES:声明项计分减半(最低 1 分)。 - 拦截点:
cordis_define/cordis_run的tools/pre-execute事件;源码不可检索时一律 fail-closed(ask)。 - 静态形态无自升级豁免:所有动态插件一律审查,不允许存在任何前缀/谱系令牌绕过。
- 操作者白名单 trusted-local:
<DSH_HOME>/storages/plugin-security-gate/trusted-local.json(prefixes/pluginIds/fingerprints)命中即直接放行并留审计痕迹;信任锚=有文件权限的操作者,非 agent 自我声明;文件不存在/损坏 = 无白名单(fail-closed 方向不变);cordis_stop/cordis_undefine自我保护不受白名单影响。禁止把"调用者是本会话 agent"作为自动放行条件。 - 跨会话批准持久化:人工批准的 ASK 代码指纹(host+client sha256)写入
<DSH_HOME>/storages/plugin-security-gate/state.json,命中指纹自动放行。 - 自我保护边界:静态 bundle 无法经
cordis_stop/cordis_undefine停用,只能由有文件权限的操作者dsh plugin remove卸载。 - 已知限制:组合判定是静态 presence 判定(可能误报/漏报);深度混淆有盲区;本守卫不是对抗恶意 actor 的安全边界。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +27 tokens per session c42874fb7d53
- 1mo ago First seen · 60 lines · 1,724 tokens per session scan A 77819a24c498
dsh-plugin-security-review AGENTS.md is an instructions file published in the GitHub repository ShanHaiFish/dsh-plugin-security-review (2 stars, last pushed 1mo ago), licensed MIT. It adds 1,751 tokens to every session, about $0.0070 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.