Agent Skill

The skill package that connects your AI agent to Agent Constitution. Constitution checks, secure vault, health sync, and drift testing — all in bash scripts.

OpenClaw bash open source

What's Included

agent-constitution/
  ├── SKILL.md — Instructions for your agent
  ├── active-rules.json — Synced directives from your iPhone
  ├── scripts/
  │   ├── setup.sh — One-time setup
  │   ├── pair.sh — Pair with your iPhone
  │   ├── check-constitution.sh — Request approval for actions
  │   ├── request-vault.sh — Request sensitive data (Face ID)
  │   ├── fetch-health.sh — Read synced health metrics
  │   ├── sync-health.sh — Pull health data from relay
  │   ├── run-drift-test.sh — Process drift test probes
  │   ├── heartbeat-sync.sh — Unified heartbeat handler
  │   └── ... — Encryption utilities, helpers
  └── templates/ — Health dashboard template

Requirements

RequirementDetails
OpenClawAI agent framework — openclaw.ai
iOS AppAgent Constitution for iPhone
jqbrew install jq (macOS) or apt install jq (Linux)
bashVersion 4+ recommended

Quick Start

1. Install the skill

cd $WORKSPACE/skills
git clone https://github.com/arunrlverma/agent-constitution.git
bash agent-constitution/scripts/setup.sh

2. Pair your iPhone

Open the iOS app → tap "Pair Agent" → get a code like CLAW-A1B2C3D4

bash skills/agent-constitution/scripts/pair.sh CLAW-A1B2C3D4

3. Your agent is ready

The setup script patches your agent's AGENTS.md and HEARTBEAT.md to automatically check directives before restricted actions.

Core Scripts

check-constitution.sh

Request approval before a restricted action:

bash skills/agent-constitution/scripts/check-constitution.sh \
  --rule "Ask before sending work emails" \
  --action "Send email to team@company.com" \
  --reason "User requested weekly update"

# Exit 0 = approved, Exit 1 = denied/timeout

request-vault.sh

Request sensitive data protected by Face ID:

# Types: identity, payment, ssn, bank_account, otp, custom
bash skills/agent-constitution/scripts/request-vault.sh payment "Complete checkout"

fetch-health.sh

Read synced Apple Health metrics:

bash skills/agent-constitution/scripts/fetch-health.sh latest   # Latest metrics
bash skills/agent-constitution/scripts/fetch-health.sh history  # 14-day history

How It Works

The skill connects your agent to the Agent Constitution relay server, which communicates with your iPhone app:

  1. Agent attempts restricted action — checks active-rules.json
  2. Directive matches — calls check-constitution.sh
  3. Request sent to relay — push notification to your iPhone
  4. You approve/deny — decision flows back to agent
  5. Agent proceeds or stops — based on your decision

All sensitive data (vault, health, constitution checks) is encrypted end-to-end with AES-256-GCM. The relay can't read your data.

File Integrity

The skill includes tamper protection. 13 critical files are hash-verified on every heartbeat. If your agent modifies its own directives or scripts, the app detects it immediately.

Links

View on GitHub Full Documentation →