ai-safe2-framework

OPENCLAW-WORKSPACE-POLICY.md

OpenClaw Workspace Policy — AI SAFE² Standard

Status: Active
Version: 1.0
Owner: <workspace owner / team>
Scope: All OpenClaw agents, sub-agents, and automated workflows in this workspace.
Governed by: AI SAFE² Framework v2.1 · Dual License MIT + CC-BY-SA
Review cycle: Quarterly, or after any significant incident.


1. Purpose

This document is the constitutional layer for this workspace. It binds every agent, sub-agent, skill, and automated workflow to a shared set of accountability rules. Individual agents have their own SOUL.md and AGENTS.md — this policy governs how they relate to each other and to the workspace as a whole.

An agent that has not acknowledged this policy (via its AGENTS.md reference to this file) is not authorized to operate in this workspace.

Three non-negotiable outcomes this policy exists to protect:

  1. Usefulness — Agents solve real problems completely. They do not half-finish tasks or produce plausible-sounding outputs that are wrong.
  2. Accountability — Every consequential action is traceable to a human-authorized decision. “The agent did it” is not an acceptable explanation for an adverse outcome.
  3. Recoverability — No agent action creates an irreversible outcome without explicit human confirmation. The workspace can always be returned to a known-good state.

2. Mandatory Files — Workspace Standard

Every agent operating in this workspace must maintain these files:

File Purpose Change Control
SOUL.md Values, alignment bands, hard limits Security lead review required
AGENTS.md Operating rules, tool use, sub-agent strategy PR + workspace owner review
IDENTITY.md Minimal identity anchor — loads every request PR review
USER.md Human identity, preferences, hard lines PR review
MEMORY.md Stable long-term facts — private sessions only Human-edit only; agent may propose
TOOLS.md Environment config — IDs, paths, secret locations PR review
HEARTBEAT.md Periodic health check protocol PR review
SUBAGENT-POLICY.md Worker governance rules Security lead review
MODEL-ROUTER.md Multi-LLM routing policy Security lead review
memory/YYYY-MM-DD.md Append-only daily log Agent-written; human-reviewable
OPENCLAW-WORKSPACE-POLICY.md This file Security lead + second reviewer

Filing convention: All identity and policy files live in the agent’s workspace root. Memory files live in memory/. Skills live in skills/.


3. Agent Authorization

3.1 An agent is authorized to operate if:

3.2 An agent is NOT authorized to operate if:

3.3 Authorization Records

Authorization state for each agent is recorded in:
memory/agents-registry.md — maintained by workspace owner, not by agents.


4. Cross-Agent Rules

4.1 Memory Isolation

4.2 Agent-to-Agent Communication

4.3 Trust Hierarchy

Human (Workspace Owner)
    └── Primary Agent (full SOUL/AGENTS context)
            └── Sub-Agents (task-scoped context, minimum trust tier)
                    └── Skill Scripts (sandboxed, no memory access)

Trust flows down this hierarchy only. A skill cannot grant itself agent-level trust. A sub-agent cannot grant itself primary-agent trust. Any attempt to cross this hierarchy upward is a security signal.


5. Safety and Privacy

5.1 Private Memory Scope

5.2 Secret Handling

5.3 Data Classification Enforcement

All agents in this workspace enforce the three-tier data classification from USER.md:

Tier Scope
Confidential DM / private session only
Internal Group channels OK — no external sharing
Restricted External only with explicit per-instance user approval

When context is ambiguous, agents default to the more restrictive tier.

5.4 PII Redaction

All outbound content (messages, emails, API calls) passes through PII scanning before delivery. At minimum, the agent scans for: personal email addresses, phone numbers, dollar amounts, credit card patterns, and high-entropy strings matching API key formats. Findings are redacted and flagged.


6. Skill Governance

6.1 Approved Skill Sources

Source Trust Level Review Required
Official openclaw/skills repo Provisionally trusted Basic provenance check
AI SAFE² framework examples/ Trusted No additional review
Workspace-authored skills Trusted PR review
ClawHub community registry Untrusted by default Full security review before use
External repos / gists Untrusted Full security review + workspace owner approval

6.2 Skill Deployment Process

Before any skill is enabled in production:

  1. Review SKILL.md for instruction content — treat it as code, not documentation.
  2. Check for hidden dependencies outside the standard registry.
  3. Scan for prompt injection patterns targeting SOUL.md or AGENTS.md limits.
  4. Verify the skill requests only the permissions the task requires.
  5. Record the skill in memory/agents-registry.md with source, date, and reviewer.

No skill is deployed via “just install it and see.” ClawHub ranking is not a safety signal.


7. Gateway Requirement

All agents in this workspace route LLM API calls through the AI SAFE² control gateway.

The gateway is the external enforcement layer. Even if an agent’s internal controls fail, the gateway is the last line of defense. Removing or bypassing the gateway is a critical security violation.


8. Compliance Mapping

This workspace policy supports alignment with the following standards:

Standard How This Policy Addresses It
ISO 42001 Mandatory policy documentation, change control, quarterly review cycle
NIST AI RMF Risk identification (SOUL.md hard limits), response (Red band protocol), recovery (Fail-Safe pillar)
SOC 2 Immutable audit logging via gateway, access control (trust hierarchy), incident response (HEARTBEAT escalation)
GDPR / HIPAA PII redaction, data classification tiers, private memory isolation, secret handling
AI SAFE² v2.1 Full five-pillar implementation across all agents in this workspace

9. Incident Response — Workspace Level

When an incident involves this workspace (not just one agent):

  1. All affected agents enter Yellow or Red band immediately.
  2. Workspace owner is notified via direct message within one heartbeat cycle.
  3. Affected agent(s) are suspended from external operations until cleared.
  4. Incident is documented in today’s memory/YYYY-MM-DD.md for all affected agents.
  5. Root cause analysis results in a PR to this policy, the affected agent’s SOUL.md, or AGENTS.md — not just a verbal “we fixed it.”
  6. Workspace owner reviews and approves the fix before agents resume normal operations.

10. Review and Evolution


Governed by the AI SAFE² Framework v2.1.
AI SAFE² = Sanitize & Isolate · Audit & Inventory · Fail-Safe & Recovery · Engage & Monitor · Evolve & Educate
Love Equation alignment: dE/dt = β(C − D)E — cooperation must exceed defection, always.