rulecloud
v1.1.1
Published
Real-time RuleCloud guardrails for AI coding agents
Maintainers
Readme
rulecloud CLI
Real-time guardrails for AI coding agents. Pulls Cloud Rulespacks from your RuleCloud workspace, watches file saves, and reports violations in the terminal (optionally syncing to the Live Agent Monitor).
Quick start
npx rulecloud@latest init
rulecloud status
rulecloud audit
rulecloud learn --mock --dry-run
rulecloud telemetry push --dry-runInstall
npm install -g rulecloud
# or run without installing:
npx rulecloud@latest init
npx rulecloud@latest watchDevelop from the monorepo cli/ folder:
npm install
npm run build
npm linkConfigure
export RULECLOUD_API_URL=https://rulecloud-production.up.railway.app
export RULECLOUD_API_KEY=rc_live_...Create API keys in the RuleCloud console.
Commands
| Command | Description |
|---------|-------------|
| rulecloud init | Scaffold rules/hooks + local security audit (API key optional) |
| rulecloud init --no-modify-gitignore | Same, but do not append .claude/settings.local.json to .gitignore |
| rulecloud watch | Live HUD: initial scan + file saves (r rescan, c clear, q quit) |
| rulecloud watch --plain | No colors / no TTY shortcuts (CI) |
| rulecloud watch | Cloud Sync ON automatically when RULECLOUD_API_KEY or .rulecloud.json is set |
| rulecloud fix [file] | Pro AI Auto-Fix via API (f in watch) |
| rulecloud check | Scan entire repo; exit 1 on high/critical violations |
| rulecloud check --staged | Pre-commit scan of staged git files only |
| rulecloud audit [--json] [dir] | Workspace hardening scan (hooks, MCP, allowlists, hidden unicode); exit 2 on high/critical |
| rulecloud verify [--json] | Post-edit slop/structure gate; exit 2 on BLOCKED |
| rulecloud status [--json] | Rules sha/count, hook parity, audit blocks, telemetry cursor, API key status |
| rulecloud sync-hooks | Write .cursor/hooks.json + .claude/settings.json from rules |
| rulecloud sync-hooks --check | Exit 1 when hook files drift from .guardrail/rules.yml (CI) |
| rulecloud sync-hooks --cursor-plugin | Also write .cursor-plugin/plugin.json (skills/hooks/rules) |
| rulecloud learn [--from-git\|--from-audit] [--mock] [--apply] [--publish] [--dry-run] | Synthesize + verify; optional fleet promote via /v1/rules/promote |
| rulecloud telemetry push [--dry-run] | Upload redacted .guardrail/audit.jsonl blocks to /v1/telemetry/audit |
| rulecloud sync-hooks --pull | Pull approved fleet rules, merge locally, recompile hooks |
sync-hooks embeds a SHA-256 of .guardrail/rules.yml in hook metadata and installs guard scripts. Claude hooks include onFailure: "block" so a broken guard blocks tool calls instead of failing open. Runtime hardening includes:
- PreToolUse normalization (subshell unwrap, inline base64 decode, concat/path normalization) before pattern checks.
- Built-in anti-tamper self-protection (disable with
self_protect: false) blocking Write/Edit/MultiEdit/Bash against guardrail + hook config; ClaudeConfigChangehooks fail closed. - PostToolUse quarantine that blocks leaked credentials and indirect prompt injection content from tool output.
rulecloud auditscans.cursor-plugin/plugin.jsonfor unvetted hooks,curl | sh, sensitive paths, and unpinned MCP servers.
Ignored paths
node_modules, .git, .next, dist, venv, .venv, build, target, __pycache__
