22-ai-00/dsh-enhanced--plugins-assistant-policy ↗★ 2

@dsh-enhanced/assistant-policy

提供智能体工具调用的安全策略管控 用于精细化控制工具执行权限,默认拒绝所有调用以确保安全。

包名
@dsh-enhanced/assistant-policy
兼容性
待验证
Harness 依赖范围
>=0.1.2-rc.1 <0.2.0
Cordis 依赖范围
^4.0.1
版本
0.1.33
许可证
MIT
最近更新
2026年9月13日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:22-ai-00/dsh-enhanced#d5a223edf3d73b0297a36b3e10f8d24142f94153&path:plugins/assistant-policy

最小配置

下面只允许 primary preset 在指定 workspace 的前台会话读取文件;bash 和后台任务仍会被拒绝:

- id: dsh-enhanced-assistant-policy
  name: '@dsh-enhanced/assistant-policy'
  config:
    databasePath: !!js dshHomePath('assistant-policy/policy.sqlite')
    proposalMaintenanceIntervalMs: 15000
    toolDefaultEffect: deny
    autoReview:
      enabled: true
      timeoutMs: 30000
      maxTokens: 512
    rules:
      - id: allow-primary-workspace-read
        effect: allow
        subject:
          kind: agent
          id: primary
          workspace: /absolute/path/to/workspace
        actions: [execute]
        resource:
          kind: tool
          id: read
        context:
          initiators: [foreground]
    budgets: []

匹配支持完整字符串中的 * 通配符。任意匹配的 deny 都优先于 allow;同 effect 先选更具体的规则,再按声明顺序决定。工具身份来自 DSH 0.1.2-rc.1 的 Agent.session.header.agentPreset 与绝对 cwd,缺少 agent、preset 或 workspace 时直接拒绝,调用方参数不能伪造这些字段。