Back to home@bailong-Hakuryu

dsh-security-assurance

DeepSeek Harness 策略驱动的仓库安全评估插件,支持包生命周期评估、证据、发现、裁决、导出和 /security 指令。 | Policy-driven repository security assurance plugin for DeepSeek Harness with package lifecycle assessments, evidence, findings, verdicts, exports, and /security routing.

Stars
0
Language
HTML
Created
Aug 31, 2026
Updated
Aug 31, 2026
GitHub repo

Introduction

DSH Security Assurance

DeepSeek Harness 的策略驱动仓库安全评估插件 · 中文默认,English below

Release License: MIT

安全评估主视觉

中文

这是什么

dsh-security-assuranceDeepSeek Harness 提供证据驱动的仓库安全评估。它通过公开的 Harness/Cordis 接口接入,不修改 Harness Core,并把评估过程封装为可查询、可恢复、可审计的版本化结果。

这是一个安全保障插件,不是通用漏洞扫描器。当前内建策略针对 Node 项目的 package.json 安装生命周期键存在性进行检查。

当前版本

  • 版本:0.1.0-rc.9
  • 状态:Release Candidate(预发布版)
  • 适配:DeepSeek Harness 0.1.2-alpha.1
  • GitHub:v0.1.0-rc.9 Release

支持范围

项目当前状态
评估模式REPOSITORY
支持 Subjectgit_revisionworkspace_snapshot
CHANGE 模式暂不支持
TARGETED 模式暂不支持
默认策略security/node-package-lifecycle
默认档案security/standard
支持平台Windows、Linux、macOS

评估会先读取当前 Host 注册的 Repository 和 Catalog;只有 Service 返回的精确 ID、模式、Subject、Target、Profile 和强化控制才能用于启动,不允许模型猜测路径或标识符。

安装(Harness Web)

要求 Node.js ^22.19.0 || >=24.0.0 和 DeepSeek Harness CLI。将终端当前目录设为要评估的 Git 仓库:

dsh plugin --profile web add D:\Downloads\dsh-security-assurance-0.1.0-rc.9.tgz
dsh --profile web --dump-config
dsh web

如果还要使用工程 Mission 门禁,请先安装 Engineering Control Plane,再安装本插件:

dsh plugin --profile web add D:\Downloads\dsh-engineering-control-plane-0.1.9.tgz
dsh plugin --profile web add D:\Downloads\dsh-security-assurance-0.1.0-rc.9.tgz
dsh --profile web --dump-config
dsh web

插件会把启动时的工作目录注册为 current-workspace。启动后建议先用 dsh --profile web --dump-config 检查组合;如果端口已被占用,请在 Harness Profile 中选择其他空闲端口。

用户如何调用

插件同时支持被动路由和主动指令:

被动调用(推荐):直接描述目标,模型会先获取可用仓库和评估目录,再按服务返回的选择启动评估。

请对当前仓库进行安全评估,并报告最终 Verdict 和 Findings。
检查当前项目的 package.json 安装生命周期配置。

主动调用:在 Harness Web 或 CLI 输入:

/security 评估当前仓库
/security 检查当前仓库的包安装生命周期

工具工作流

顺序工具作用
1security_repositories列出当前会话可见的已授权仓库
2security_catalog获取指定仓库支持的模式、Subject、Profile 和控制
3security_assessment_start用精确选择启动一次持久化评估
4security_assessment_status读取版本化状态、Coverage 和 Verdict
5security_assessment_findings分页读取脱敏 Finding 摘要
6security_assessment_resume仅按服务公布的合法动作恢复阻塞评估
7security_assessment_cancel按精确 revision 取消并等待外部工作静默
8security_assessment_export请求固定格式、固定目标的官方导出

推荐顺序是 repositories → catalog → start → status → findings。变更操作使用服务返回的精确 revision 和新的 idempotency_key;旧请求不会被自动重放。

返回结果与安全边界

  • 所有公共操作返回统一的 SecurityResult<T> envelope。
  • 命令返回不可变、带版本的 Receipt;查询返回按身份和 revision 绑定的 Snapshot。
  • Findings、Evidence 和导出内容遵循宿主授权、用途和脱敏规则。
  • 模型参数不接受凭据、数据库句柄、绝对路径或可执行对象;身份和权限由 Host 当前会话解析。
  • Registry、Assessment、Evidence 和导出状态保存在插件私有 SQLite 中,使用幂等键与 revision CAS 防止重复执行。
  • 缺失授权、状态冲突、超时、取消或外部失败会 fail closed,不会伪造满足结论。
  • workspace_snapshot 会读取工作区内容;在未完成本候选版安全审查项前,只应对可信仓库使用。详见 SECURITY-REVIEW.md

与 Engineering Control Plane 联用

两插件联用时,Control Plane 负责 Mission、工程 Evidence 和最终 Quality Gate;本插件只负责外部安全义务及其证据提交。安全评估失败或不确定会阻塞 Gate,但不会被转换成工程批准。

安装两者后,Control Plane 的可选 Provider 会按精确的 Provider ID、版本和 current-workspace 绑定本插件。两个插件不共享 SQLite、可写 Evidence 路径、事务或 Kernel 对象。

公开入口

入口作用
dsh-security-assurance根 Security Assurance Service
dsh-security-assurance/tools八个严格模型工具
dsh-security-assurance/contracts版本化公共契约
dsh-security-assurance/analyzer内建分析器接口
dsh-security-assurance/evaluation纯函数 Metrics Engine
dsh-security-assurance/host-repository-providerHost Repository 注册适配器
dsh-security-assurance/control-plane-provider可选 Control Plane 适配器
dsh-security-assurance/invariant启动就绪诊断
dsh-security-assurance/workbench-remote需要部署方认证解析器,默认禁用

常见排查

仓库列表为空:从目标 Git 仓库目录启动 Harness,并确认 Host Repository Provider 已加载;不要手工编造 Repository ID。

Catalog 显示 UNSUPPORTED:当前只支持 REPOSITORY 模式;确认使用的是已授权仓库和 security/standard Profile。

端口冲突:关闭占用端口的旧 Harness 进程,或在 Web Profile 中改用空闲端口后重新启动。

评估为 BLOCKED:先读取 security_assessment_statuslegalNextActions,只执行服务允许的 resumecancel

开发与验证

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm pack:dry-run
pnpm pack:profile-smoke
pnpm release:check

当前 v0.1.0-rc.9 发布门禁已通过:69 个测试文件、343 个测试,类型检查、构建、打包和 Harness Profile smoke 均通过。

完整领域模型见 CONTEXT.md,安全政策见 SECURITY.md,候选版审查见 SECURITY-REVIEW.md

English

What it is

dsh-security-assurance is an evidence-backed repository security assessment plugin for DeepSeek Harness. It integrates through public Harness and Cordis seams without modifying Harness Core, and exposes versioned, queryable, recoverable assessment results.

This is an assurance plugin, not a general vulnerability scanner. The built-in policy currently checks the presence of Node package install-lifecycle keys in package.json.

Current release

  • Version: 0.1.0-rc.9
  • Status: release candidate
  • Target Harness: 0.1.2-alpha.1
  • Release: v0.1.0-rc.9

Support matrix

ItemStatus
Assessment modeREPOSITORY
Subjectsgit_revision, workspace_snapshot
CHANGENot currently supported
TARGETEDNot currently supported
Default policysecurity/node-package-lifecycle
Default profilesecurity/standard
PlatformsWindows, Linux, macOS

The Service resolves authorized repositories and catalog choices first. Models must use the exact returned identifiers; paths and IDs are never guessed.

Install in Harness Web

Requires Node.js ^22.19.0 || >=24.0.0 and the DeepSeek Harness CLI:

dsh plugin --profile web add D:\Downloads\dsh-security-assurance-0.1.0-rc.9.tgz
dsh --profile web --dump-config
dsh web

When both plugins are installed, install Engineering Control Plane first because it supplies the shared invariant registry. The launcher working directory is registered as current-workspace.

Invocation

Natural-language requests are routed through the catalog-first workflow. Users can also run:

/security Assess the current repository and report the final verdict and findings.

The eight tools are security_repositories, security_catalog, security_assessment_start, security_assessment_status, security_assessment_findings, security_assessment_resume, security_assessment_cancel, and security_assessment_export. The normal order is repositories, catalog, start, status, and findings. Mutations require the exact Service revision and a fresh idempotency key.

Results and safety

All public operations return a typed SecurityResult<T> envelope. Commands return immutable versioned Receipts; queries return identity- and revision-bound Snapshots. Host authority resolves identity and permissions; model arguments never carry credentials, paths, database handles, or executable objects. Missing authorization, conflicts, timeouts, cancellation, and external failures fail closed.

Use workspace_snapshot only with trusted repositories until the candidate review items are addressed. See SECURITY-REVIEW.md.

Control Plane integration

Engineering Control Plane owns the Mission, engineering Evidence, and final Quality Gate. Security Assurance owns the external security obligation and its evidence. An unavailable, failed, or indeterminate security result blocks the Gate; it is never converted into approval. The two plugins do not share SQLite files, writable Evidence paths, transactions, or Kernel objects.

Development

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm pack:dry-run
pnpm pack:profile-smoke
pnpm release:check

Release v0.1.0-rc.9 passed with 69 test files and 343 tests, including typecheck, build, packaging, and Harness profile smoke.

License

MIT