360 Secure SkillHub
360 安全技能中心

governance-guard

该 Skill 为智能体动作提供结构化权限分离:用意图 JSON 加策略预设(minimal、standard、strict)运行 PROPOSE-DECIDE-PROMOTE 流水线,返回批准、拒绝或升级裁决;升级需用户回复确认,评估出错时默认拒绝;决策写入哈希链审计日志并支持校验。需 Node 与 tsx 运行,治理数据保存在本地目录。

devongenerally-png
devongenerally-png
热度 56.09
最近更新 2026-05-11 17:27:36
分类:安全依赖:代码执行 / 读写文件应用场景:工作流 / 自动化脚本 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add governance-guard
Metadata
name
governance-guard
description
Structural authority separation for autonomous agent actions. Three-phase governance pipeline: PROPOSE, DECIDE, PROMOTE. No action is both proposed and approved by the same computational pathway.
version
0.1.0
metadata
{"author":"MetaCortex Dynamics LLC","license":"MIT","openclaw":{"requires":{"bins":["node","npx"]},"install":[{"kind":"node","package":"tsx","bins":["tsx"]}]}}

governance-guard

Governance guard enforces structural authority separation on all agent actions through a PROPOSE-DECIDE-PROMOTE pipeline.

When to activate

Before performing any write, execute, network, create, or delete action. The governance pipeline MUST be invoked before the action executes. Read actions may also be governed under standard or strict policies.

How to use

1. Full pipeline (recommended)

Run the complete PROPOSE → DECIDE → PROMOTE pipeline in a single call:

npx tsx scripts/governance.ts pipeline '<intent-json>' --policy policies/standard.yaml

The intent JSON must include:

  • skill: skill identifier
  • tool: tool/function being invoked
  • model: LLM model name
  • actionType: one of read, write, execute, network, create, delete
  • target: resource being acted upon
  • parameters: tool parameters (object)
  • dataScope: data categories accessed (array, e.g. ["personal", "financial"])
  • conversationId: current conversation ID
  • messageId: current message ID
  • userInstruction: the user message that triggered this action

2. Handle the verdict

The pipeline returns a JSON response:

  • If "governance": "approved" — proceed with the action
  • If "governance": "deny" — do NOT proceed; inform the user with the reason
  • If "governance": "escalate" — present the action to the user for approval:
Action requires your approval:
  Skill: <skill>
  Action: <actionType> on <target>
  Reason: <reason>
Reply APPROVE or DENY

Then resolve:

npx tsx scripts/governance.ts resolve-escalation <intent-id> approve
# or
npx tsx scripts/governance.ts resolve-escalation <intent-id> deny

3. Audit decisions

npx tsx scripts/governance.ts audit --last 10

Policy presets

Preset Default Description
minimal approve Blocks only credentials and destructive commands. Lowest friction.
standard deny Allows common ops, escalates network and data access. Recommended.
strict deny Reads only. Everything else requires explicit approval. Maximum safety.

Fail-closed guarantee

If any error occurs during governance evaluation, the default verdict is DENY. Missing policy files result in DENY ALL. This is by design. The system fails safe, never open.

Configuration

Governance data is stored in ~/.openclaw/governance/:

  • policy.yaml — active policy file
  • witness.jsonl — append-only, hash-chained audit log

Verify witness chain

npx tsx scripts/governance.ts verify

Any tampering with historical records is detected by recomputing the hash chain from genesis.