OpenClaw Policy Check
Run a lightweight policy scan to catch common high-risk patterns in code and scripts.
Inputs
target_path(required): file or directory to scan.fail_on(optional): severity threshold for non-zero exit. One ofcritical,high,medium,low.json_output(optional): print raw JSON output.
Workflow
- Run
scripts/policy_check.pyon the target path. - Review severity counts and top findings.
- If findings exist, prioritize
criticalandhighitems first. - Suggest concrete fixes for each flagged pattern.
Commands
python3 scripts/policy_check.py "<target_path>"
python3 scripts/policy_check.py "<target_path>" --json
python3 scripts/policy_check.py "<target_path>" --fail-on high
Response Contract
- Always include total findings and severity breakdown.
- Include top findings with
file:line, rule id, and reason. - If no findings exist, explicitly state that no policy violations were detected.
- Keep remediation guidance concrete and brief.