Skip to main content

OpenClaw Integration

Rafter integrates seamlessly with OpenClaw to add local security to your development workflow.

Setup

1. Install Rafter CLI

Install globally:

2. Initialize Local Security

Run initialization (auto-detects OpenClaw):
If OpenClaw is detected, Rafter will:
  • ✓ Install 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 — reinstall on top of the old layout strips the legacy file)
  • ✓ Write ClawHub-required top-level frontmatter (name, description, version) alongside the openclaw: runtime block
  • ✓ Enable agent integration in config
  • ✓ Set up security policies
Alternative install: since v0.8.0, the rafter-security skill is also auto-published to ClawHub on every prod release. OpenClaw users can install via clawhub skill install rafter-security as an alternative to rafter agent init --with-openclaw.

3. Restart OpenClaw

Restart OpenClaw to load the Rafter skill:

How It Works

Once integrated, OpenClaw uses Rafter for security-sensitive operations:

Example Flow

User request:
OpenClaw processes:
  1. Generates commit message
  2. Calls Rafter: 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 Rafter skill provides these commands to OpenClaw:

/rafter-scan

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

/rafter-bash

Execute shell commands with validation. When OpenClaw uses it:
  • For any shell command execution
  • Before destructive operations
  • When using sudo
Example:

/rafter-audit

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

Configuration

Risk Levels for OpenClaw

Choose based on your use case:
Best for: Local development, prototyping
  • Allows most commands
  • Basic secret detection
  • Minimal interruption to workflow
Best for: Sensitive environments, compliance requirements
  • Maximum security checks
  • Requires approval for most operations
  • Comprehensive audit logging
  • Best for production agents

Command Policy

Control how commands are handled:

Usage Examples

Safe Development Workflow

Blocked Dangerous Operation

Approval Required

Best Practices

Recommended Setup

  1. Start with moderate risk level: Adjust based on experience
  2. Review audit logs daily: rafter agent audit --last 20
  3. Train agents on Rafter commands: Ensure agents know when to use security checks
  4. Test policies in development: Before deploying to production
  5. Keep Rafter updated: npm update -g @rafter-security/cli

Monitoring

View Agent Activity

Check what your agent is doing:

Audit Reports

Generate reports for compliance:

Troubleshooting

Skill Not Loading

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

Commands Not Being Validated

If commands bypass Rafter:
  1. Check config:
  2. Verify policy mode:
  3. Enable if disabled:

False Positives

If safe commands are being blocked:
  1. Check audit log:
  2. Adjust risk level:
  3. Report issue: rafter-cli/issues

Advanced Configuration

Custom Blocked Patterns

Add organization-specific patterns: Edit ~/.rafter/config.json:

Approval Patterns

Require approval for specific commands:

Multi-Agent Setup

Running multiple OpenClaw instances:

Support

Need Help?

Next Steps

Command Reference

Complete CLI command reference

Secret Scanning

Learn about secret detection