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):- Install the skill to
~/.openclaw/workspace/skills/rafter-security/SKILL.md(the canonical ClawHub path; was~/.openclaw/skills/rafter-security.mdin 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 ametadata.openclawblock 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.3. Restart OpenClaw
Restart OpenClaw to load the Rafter skill:How It Works
Once integrated, OpenClaw’s agent is instructed (via the skill) to runrafter commands for security-sensitive operations:
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:- Generates commit message
- Calls
rafter agent exec "git commit -m '...'" - Rafter evaluates command risk level
- Rafter scans staged files for secrets (for git commands)
- If clean: executes commit
- 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
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
Viewing security events
When OpenClaw uses it:- After blocked commands
- When reviewing security events
- For compliance reporting
Auditing a third-party skill
When OpenClaw uses it:- Before installing a skill from an unknown source
rafter agent audit-skill still works but is deprecated in favor of rafter skill review.
Configuration
Command Policy
Command enforcement is set byagent.commandPolicy:
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
- Start with the default command policy (
approve-dangerous), and tuneagent.commandPolicyas you learn your workflow - Review audit logs regularly:
rafter agent audit --last 20 - Vet untrusted skills with
rafter skill review: before installing anything from an unknown source - Test policies before relying on them: a skill-driven integration has no hook backstop, so verify the agent is actually calling
raftercommands - 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:-
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.) -
Reinstall the skill:
-
Restart OpenClaw:
Commands Not Being Validated
If commands bypass Rafter:-
Check config:
-
Verify policy mode:
-
Enable if disabled:
-
Remember there’s no hook here — if the agent itself isn’t invoking
raftercommands per the skill’s instructions, nothing else will.
False Positives
If safe commands are being blocked:-
Check the audit log:
-
Add an allowlist pattern or adjust
commandPolicy— see Command Policy above. - Report issue: rafter-cli/issues
Advanced Configuration
Custom Blocked Patterns
Edit~/.rafter/config.json:
Approval Patterns
Require approval for specific commands:Support
Need Help?
- Documentation: docs.rafter.so
- OpenClaw Docs: openclaw.com/docs
- Issues: rafter-cli/issues
- Community: OpenClaw Discord
Next Steps
Command Reference
Complete CLI command reference
Secret Scanning
Learn about secret detection

