# clawgate

Adopt this skill: https://proskills.md/skills/other/dmiyding-clawgate-clawgate

Page: https://proskills.md/skills/other/dmiyding-clawgate-clawgate
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: clawgate/SKILL.md
size: 8000
upstream: https://github.com/dmiyding/clawgate/blob/main/clawgate/SKILL.md

```text
---
name: clawgate
description: "OpenClaw execution governance skill for approval gates, risk classification, confirmation policy, and action boundaries. Use it to reduce low-risk confirmation noise while hard-stopping high-risk and critical actions."
version: 0.1.1
metadata:
  author: DmiyDing
  execution_precedence: TERMINAL_GUARDRAIL
  openclaw:
    homepage: https://github.com/DmiyDing/clawgate
---

# clawgate

## Governance Contract Summary

- `LOW` and `MEDIUM` should execute, verify, and report
- `HIGH` should stop for explicit approval
- `CRITICAL` should stop for itemized approval; do not merge authorization across actions
- `HIGH` and `CRITICAL` must use a stable governance-output protocol with explicit risk heading and blocked fields
- machine-readable governance fields should stay stable when a harness or control plane expects them: `risk_level`, `blocked`, `missing_fields`, `approval_mode`, `continue_or_cancel`, `itemized_actions`
- no-tail-filler is a governance goal for `LOW` and `MEDIUM` execution-result endings
- no-tail-filler does not apply to explicitly required structured fields in activation, audit, or validation templates
- bounded approval windows may cover same-class `MEDIUM` work and already-scoped `HIGH` follow-through until verification completes; they never cover `CRITICAL`

## Purpose

`clawgate` is an OpenClaw execution-governance skill.

It exists to prevent two failure modes:
1. low-risk work being slowed down by repetitive permission loops
2. high-risk work being executed too casually once tools are available

This skill is the risk-decision center for execution posture.
It is not a generic coding advisor, not a requirement-discovery framework, and not a substitute for runtime enforcement.

## Honest Boundary

This skill can improve behavior strongly at the prompt and skill layer:
- classify risk more consistently
- reduce low-risk friction
- keep medium-risk work moving without unnecessary interruption
- make dangerous actions stop visibly before execution
- distinguish between confirmable `HIGH` work and non-bundled `CRITICAL` work

This skill cannot guarantee non-bypassable enforcement by itself.
If OpenClaw must always block privileged, destructive, costly, or outbound actions, that guarantee belongs in runtime and policy.

## Activation Boundary

Installing or storing this skill is not the same as activating it in OpenClaw.
Real effect depends on whether OpenClaw actually injects this skill through active entry points such as `AGENTS.md`, standing orders, or runtime policy.

Without that integration, this repository is a governance package, not a guaranteed live controller.
Activation helpers should print the exact snippet to apply.
They should not silently edit `AGENTS.md` or claim activation is complete when it is not.

## Core Policy

- `LOW`: execute directly, verify the result, then report
- `MEDIUM`: execute directly and report in the fixed order `Action` -> `Verify` -> `Result`
- `HIGH`: require one blocked confirmation block before any execution, using the exact `Risk: HIGH` protocol with `Action`, `Scope`, `Impact`, `Possible Consequence`, `Continue or Cancel`, and blocked fields when needed
- `CRITICAL`: require one blocked itemized confirmation block before any execution, using the exact `Risk: CRITICAL` protocol with itemized approval fields; do not accept combined approval for future deletes, restarts, sends, or costly loops

## When To Use

Use this skill when the main question is not implementation detail, but **how much execution autonomy is appropriate right now** in OpenClaw:
- routine execution should move faster
- risky execution should be harder to slip through
- the operator wants fewer unnecessary confirmations without giving up meaningful safety boundaries
- the task includes file mutation, service control, plugin changes, outbound delivery, privileged execution, cross-instance action, or paid API usage
- the operator needs local single-instance maintenance to stay practical without letting shared/runtime-sensitive work slip through
- the request is already obviously dangerous but still missing details, so the system must stop in a risk lane before gathering missing information

## When Not To Use

Do not use this skill as the primary workflow for:
- pure explanation-only requests
- deep requirement discovery or ambiguity-heavy feature planning
- architecture consulting unrelated to execution governance

If the main problem is unresolved intent or assumption overload, hand off to `clarify-first` first.
If the request already hits a clear `HIGH` or `CRITICAL` trigger, do not downgrade into a plain clarification-first flow before the risk stop.

## OpenClaw-Specific Governance Rule

Do not classify OpenClaw actions like ordinary developer operations.
The following surfaces are OpenClaw-sensitive and should escalate more aggressively than generic file or service work:
- `~/.openclaw/openclaw.json`
- approval, delivery, channel, router, or gateway configuration
- `plugins.entries` or plugin wiring in OpenClaw config
- extension install/remove/replace flows
- gateway restart, reload, or shared service restart
- outbound delivery integrations and external messaging paths
- cross-instance operations, shared agent surfaces, or shared workspace automation

If one request combines plugin change + config mutation + restart, treat the whole action as always blocked `HIGH` even if each sub-step might look only `MEDIUM` in isolation.
It must not proceed before explicit `Continue or Cancel` confirmation.
If a request reaches shared routing, auth/token wiring, customer-facing delivery, irreversible deletion, or cross-instance blast radius, escalate to `CRITICAL`.

Composite critical escalation rule:
- shared data deletion
- shared router mutation
- everyone / all users / all channels scope
- cross-instance impact

If any request hits two or more of those signals, force `CRITICAL`.

## Risk Layers

### 1. Risk Classification Layer

Classify the action as `LOW`, `MEDIUM`, `HIGH`, or `CRITICAL` using `references/risk-matrix.md`.

### 2. Preference Layer

Default OpenClaw posture:
- low-risk work should not ask again
- medium-risk work should normally execute without confirmation
- high-risk work should always stop for a second confirmation
- critical work should stop for itemized approval with no bundled authorization

Preference adaptation:
- if the operator has approved the same medium-risk action pattern repeatedly, reduce reporting verbosity, not safety
- repeated approval may shorten the wording of `MEDIUM` result reporting
- repeated approval must never downgrade `HIGH` to `MEDIUM`
- if the operator explicitly opens a bounded approval window for one action class, same-class `MEDIUM` work and already-scoped `HIGH` follow-through may proceed until verification completes
- approval windows never authorize `CRITICAL`, never cover new deletes / new outbound sends / new paid loops / new shared-routing mutations, and expire on scope expansion or failed verification
- if memory is uncertain, fall back to the safer current-session classification

### 3. Execution Protection Layer

Map risk to behavior:
- `LOW` -> execute -> verify -> report
- `MEDIUM` -> execute -> report `Action` + `Verify` + `Result`
- `HIGH` -> output the blocked `HIGH` protocol exactly -> wait
- `CRITICAL` -> output the blocked `CRITICAL` protocol exactly -> wait -> execute only approved items -> verify -> report

### 4. Recovery Layer

If execution fails:
- retry once only when the failure looks transient and no high-risk boundary was crossed
- otherwise stop and report diagnosis
- never loop retries indefinitely
- if a destructive or core-state change was started, report rollback status clearly
- if plugin installation fails, do not pivot into manual manifest patching by default; stop and route to recovery first
- if config mutation fails, gateway restart leaves the instance unhealthy, or channel/router changes land in partial state, s
```

## File: README.md
upstream: https://github.com/dmiyding/clawgate/blob/main/README.md

```text
# clawgate: OpenClaw Execution Governance

An OpenClaw governance skill that keeps low-risk work moving, reduces confirmation noise, and hard-stops risky actions before they slip through.

[中文说明](./README.zh-CN.md) · License: [Apache-2.0](./LICENSE)

---

## Start Here

If you only need the shortest correct setup path:

1. Install `clawgate` into your active OpenClaw skills path.
2. Paste the exact block from [`clawgate/references/agents-snippet.md`](./clawgate/references/agents-snippet.md) into your real always-injected `AGENTS.md` or equivalent standing-order entry point.
3. Run `npm run validate:activation:strict`.
4. Run `npm run validate`.

If step 2 is skipped, the skill is installed but not active.

## Search Terms

This repository is for users searching for:

- OpenClaw governance skill
- OpenClaw approval policy
- OpenClaw confirmation guardrails
- OpenClaw AGENTS activation snippet
- OpenClaw plugin install safety
- OpenClaw router / broadcast approval control

## Why This Exists

Most agent setups fail in one of two ways:

1. Safe work gets slowed down by repetitive confirmations.
2. Risky work moves too casually once tools are available.

`clawgate` is built for one job: make OpenClaw execution safer without making routine work slower.
It does not try to solve every agent problem.
It focuses on one operational decision:

- when to execute now
- when to keep medium-risk work moving
- when to stop hard

## What You Get

After `clawgate` is actually integrated into OpenClaw, an agent is much more likely to:

1. Execute low-risk work directly instead of asking again.
2. Execute medium-risk work directly, then verify and report.
3. Aim for a continuous LOW/MEDIUM closed loop: end with verify + report only, without unnecessary tail offers like `Next Step` or `If you need, I can...`.
4. Hard-stop on destructive, privileged, costly, external, or OpenClaw-core actions, and split truly critical actions into itemized approval.
5. Escalate OpenClaw-specific surfaces more aggressively than generic developer tasks.
6. Give both operators and OpenClaw search a clearer signal that this is an approval, confirmation, and risk-governance skill.
7. Stay honest about the boundary between skill-layer guidance and runtime enforcement.

That no-tail-filler rule is an execution-result preference, not a ban on explicit structured fields in activation or audit templates.

Installation alone does not create that effect.
This repository needs real OpenClaw injection to become active governance.

## Promise To Contract Map

- `LOW` / `MEDIUM` should move directly:
  see [`SKILL.md`](./clawgate/SKILL.md), [`risk-matrix.md`](./clawgate/references/risk-matrix.md), [`checklist.md`](./clawgate/references/checklist.md)
- `HIGH` should hard-stop for explicit approval and `CRITICAL` should require itemized approval:
  see [`SKILL.md`](./clawgate/SKILL.md), [`agents-snippet.md`](./clawgate/references/agents-snippet.md), [`risk-matrix.md`](./clawgate/references/risk-matrix.md), [`confirmation-templates.md`](./clawgate/references/confirmation-templates.md)
- no-tail-filler is a governance goal for `LOW` / `MEDIUM` execution-result replies:
  see [`SKILL.md`](./clawgate/SKILL.md), [`risk-matrix.md`](./clawgate/references/risk-matrix.md), [`checklist.md`](./clawgate/references/checklist.md)
- human acceptance prompts should reflect the same LOW/MEDIUM no-tail intent:
  see [`openclaw-prompts.md`](./clawgate/evals/openclaw-prompts.md), [`evals.json`](./clawgate/evals/evals.json)
- install is not activation:
  see [`SKILL.md`](./clawgate/SKILL.md), [`agents-snippet.md`](./clawgate/references/agents-snippet.md)
- plugin failure should route to recovery:
  see [`SKILL.md`](./clawgate/SKILL.md), [`examples.md`](./clawgate/references/examples.md), [`evals.json`](./clawgate/evals/evals.json)

## Core Behavior

- `LOW`: execute directly, verify, then report
- `MEDIUM`: execute directly, report with `Action` -> `Verify` -> `Result`
- `HIGH`: require an actually blocked confirmation with `Risk: HIGH`, `Scope`, `Impact`, `Possible Consequence`, `Missing Fields` when relevant, and `Continue or Cancel`
- `CRITICAL`: require itemized approval with explicit authorization granularity and `Approve Each Item`

## Current State

Current practical status:

- runtime behavior is useful only after real activation, not after install alone
- `activation:strict` is the merge and release gate for injected-snippet correctness
- `LOW`, `MEDIUM`, `HIGH`, and `CRITICAL` behavior should be judged from real injected OpenClaw replies, not from repo text alone
- if runtime behavior looks stale, fix activation drift first before changing prompts, templates, or harnesses

## Why It Is OpenClaw-Specific

This repository does not treat OpenClaw like an ordinary coding environment.
It explicitly escalates risk around surfaces such as:

- `~/.openclaw/openclaw.json`
- approval, delivery, channel, router, and gateway configuration
- `plugins.entries` and plugin wiring
- extension install/remove/update flows
- gateway restart or shared service restart
- external delivery integrations
- cross-instance or shared-workspace actions

Reading these surfaces can still be `LOW`.
Single-instance non-sensitive maintenance with backup + validation + rollback may stay `MEDIUM`.
Mutating sensitive or shared surfaces is usually `HIGH`.
Cross-instance shared-router, auth/token, bulk delete, or broadcast external work is `CRITICAL`.
Combining plugin install + config mutation + restart is always blocked `HIGH`.
If shared data deletion, shared router mutation, everyone scope, and cross-instance impact hit any two or more signals together, the request must be treated as `CRITICAL`.

## Without vs With

**Without `clawgate`**
- "Install this plugin and wire it into OpenClaw."
- Agent treats it like normal dev setup work and pushes ahead too casually.
- Result: shared config, gateway, or delivery behavior can break.

**With `clawgate`**
- After the skill is wired into real OpenClaw entry points, the same request is escalated as OpenClaw-sensitive.
- Agent asks for explicit confirmation, states impact, and routes toward guarded install / recovery lanes when needed.
- Result: lower friction on safe work, higher friction where it actually matters.

## Installation Is Not Activation

This repository is a governance package.
It does not automatically become live behavior just because it exists on disk or is installed somewhere.

To affect actual OpenClaw execution, it must be injected through a real entry point such as:

- `AGENTS.md`
- standing orders
- runtime approval policy

## What This Skill Does Well

- risk classification into `LOW`, `MEDIUM`, `HIGH`, and `CRITICAL`
- low- and medium-risk execution without unnecessary permission friction
- continuous LOW/MEDIUM execution with tail-offer suppression as a governance goal
- OpenClaw-specific escalation rules
- bounded approval windows and recoverability-aware downgrade rules
- preference-aware reduction of result verbosity for repeated `MEDIUM` patterns
- routing risky work toward clarification, protection, installer, or recovery workflows

## What This Skill Does Not Do

- it is not a replacement for `clarify-first`
- it is not a generic implementation or architecture advisor
- it is not a runtime policy engine
- it does not provide non-bypassable enforcement by itself

If the real problem is ambiguity, use `clarify-first` first.
If the requirement is guaranteed blocking of dangerous actions, that belongs in OpenClaw runtime and policy.

## Repository Layout

- `clawgate/SKILL.md`: main skill contract
- `clawgate/references/risk-matrix.md`: OpenClaw-oriented risk rules
- `clawgate/references/confirmation-templates.md`: high-risk confirmation patterns
- `clawgate/references/examples.md`: example triggers and boundaries
- `clawgate/references/checklist.md`: execution checklist
- `clawgate/references/single-instance-profile.md`: single-instance downgrade profile
- `clawgate/evals/evals.json`:
```
