Skip to main content

OpenClaw Integration

Rafter integrates with OpenClaw as a single skill — there are no hooks on this platform, so enforcement depends on OpenClaw’s agent following the skill’s instructions rather than an intercept it can’t bypass.

Setup

1. Install Rafter CLI

Install globally:

2. Initialize Local Security

Run initialization (auto-detects OpenClaw):
If OpenClaw is detected, Rafter will:
  • Install the skill to ~/.openclaw/workspace/skills/rafter-security/SKILL.md (the canonical ClawHub path; was ~/.openclaw/skills/rafter-security.md in v0.7.7 and earlier — reinstalling on top of the old layout removes the legacy file)
  • Write ClawHub-required top-level frontmatter (name, description, version, homepage), with a metadata.openclaw block carrying the ClawHub-specific fields (skillKey, primaryEnv, emoji, requires.bins, envVars)
  • Enable the OpenClaw integration in ~/.rafter/config.json
Alternative install: since v0.8.0, the rafter-security skill is also published to ClawHub on every release. OpenClaw users can install via clawhub skill install rafter-security as an alternative to rafter agent init --with-openclaw.
To install all detected integrations at once (OpenClaw included):

3. Restart OpenClaw

Restart OpenClaw to load the Rafter skill:

How It Works

Once integrated, OpenClaw’s agent is instructed (via the skill) to run rafter commands for security-sensitive operations:
Unlike Claude Code or Codex, there’s no PreToolUse hook backing this up — the skill tells the agent what to run and when, but nothing outside the conversation stops the agent from skipping a step.

Example Flow

User request:
OpenClaw processes:
  1. Generates commit message
  2. Calls rafter agent exec "git commit -m '...'"
  3. Rafter evaluates command risk level
  4. Rafter scans staged files for secrets (for git commands)
  5. If clean: executes commit
  6. If secrets found or command blocked: alerts user

Skill Commands

The skill’s own document is organized under a few headers written with a leading slash (/rafter-scan, /rafter-bash, /rafter-audit-skill, /rafter-audit) that map to real CLI commands below — these aren’t slash commands you type; they’re the skill’s internal structure for when the agent should run each one.

Scanning for secrets

When OpenClaw uses it:
  • Before git commits
  • When reading sensitive files
  • After generating code with credentials
Example:
rafter agent scan still works but is deprecated — it will be removed in a future major version. Use rafter secrets instead.

Executing commands with validation

When OpenClaw uses it:
  • For any shell command execution
  • Before destructive operations
  • When using sudo
Example:

Viewing security events

When OpenClaw uses it:
  • After blocked commands
  • When reviewing security events
  • For compliance reporting
Example:

Auditing a third-party skill

When OpenClaw uses it:
  • Before installing a skill from an unknown source
Example:
rafter agent audit-skill still works but is deprecated in favor of rafter skill review.

Configuration

Command Policy

Command enforcement is set by agent.commandPolicy:
A small set of catastrophic patterns — rm -rf /, fork bombs, disk wipes, reverse shells — is always blocked regardless of mode; this can’t be configured away.
Examples use the Node CLI’s camelCase keys; the Python CLI uses snake_case. See the key casing note.

Usage Examples

Safe Development Workflow

Blocked Dangerous Operation

Approval Required

Best Practices

Recommended Setup

  1. Start with the default command policy (approve-dangerous), and tune agent.commandPolicy as you learn your workflow
  2. Review audit logs regularly: rafter agent audit --last 20
  3. Vet untrusted skills with rafter skill review: before installing anything from an unknown source
  4. Test policies before relying on them: a skill-driven integration has no hook backstop, so verify the agent is actually calling rafter commands
  5. Keep Rafter updated: npm update -g @rafter-security/cli

Monitoring

View Agent Activity

Audit Reports

rafter agent audit has no --json flag. The log itself is newline-delimited JSON at ~/.rafter/audit.jsonl if you need to process it directly.

Troubleshooting

Skill Not Loading

If OpenClaw doesn’t recognize Rafter commands:
  1. Check the skill file exists:
    (v0.7.7-and-earlier layout was ~/.openclaw/skills/rafter-security.md — that path is no longer read by ClawHub at runtime.)
  2. Reinstall the skill:
  3. Restart OpenClaw:

Commands Not Being Validated

If commands bypass Rafter:
  1. Check config:
  2. Verify policy mode:
  3. Enable if disabled:
  4. Remember there’s no hook here — if the agent itself isn’t invoking rafter commands per the skill’s instructions, nothing else will.

False Positives

If safe commands are being blocked:
  1. Check the audit log:
  2. Add an allowlist pattern or adjust commandPolicy — see Command Policy above.
  3. Report issue: rafter-cli/issues

Advanced Configuration

Custom Blocked Patterns

Edit ~/.rafter/config.json:

Approval Patterns

Require approval for specific commands:

Support

Need Help?

Next Steps

Command Reference

Complete CLI command reference

Secret Scanning

Learn about secret detection