惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
云风的 BLOG
云风的 BLOG
小众软件
小众软件
IT之家
IT之家
T
Tailwind CSS Blog
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
美团技术团队
博客园 - 叶小钗
V
V2EX
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
罗磊的独立博客
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
月光博客
月光博客
有赞技术团队
有赞技术团队

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
Policy: add policy file comparison command (#86768) · ope...
giodl73-repo · 2026-05-29 · via Recent Commits to openclaw:main

@@ -400,8 +400,41 @@ openclaw policy check --severity-min error

400400

attestation hashes. The same findings also appear in `openclaw doctor --lint`

401401

when the Policy plugin is enabled.

402402403-

Example clean JSON output includes stable hashes that can be recorded by an

404-

operator or supervisor:

403+

Compare an operator policy file to an authored baseline policy file:

404+405+

```bash

406+

openclaw policy compare --baseline official.policy.jsonc

407+

openclaw policy compare --baseline official.policy.jsonc --policy policy.jsonc --json

408+

```

409+410+

`policy compare` compares policy file syntax to policy file syntax. It does not

411+

inspect OpenClaw runtime state, evidence, credentials, or secrets. The command

412+

uses the same policy rule metadata that governs scoped overlays: allowlists must

413+

stay equal or narrower, denylists must stay equal or broader, required booleans

414+

must keep their required value, ordered strings must move only toward the more

415+

restrictive end of the configured order, and exact lists must match.

416+417+

The baseline file can be an organization-authored policy. The checked policy can

418+

use stricter values or add extra policy rules. A top-level checked rule can also

419+

satisfy a scoped baseline rule when it is equally or more restrictive because

420+

top-level policy applies broadly. Scope names do not need to match; scoped

421+

comparison is keyed by selector value such as `agentIds` or `channelIds` and by

422+

the policy field being checked.

423+424+

Example clean compare JSON output reports only policy-file comparison state:

425+426+

```json

427+

{

428+

"ok": true,

429+

"baselinePath": "official.policy.jsonc",

430+

"policyPath": "policy.jsonc",

431+

"rulesChecked": 3,

432+

"findings": []

433+

}

434+

```

435+436+

Example clean `policy check --json` output includes stable hashes that can be

437+

recorded by an operator or supervisor:

405438406439

```json

407440

{

@@ -647,6 +680,9 @@ Policy currently verifies:

647680

| `policy/policy-jsonc-invalid` | Policy cannot be parsed or contains malformed rule entries. |

648681

| `policy/policy-hash-mismatch` | Policy does not match configured `expectedHash`. |

649682

| `policy/attestation-hash-mismatch` | Current policy evidence no longer matches the accepted attestation. |

683+

| `policy/policy-conformance-invalid` | A baseline or checked policy file has invalid comparison syntax. |

684+

| `policy/policy-conformance-missing` | A checked policy file is missing a rule required by the baseline policy file. |

685+

| `policy/policy-conformance-weaker` | A checked policy file has a weaker value than the baseline policy file. |

650686

| `policy/channels-denied-provider` | An enabled channel matches a channel deny rule. |

651687

| `policy/mcp-denied-server` | A configured MCP server is denied by policy. |

652688

| `policy/mcp-unapproved-server` | A configured MCP server is outside the allowlist. |

@@ -838,10 +874,11 @@ configured channel:

838874839875

## Exit codes

840876841-

| Command | `0` | `1` | `2` |

842-

| -------------- | ----------------------------------------- | ------------------------------------------------ | ---------------------------- |

843-

| `policy check` | No findings at the threshold. | One or more findings met the threshold. | Argument or runtime failure. |

844-

| `policy watch` | No findings and accepted hash is current. | Findings exist or accepted attestation is stale. | Argument or runtime failure. |

877+

| Command | `0` | `1` | `2` |

878+

| ---------------- | ------------------------------------------------------ | ------------------------------------------------------------------- | ---------------------------- |

879+

| `policy check` | No findings at the threshold. | One or more findings met the threshold. | Argument or runtime failure. |

880+

| `policy compare` | The policy file is at least as strict as the baseline. | The policy file is invalid, missing, or weaker than baseline rules. | Argument or runtime failure. |

881+

| `policy watch` | No findings and accepted hash is current. | Findings exist or accepted attestation is stale. | Argument or runtime failure. |

845882846883

## Related

847884