Spec-first control plane for typed, policy-enforced outbound message routing.
Every agent-initiated send (email, WhatsApp, Slack, SMS) routes through ClawWrap's gate, which validates targets, applies policies, and logs verdicts before dispatch.
- Outbound gate — 5-stage pipeline: resolve → verify → approve → execute → audit
- Policy enforcement — allowlists, rate limits, channel restrictions per target
- Two routing modes — shared (context_key + audience → target) and direct (recipient_ref → adapter resolver)
- 15+ handler implementations — email, WhatsApp DM/group, Slack, SMS, target resolution
- Database-backed audit trail — PostgreSQL with Alembic migrations
- Spec-first contracts — YAML wrapper and policy specifications
- Conformance auditing — verify all outbound paths comply with declared policies
pip install clawwrap# Initialize database schema
clawwrap init
# Run Alembic migrations
clawwrap migrate
# Validate a wrapper spec
clawwrap validate specs/outbound-email.yaml
# Show dependency graph
clawwrap graph specs/outbound-email.yaml
# Run a wrapper
clawwrap run specs/outbound-email.yaml
# Audit conformance
clawwrap conformance audit| Command | Description |
|---|---|
init |
Initialize database schema |
migrate |
Run Alembic migrations |
validate |
Validate wrapper/policy specs |
graph |
Show DAG of dependencies |
run |
Execute a wrapper run |
apply |
Apply policies and handlers |
conformance |
Check conformance to specs |
handler |
Manage handler definitions |
legacy |
Authority/ownership operations |
Agent → outbound.submit(context_key, audience, channel)
↓
┌─────────────────────────┐
│ ClawWrap Gate │
│ 1. Resolve target │ ← targets.yaml
│ 2. Verify identity │ ← live checks (JID, email, channel)
│ 3. Apply policy │ ← outbound-policy.yaml
│ 4. Dispatch │ ← channel handler (email, WhatsApp, Slack)
│ 5. Audit log │ ← PostgreSQL + YAML verdicts
└─────────────────────────┘
targets.yaml — outbound routing addresses:
retreat_staff:
whatsapp:
jid: "120363...@g.us"
email:
address: "team@example.com"
slack:
channel: "#ops"outbound-policy.yaml — allowlists and checks:
channels:
email:
enabled: true
rate_limit: 50/hour
whatsapp:
enabled: true
require_verification: true
slack:
enabled: trueClawSpec provides contract-first QA for ClawWrap handlers. Test that your outbound gate routes correctly, applies policies, and logs verdicts:
pip install clawspec
clawspec run --scenario outbound-gate-smokeClawSpec's trace-aware assertions can verify the full gate pipeline:
then:
- type: tool_sequence
expected: ["target_resolve", "jid_verify", "outbound_submit"]
mode: ordered
- type: no_span_errorsClawScaffold manages ClawWrap handler lifecycle. When adopting or creating new handlers:
pip install clawscaffold
clawscaffold adopt --name outbound/email-send --source src/clawwrap/adapters/openclaw/handlers/email_send.py --kind skillClawWrap ships with a gateway plugin that registers the clawwrap tool directly in the OpenClaw gateway. The plugin delegates all subcommands to the Python CLI via child_process.
- Copy the
extensions/clawwrap/directory into your OpenClaw workspace:
cp -r extensions/clawwrap/ ~/.openclaw/extensions/clawwrap/- Register the plugin in your
~/.openclaw/openclaw.json:
{
"extensions": {
"clawwrap": {
"repoRoot": "/path/to/your/workspace",
"timeoutMs": 60000
}
}
}- Restart the gateway:
openclaw gateway restart| Option | Type | Default | Description |
|---|---|---|---|
repoRoot |
string | $OPENCLAW_WORKSPACE or cwd |
Workspace root containing the clawwrap package |
pythonBin |
string | <repoRoot>/clawpipe/.venv/bin/python |
Path to Python binary |
timeoutMs |
integer | 60000 |
CLI execution timeout in milliseconds |
version, init, migrate, validate, graph, run, apply, conformance, handler, legacy
See the openclaw.plugin.json for the full config schema.
- ClawSpec — Contract-first QA for OpenClaw skills and agents
- ClawScaffold — Spec-first target lifecycle manager
- OpenClaw — Local-first AI agent framework
git clone https://github.com/austinmao/clawwrap.git
cd clawwrap
pip install -e ".[dev]"
pytestThis package is part of ClawSuite — the OpenClaw agent infrastructure toolkit.
| Package | Description | Repo |
|---|---|---|
| ClawPipe | Config-driven pipeline orchestration | austinmao/clawpipe |
| ClawSpec | Contract-first testing for skills & agents | austinmao/clawspec |
| ClawWrap | Outbound policy & conformance engine | austinmao/clawwrap |
| ClawAgentSkill | Skill discovery, scanning & adoption | austinmao/clawagentskill |
| ClawScaffold | Agent/skill scaffold interviews | austinmao/clawscaffold |
| ClawInterview | Pipeline interview compilation & execution | (coming soon) |
All packages include OpenClaw gateway plugins for autonomous agent access.
MIT