warden-governance

# War/Den Governance Skill > **ClawHub Package:** `an2b/warden-governance` > **Version:** 1.0.0 > **Category:** Governance & Security > **License:** MIT --- ## What This Skill Does Every action your OpenClaw bot tries to take is evaluated by War/Den before it executes. ``` Your Bot -> War/Den check -> ALLOW -> action executes -> DENY -> action blocked + logged -> REVIEW -> waits for your approval ``` No more deleted emails. No more data exfiltration. No more ungoverned agents. **Community mode works with zero external dependencies.** No API keys. No cloud. Just YAML policies, a local SQLite audit log, and a hash chain you can verify. --- ## Install ### From ClawHub (recommended) ```bash openclaw skill install an2b/warden-governance ``` ### From pip ```bash pip install warden-governance-skill ``` Both methods install to: `~/.openclaw/skills/warden-governance/` On successful install you'll see: ``` 🦞 War/Den governance active. Your OpenClaw bot is now governed. ``` ### Add to your OpenClaw config ```yaml skills: - name: warden-governance config: SENTINEL_API_KEY: "" # optional -- leave blank for community mode ENGRAMPORT_API_KEY: "" # optional -- leave blank for local memory WARDEN_FAIL_OPEN: "false" # block on governance failure (default) ``` ### Restart your bot ```bash openclaw restart ``` That's it. Your bot is now governed. --- ## How It Works ### Hooks This skill registers three OpenClaw hooks: | Hook | Purpose | |------|---------| | `before_action` | Evaluate every action against policy before execution | | `after_action` | Write action result to governed memory | | `on_error` | Log errors to tamper-evident audit trail | ### Action Bridge All 15 OpenClaw action types are mapped to War/Den governance types: | OpenClaw Action | War/Den Type | Default Protection | |-----------------|--------------|-------------------| | `email.send` | `message.send` | Monitored | | `email.delete` | `data.write` | **Requires human review** | | `email.read` | `data.read` | Monitored | | `file.write` | `data.write` | Monitored | | `file.delete` | `data.write` | **Requires human review** | | `file.read` | `data.read` | Monitored | | `browser.navigate` | `api.call` | Monitored | | `browser.click` | `api.call` | Monitored | | `shell.execute` | `code.execute` | **Blocked in production** | | `api.call` | `api.call` | Monitored | | `calendar.create` | `data.write` | Monitored | | `calendar.delete` | `data.write` | **Requires human review** | | `message.send` | `message.send` | Monitored | | `code.execute` | `code.execute` | **Blocked in production** | | `payment.create` | `api.call` | **Requires human review** | ### Policy Engine Policies are YAML files evaluated in priority order: ```yaml policies: - name: protect-email-delete match: action.type: data.write action.data.openclaw_original: email.delete decision: review mode: enforce priority: 1 active: true reason: "Email deletion requires human review." ``` **Evaluation rules:** 1. Filter to active policies only 2. Sort by priority ascending (lower number = higher priority) 3. First match wins 4. `mode: monitor` -- log but return ALLOW 5. `mode: enforce` -- return the matched decision 6. No match -- default ALLOW ### Pre-built Policy Packs Load governance instantly with built-in packs: | Pack | What It Does | |------|-------------| | `basic_safety` | Blocks code execution in prod, monitors writes and API calls | | `phi_guard` | Denies PHI access in dev, requires review for memory export | | `payments_guard` | Denies payment actions in dev, requires review in prod | ### Audit Trail Every governance decision is written to a tamper-evident SHA-256 hash chain: ``` Event N: hash = SHA256(prev_hash + agent_id + action_type + decision + timestamp) Event N+1: prev_hash = Event N hash ``` Verify the chain at any time: ```python valid, bad_event_id = audit_log.verify_chain() ``` ### Decision Cache ALLOW decisions are cached for 5 minutes (configurable). DENY and REVIEW are **never** cached -- they always hit the governance engine fresh. --- ## Community vs Enterprise | Feature | Community (Free) | Enterprise | |---------|-----------------|------------| | Policy enforcement | Local YAML | Sentinel_OS cloud | | Audit trail | Local SQLite + hash chain | Cloud + signed PDF | | Memory storage | Local SQLite | EngramPort cloud (MandelDB) | | Memory search | Text search (LIKE) | Vector search (3072-dim) | | Synthesis | Basic recall | Eidetic AI synthesis | | Cross-bot memory | -- | Orchestra multi-agent | | Multi-namespace | 3 max | Unlimited | | Compliance export | -- | SOC2/HIPAA PDF | | Cryptographic provenance | Local hash chain | AEGIS (SHA-256 + RSA) | | Dependencies | **Zero** | `sentinel-client`, `engramport-langchain` | ### Mode Matrix | `SENTINEL_API_KEY` | `ENGRAMPORT_API_KEY` | Mode | |--------------------|----------------------|------| | -- | -- | Full Community | | Set | -- | Governed Community | | -- | Set | Memory Enterprise | | Set | Set | Full Enterprise | All four modes work with zero code changes. Just environment variables. --- ## Enterprise Upgrade Path ### Sentinel_OS (Governance) Set `SENTINEL_API_KEY` to upgrade governance from local YAML to Sentinel_OS cloud: - Real-time policy evaluation via `/api/v1/check` - Pre-flight checks via `/api/v1/check` (read-only, no side effects) - Action logging via `/api/v1/ingest` with hash chain integrity - Run management, alerting, and AI-powered insights - Python and Node.js SDKs - Rate limiting: 2000 checks/min, 1000 ingests/min per API key Get your key at [getsentinelos.com](https://getsentinelos.com) ### EngramPort (Memory via MandelDB) Set `ENGRAMPORT_API_KEY` to upgrade memory from local SQLite to EngramPort cloud: - **5 endpoints:** `/register`, `/remember`, `/recall`, `/reflect`, `/stats` - 3072-dimensional OpenAI embeddings via Pinecone - AEGIS cryptographic provenance (SHA-256 + RSA signature per memory) - Namespace-isolated storage (`bot:{slug}:{uid}`) - Eidetic cross-memory pattern synthesis via GPT-4o-mini - Multi-agent orchestration with `EngramPortOrchestra` - Background synthesis with `DreamState` - LangChain drop-in integration API keys use format `ek_bot_*` with SHA-256 hashed storage. Get your key at [engram.eideticlab.com](https://engram.eideticlab.com) --- ## Configuration | Variable | Required | Default | Description | |----------|----------|---------|-------------| | `SENTINEL_API_KEY` | No | `""` | Sentinel_OS key. Blank = community governance | | `ENGRAMPORT_API_KEY` | No | `""` | EngramPort key. Blank = local memory | | `WARDEN_FAIL_OPEN` | No | `false` | Allow on governance failure | | `WARDEN_AGENT_ID` | No | `openclaw-agent` | Bot identifier | | `WARDEN_POLICY_FILE` | No | built-in | Path to custom YAML policy file | | `WARDEN_POLICY_PACKS` | No | `""` | Comma-separated pack names | | `WARDEN_MEMORY_DB` | No | `~/.warden/memory.db` | Local memory path | | `WARDEN_AUDIT_DB` | No | `~/.warden/audit.db` | Local audit log path | | `WARDEN_CACHE_TTL` | No | `300` | ALLOW cache TTL in seconds | ### Fail-Open Behavior | `WARDEN_FAIL_OPEN` | War/Den reachable | War/Den unreachable | |---------------------|-------------------|---------------------| | `false` (default) | Normal governance | Action **BLOCKED** | | `true` | Normal governance | Action **ALLOWED** + warning | Default is `false` because a governance failure should never silently allow dangerous actions. --- ## Test Proof This skill ships with a comprehensive test suite. Run it: ```bash python -m pytest tests/ -v ``` Key test: **The Meta inbox test** simulates the exact incident where an OpenClaw agent deleted 200 emails. With War/Den, all 200 are blocked: ```python def test_meta_researcher_inbox_protection(self, tmp_path): """Simulate the exact Meta inbox incident. All 200 emails blocked.""" skill = _make_skill(tmp_path, WARDEN_POLICY_FILE=policy_path) blocked = 0 for i in range(200): result = skill.before_action( {"type": "email.delete", "data": {"email_id": f"msg_{i}"}}, {"agent_id": "meta-researcher-bot", "env": "prod"}, ) if not result["proceed"]: blocked += 1 assert blocked == 200 ``` --- ## Skill Files ``` warden-governance-skill/ β”œβ”€β”€ SKILL.md # This file (ClawHub primary) β”œβ”€β”€ clawhub.json # ClawHub registry metadata β”œβ”€β”€ README.md # Full documentation β”œβ”€β”€ pyproject.toml # Python package config β”œβ”€β”€ policies/ β”‚ β”œβ”€β”€ openclaw_default.yaml # Default governance policies β”‚ └── policy_packs.py # Pre-built policy packs β”œβ”€β”€ warden_governance/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ skill.py # Main skill class (hooks) β”‚ β”œβ”€β”€ action_bridge.py # OpenClaw <-> War/Den translation β”‚ β”œβ”€β”€ policy_engine.py # Community policy engine β”‚ β”œβ”€β”€ audit_log.py # SHA-256 hash chain audit β”‚ β”œβ”€β”€ memory_client.py # Governed memory operations β”‚ β”œβ”€β”€ local_store.py # Local SQLite memory β”‚ β”œβ”€β”€ sentinel_client.py # Enterprise Sentinel_OS client β”‚ β”œβ”€β”€ engramport_client.py # Enterprise EngramPort client β”‚ β”œβ”€β”€ upgrade_manager.py # Mode detection + banner β”‚ β”œβ”€β”€ health_check.py # Enterprise health validation β”‚ └── settings.py # Configuration └── tests/ β”œβ”€β”€ __init__.py β”œβ”€β”€ test_skill.py # Skill + Meta inbox tests β”œβ”€β”€ test_policy_engine.py # Policy engine tests β”œβ”€β”€ test_audit_log.py # Audit trail tests β”œβ”€β”€ test_action_bridge.py # Action bridge tests β”œβ”€β”€ test_memory.py # Memory client tests └── test_enterprise.py # Enterprise upgrade tests ``` --- Built on [Sentinel_OS](https://getsentinelos.com) and [EngramPort](https://engram.eideticlab.com) by [AN2B Technologies](https://an2b.com) *The lobster protects the inbox.*

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "warden-governance" with this command: npx skills add jcools1977/an2b-warden-governance

War/Den Governance Skill

ClawHub Package: an2b/warden-governance Version: 1.0.0 Category: Governance & Security License: MIT


What This Skill Does

Every action your OpenClaw bot tries to take is evaluated by War/Den before it executes.

Your Bot -> War/Den check -> ALLOW  -> action executes
                          -> DENY   -> action blocked + logged
                          -> REVIEW -> waits for your approval

No more deleted emails. No more data exfiltration. No more ungoverned agents.

Community mode works with zero external dependencies. No API keys. No cloud. Just YAML policies, a local SQLite audit log, and a hash chain you can verify.


Install

From ClawHub (recommended)

openclaw skill install an2b/warden-governance

From pip

pip install warden-governance-skill

Both methods install to: ~/.openclaw/skills/warden-governance/

On successful install you'll see:

🦞 War/Den governance active.
   Your OpenClaw bot is now governed.

Add to your OpenClaw config

skills:
  - name: warden-governance
    config:
      SENTINEL_API_KEY: ""       # optional -- leave blank for community mode
      ENGRAMPORT_API_KEY: ""     # optional -- leave blank for local memory
      WARDEN_FAIL_OPEN: "false"  # block on governance failure (default)

Restart your bot

openclaw restart

That's it. Your bot is now governed.


How It Works

Hooks

This skill registers three OpenClaw hooks:

HookPurpose
before_actionEvaluate every action against policy before execution
after_actionWrite action result to governed memory
on_errorLog errors to tamper-evident audit trail

Action Bridge

All 15 OpenClaw action types are mapped to War/Den governance types:

OpenClaw ActionWar/Den TypeDefault Protection
email.sendmessage.sendMonitored
email.deletedata.writeRequires human review
email.readdata.readMonitored
file.writedata.writeMonitored
file.deletedata.writeRequires human review
file.readdata.readMonitored
browser.navigateapi.callMonitored
browser.clickapi.callMonitored
shell.executecode.executeBlocked in production
api.callapi.callMonitored
calendar.createdata.writeMonitored
calendar.deletedata.writeRequires human review
message.sendmessage.sendMonitored
code.executecode.executeBlocked in production
payment.createapi.callRequires human review

Policy Engine

Policies are YAML files evaluated in priority order:

policies:
  - name: protect-email-delete
    match:
      action.type: data.write
      action.data.openclaw_original: email.delete
    decision: review
    mode: enforce
    priority: 1
    active: true
    reason: "Email deletion requires human review."

Evaluation rules:

  1. Filter to active policies only
  2. Sort by priority ascending (lower number = higher priority)
  3. First match wins
  4. mode: monitor -- log but return ALLOW
  5. mode: enforce -- return the matched decision
  6. No match -- default ALLOW

Pre-built Policy Packs

Load governance instantly with built-in packs:

PackWhat It Does
basic_safetyBlocks code execution in prod, monitors writes and API calls
phi_guardDenies PHI access in dev, requires review for memory export
payments_guardDenies payment actions in dev, requires review in prod

Audit Trail

Every governance decision is written to a tamper-evident SHA-256 hash chain:

Event N:  hash = SHA256(prev_hash + agent_id + action_type + decision + timestamp)
Event N+1: prev_hash = Event N hash

Verify the chain at any time:

valid, bad_event_id = audit_log.verify_chain()

Decision Cache

ALLOW decisions are cached for 5 minutes (configurable). DENY and REVIEW are never cached -- they always hit the governance engine fresh.


Community vs Enterprise

FeatureCommunity (Free)Enterprise
Policy enforcementLocal YAMLSentinel_OS cloud
Audit trailLocal SQLite + hash chainCloud + signed PDF
Memory storageLocal SQLiteEngramPort cloud (MandelDB)
Memory searchText search (LIKE)Vector search (3072-dim)
SynthesisBasic recallEidetic AI synthesis
Cross-bot memory--Orchestra multi-agent
Multi-namespace3 maxUnlimited
Compliance export--SOC2/HIPAA PDF
Cryptographic provenanceLocal hash chainAEGIS (SHA-256 + RSA)
DependenciesZerosentinel-client, engramport-langchain

Mode Matrix

SENTINEL_API_KEYENGRAMPORT_API_KEYMode
----Full Community
Set--Governed Community
--SetMemory Enterprise
SetSetFull Enterprise

All four modes work with zero code changes. Just environment variables.


Enterprise Upgrade Path

Sentinel_OS (Governance)

Set SENTINEL_API_KEY to upgrade governance from local YAML to Sentinel_OS cloud:

  • Real-time policy evaluation via /api/v1/check
  • Pre-flight checks via /api/v1/check (read-only, no side effects)
  • Action logging via /api/v1/ingest with hash chain integrity
  • Run management, alerting, and AI-powered insights
  • Python and Node.js SDKs
  • Rate limiting: 2000 checks/min, 1000 ingests/min per API key

Get your key at getsentinelos.com

EngramPort (Memory via MandelDB)

Set ENGRAMPORT_API_KEY to upgrade memory from local SQLite to EngramPort cloud:

  • 5 endpoints: /register, /remember, /recall, /reflect, /stats
  • 3072-dimensional OpenAI embeddings via Pinecone
  • AEGIS cryptographic provenance (SHA-256 + RSA signature per memory)
  • Namespace-isolated storage (bot:{slug}:{uid})
  • Eidetic cross-memory pattern synthesis via GPT-4o-mini
  • Multi-agent orchestration with EngramPortOrchestra
  • Background synthesis with DreamState
  • LangChain drop-in integration

API keys use format ek_bot_* with SHA-256 hashed storage.

Get your key at engram.eideticlab.com


Configuration

VariableRequiredDefaultDescription
SENTINEL_API_KEYNo""Sentinel_OS key. Blank = community governance
ENGRAMPORT_API_KEYNo""EngramPort key. Blank = local memory
WARDEN_FAIL_OPENNofalseAllow on governance failure
WARDEN_AGENT_IDNoopenclaw-agentBot identifier
WARDEN_POLICY_FILENobuilt-inPath to custom YAML policy file
WARDEN_POLICY_PACKSNo""Comma-separated pack names
WARDEN_MEMORY_DBNo~/.warden/memory.dbLocal memory path
WARDEN_AUDIT_DBNo~/.warden/audit.dbLocal audit log path
WARDEN_CACHE_TTLNo300ALLOW cache TTL in seconds

Fail-Open Behavior

WARDEN_FAIL_OPENWar/Den reachableWar/Den unreachable
false (default)Normal governanceAction BLOCKED
trueNormal governanceAction ALLOWED + warning

Default is false because a governance failure should never silently allow dangerous actions.


Test Proof

This skill ships with a comprehensive test suite. Run it:

python -m pytest tests/ -v

Key test: The Meta inbox test simulates the exact incident where an OpenClaw agent deleted 200 emails. With War/Den, all 200 are blocked:

def test_meta_researcher_inbox_protection(self, tmp_path):
    """Simulate the exact Meta inbox incident. All 200 emails blocked."""
    skill = _make_skill(tmp_path, WARDEN_POLICY_FILE=policy_path)
    blocked = 0
    for i in range(200):
        result = skill.before_action(
            {"type": "email.delete", "data": {"email_id": f"msg_{i}"}},
            {"agent_id": "meta-researcher-bot", "env": "prod"},
        )
        if not result["proceed"]:
            blocked += 1
    assert blocked == 200

Skill Files

warden-governance-skill/
β”œβ”€β”€ SKILL.md                          # This file (ClawHub primary)
β”œβ”€β”€ clawhub.json                      # ClawHub registry metadata
β”œβ”€β”€ README.md                         # Full documentation
β”œβ”€β”€ pyproject.toml                    # Python package config
β”œβ”€β”€ policies/
β”‚   β”œβ”€β”€ openclaw_default.yaml         # Default governance policies
β”‚   └── policy_packs.py              # Pre-built policy packs
β”œβ”€β”€ warden_governance/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ skill.py                      # Main skill class (hooks)
β”‚   β”œβ”€β”€ action_bridge.py              # OpenClaw <-> War/Den translation
β”‚   β”œβ”€β”€ policy_engine.py              # Community policy engine
β”‚   β”œβ”€β”€ audit_log.py                  # SHA-256 hash chain audit
β”‚   β”œβ”€β”€ memory_client.py              # Governed memory operations
β”‚   β”œβ”€β”€ local_store.py                # Local SQLite memory
β”‚   β”œβ”€β”€ sentinel_client.py            # Enterprise Sentinel_OS client
β”‚   β”œβ”€β”€ engramport_client.py          # Enterprise EngramPort client
β”‚   β”œβ”€β”€ upgrade_manager.py            # Mode detection + banner
β”‚   β”œβ”€β”€ health_check.py               # Enterprise health validation
β”‚   └── settings.py                   # Configuration
└── tests/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ test_skill.py                 # Skill + Meta inbox tests
    β”œβ”€β”€ test_policy_engine.py         # Policy engine tests
    β”œβ”€β”€ test_audit_log.py             # Audit trail tests
    β”œβ”€β”€ test_action_bridge.py         # Action bridge tests
    β”œβ”€β”€ test_memory.py                # Memory client tests
    └── test_enterprise.py            # Enterprise upgrade tests

Built on Sentinel_OS and EngramPort by AN2B Technologies

The lobster protects the inbox.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

Memory Poison Auditor

Audits OpenClaw memory files for injected instructions, brand bias, hidden steering, and memory poisoning patterns. Use when reviewing MEMORY.md, daily memor...

Registry SourceRecently Updated
280Profile unavailable
Security

Log

The Immutable Audit & Cognitive Provenance Standard. Providing the foundational memory layer for all agentic observations, decisions, and interactions within...

Registry SourceRecently Updated
1230Profile unavailable
Security

AgentMesh Governance

AI agent governance, trust scoring, and policy enforcement powered by AgentMesh. Activate when: (1) user wants to enforce token limits, tool restrictions, or...

Registry SourceRecently Updated
4930Profile unavailable
Security

Skill Safe Install (L0 Strict)

Strict secure-install workflow for ClawHub/OpenClaw skills. Use when asked to install a skill safely, inspect skill permissions, review third-party skill ris...

Registry SourceRecently Updated
640Profile unavailable