/gov_brain_audit
Purpose
Audit Brain Docs conservatively to reduce two recurring risks:
- Action-before-verification behavior
- Unsupported certainty/completion claims without evidence
- Evidence/report mismatches that can hide governance drift
Runtime integration:
- Governance runtime may suggest this preview before write-capable actions.
- Post-command windows (after
gov_setup upgrade, gov_migrate, gov_audit) trigger advisory nudge only (not hard block).
- Hard blocks only apply to high-risk writes (Brain Docs,
openclaw.json) on the 3rd+ attempt without evidence.
- Session/gateway start should default to nudge-only (not hard block) to avoid daily-flow self-lock.
Single-entry UX:
- Run
/gov_brain_audit -> read-only preview (default)
- Approve selected items with
/gov_brain_audit APPROVE: ...
- Roll back approved changes with
/gov_brain_audit ROLLBACK (only after apply)
In scope
Brain Docs and governance docs that shape agent behavior:
AGENTS.md
SOUL.md
IDENTITY.md
USER.md
TOOLS.md
MEMORY.md
HEARTBEAT.md
BOOT.md
_control/GOVERNANCE_BOOTSTRAP.md
_control/PRESETS.md
_control/REGRESSION_CHECK.md
_control/ACTIVE_GUARDS.md (if present)
_control/LESSONS.md (if present)
- Recent
memory/*.md (last 7 days; if present)
- Recent
_runs/*.md (sample latest 10; read-only)
Hard principles
- Preserve persona intent; do not flatten voice.
- Use minimal-diff edits only.
- Preview first; never apply before operator approval.
- Do not delete user content without explicit approval.
- If evidence is missing, mark uncertainty instead of guessing.
- Semantic-first, language-agnostic review is mandatory (global users; not keyword-limited).
- Keyword examples are only hints; absence of a listed keyword is not evidence of safety.
Trigger contract
- Preview mode (default):
- Triggered by
/gov_brain_audit (or /skill gov_brain_audit) without approval/rollback token.
- Read-only: no file writes.
- Apply mode:
- Triggered when operator message includes
/gov_brain_audit APPROVE: ....
- Approval formats:
APPROVE: <PASTE_IDS_FROM_PREVIEW>
APPROVE: APPLY_ALL_SAFE (High + Medium)
APPROVE: APPLY_ALL
PASTE_IDS_FROM_PREVIEW means finding IDs from the current preview output; IDs like F001 are examples only.
- Rollback mode:
- Triggered when operator message is
/gov_brain_audit ROLLBACK.
- Optional explicit path form:
/gov_brain_audit ROLLBACK: <backup-path>.
- Valid only if a prior apply backup exists.
Input contract
- Do not require users to memorize subcommands.
- If approval token is missing, stay in preview mode.
- If
APPROVE: is malformed or references unknown finding IDs, stop with BLOCKED.
- If
ROLLBACK is requested but no backup exists, stop with BLOCKED.
Required workflow
- Classify mode:
- Preview -> read-only
- Apply/Rollback -> Mode C (
PLAN -> READ -> CHANGE -> QC -> PERSIST)
- For preview, return:
- Semantic Review (required): evaluate intent/meaning across all languages in-scope, not only token matches
- If available, run
tools/brain_audit_rules.mjs as deterministic cross-check (supplement only; not final authority)
- Default script mode should stay structural-only (evidence format/integrity checks).
- If
--enable-lexical-hints is used, treat LEXICAL_HINT_* findings as advisory only; semantic review must confirm before escalation/blocking.
- Executive Summary (risk level + top root causes)
- Findings sorted by severity (ID, file:line, risky text, why risky, keep intent, proposed fix)
- Patch Preview (BEFORE/AFTER snippets only; no write)
- Approval Checklist
- Next-step hint with
APPROVE: template
- For apply:
- Backup all target files before change.
- Apply only approved findings.
- Validate:
- persona preserved
- high-risk triggers reduced or guarded
- no new rule conflicts introduced
- Persist run report + update index if required.
- For rollback:
- Restore backed up files.
- Persist rollback report.
Risk classes (semantic-first; examples only)
- Action-before-verification intent:
- "immediately", "do not wait", "always act", "唔使等指令", "即刻"
- Unsupported certainty/completion intent:
- "always answer", "never uncertain", "must complete"
- Completion-claim leakage:
- declares done/pass without evidence fields
- Evidence mismatch:
- claims file read but file missing
- Memory pollution:
- speculative words ("likely", "可能", "估計") written as facts
Deterministic script classes (supplement only)
COMPLETION_WITHOUT_EVIDENCE
READ_CLAIM_MISMATCH
LEXICAL_HINT_* (optional mode only) is low-signal advisory and never a sole block reason.
Important:
- Treat examples above as non-exhaustive.
- Include semantically equivalent phrasing in any language/script.
- Never use keyword-only pass/fail as the final decision for high-risk classes.
Output requirements (UX)
Use branded output format (match formatCommandOutput style):
- First line:
🐾 OpenClaw Governance · /gov_brain_audit
───────────────────────────────── dividers between sections
- Status line: emoji prefix +
STATUS on first line, status value on next line
- ✅ PASS/READY, ⚠️ WARN/PARTIAL, ❌ BLOCKED/FAIL, ℹ️ INFO
- Bullet items:
• prefix (not - )
- Next step:
👉 prefix on action text
- Commands: indented with 2 spaces (no
COMMAND TO COPY label)
Example (preview mode):
🐾 OpenClaw Governance · /gov_brain_audit
─────────────────────────────────
⚠️ STATUS
FINDINGS_DETECTED
• files_scanned: 14
• findings: 2 HIGH, 1 MEDIUM, 0 LOW
• top_risk: action-before-verification in HEARTBEAT.md:12
─────────────────────────────────
[Findings table + Patch Preview here]
─────────────────────────────────
👉 Review findings above, then approve selected items.
/gov_brain_audit APPROVE: F001,F002
fallback: /skill gov_brain_audit APPROVE: F001,F002
Always provide one primary next command and one /skill ... fallback.
If a backup does not exist yet, do not suggest rollback in next-step options.
Fallback
If slash routing is unstable:
/skill gov_brain_audit
/skill gov_brain_audit APPROVE: ... or /skill gov_brain_audit ROLLBACK as needed
1---2name: gov-brain-audit3description: Gov Brain Audit4---5# /gov_brain_audit67## Purpose8Audit Brain Docs conservatively to reduce two recurring risks:91. Action-before-verification behavior102. Unsupported certainty/completion claims without evidence113. Evidence/report mismatches that can hide governance drift1213Runtime integration:141. Governance runtime may suggest this preview before write-capable actions.152. Post-command windows (after `gov_setup upgrade`, `gov_migrate`, `gov_audit`) trigger advisory nudge only (not hard block).163. Hard blocks only apply to high-risk writes (Brain Docs, `openclaw.json`) on the 3rd+ attempt without evidence.174. Session/gateway start should default to nudge-only (not hard block) to avoid daily-flow self-lock.1819Single-entry UX:201. Run `/gov_brain_audit` -> read-only preview (default)212. Approve selected items with `/gov_brain_audit APPROVE: ...`223. Roll back approved changes with `/gov_brain_audit ROLLBACK` (only after apply)2324## In scope25Brain Docs and governance docs that shape agent behavior:261. `AGENTS.md`272. `SOUL.md`283. `IDENTITY.md`294. `USER.md`305. `TOOLS.md`316. `MEMORY.md`327. `HEARTBEAT.md`338. `BOOT.md`349. `_control/GOVERNANCE_BOOTSTRAP.md`3510. `_control/PRESETS.md`3611. `_control/REGRESSION_CHECK.md`3712. `_control/ACTIVE_GUARDS.md` (if present)3813. `_control/LESSONS.md` (if present)3914. Recent `memory/*.md` (last 7 days; if present)4015. Recent `_runs/*.md` (sample latest 10; read-only)4142## Hard principles431. Preserve persona intent; do not flatten voice.442. Use minimal-diff edits only.453. Preview first; never apply before operator approval.464. Do not delete user content without explicit approval.475. If evidence is missing, mark uncertainty instead of guessing.486. Semantic-first, language-agnostic review is mandatory (global users; not keyword-limited).497. Keyword examples are only hints; absence of a listed keyword is not evidence of safety.5051## Trigger contract521. Preview mode (default):53 - Triggered by `/gov_brain_audit` (or `/skill gov_brain_audit`) without approval/rollback token.54 - Read-only: no file writes.552. Apply mode:56 - Triggered when operator message includes `/gov_brain_audit APPROVE: ...`.57 - Approval formats:58 - `APPROVE: <PASTE_IDS_FROM_PREVIEW>`59 - `APPROVE: APPLY_ALL_SAFE` (High + Medium)60 - `APPROVE: APPLY_ALL`61 - `PASTE_IDS_FROM_PREVIEW` means finding IDs from the current preview output; IDs like `F001` are examples only.623. Rollback mode:63 - Triggered when operator message is `/gov_brain_audit ROLLBACK`.64 - Optional explicit path form: `/gov_brain_audit ROLLBACK: <backup-path>`.65 - Valid only if a prior apply backup exists.6667## Input contract681. Do not require users to memorize subcommands.692. If approval token is missing, stay in preview mode.703. If `APPROVE:` is malformed or references unknown finding IDs, stop with `BLOCKED`.714. If `ROLLBACK` is requested but no backup exists, stop with `BLOCKED`.7273## Required workflow741. Classify mode:75 - Preview -> read-only76 - Apply/Rollback -> Mode C (`PLAN -> READ -> CHANGE -> QC -> PERSIST`)772. For preview, return:78 - Semantic Review (required): evaluate intent/meaning across all languages in-scope, not only token matches79 - If available, run `tools/brain_audit_rules.mjs` as deterministic cross-check (supplement only; not final authority)80 - Default script mode should stay structural-only (evidence format/integrity checks).81 - If `--enable-lexical-hints` is used, treat `LEXICAL_HINT_*` findings as advisory only; semantic review must confirm before escalation/blocking.82 - Executive Summary (risk level + top root causes)83 - Findings sorted by severity (ID, file:line, risky text, why risky, keep intent, proposed fix)84 - Patch Preview (BEFORE/AFTER snippets only; no write)85 - Approval Checklist86 - Next-step hint with `APPROVE:` template873. For apply:88 - Backup all target files before change.89 - Apply only approved findings.90 - Validate:91 - persona preserved92 - high-risk triggers reduced or guarded93 - no new rule conflicts introduced94 - Persist run report + update index if required.954. For rollback:96 - Restore backed up files.97 - Persist rollback report.9899## Risk classes (semantic-first; examples only)1001. Action-before-verification intent:101 - "immediately", "do not wait", "always act", "唔使等指令", "即刻"1022. Unsupported certainty/completion intent:103 - "always answer", "never uncertain", "must complete"1043. Completion-claim leakage:105 - declares done/pass without evidence fields1064. Evidence mismatch:107 - claims file read but file missing1085. Memory pollution:109 - speculative words ("likely", "可能", "估計") written as facts110111### Deterministic script classes (supplement only)1121. `COMPLETION_WITHOUT_EVIDENCE`1132. `READ_CLAIM_MISMATCH`1143. `LEXICAL_HINT_*` (optional mode only) is low-signal advisory and never a sole block reason.115116Important:1171. Treat examples above as non-exhaustive.1182. Include semantically equivalent phrasing in any language/script.1193. Never use keyword-only pass/fail as the final decision for high-risk classes.120121## Output requirements (UX)122Use branded output format (match `formatCommandOutput` style):1231. First line: `🐾 OpenClaw Governance · /gov_brain_audit`1242. `─────────────────────────────────` dividers between sections1253. Status line: emoji prefix + ` STATUS` on first line, status value on next line126 - ✅ PASS/READY, ⚠️ WARN/PARTIAL, ❌ BLOCKED/FAIL, ℹ️ INFO1274. Bullet items: ` •` prefix (not `- `)1285. Next step: `👉` prefix on action text1296. Commands: indented with 2 spaces (no `COMMAND TO COPY` label)130131Example (preview mode):132```133🐾 OpenClaw Governance · /gov_brain_audit134─────────────────────────────────135136⚠️ STATUS137FINDINGS_DETECTED138139 • files_scanned: 14140 • findings: 2 HIGH, 1 MEDIUM, 0 LOW141 • top_risk: action-before-verification in HEARTBEAT.md:12142143─────────────────────────────────144[Findings table + Patch Preview here]145146─────────────────────────────────147👉 Review findings above, then approve selected items.148149 /gov_brain_audit APPROVE: F001,F002150 fallback: /skill gov_brain_audit APPROVE: F001,F002151```152153Always provide one primary next command and one `/skill ...` fallback.154If a backup does not exist yet, do not suggest rollback in next-step options.155156## Fallback157If slash routing is unstable:1581. `/skill gov_brain_audit`1592. `/skill gov_brain_audit APPROVE: ...` or `/skill gov_brain_audit ROLLBACK` as needed160