#10357: Guardian: add validation script + docs
docs
scripts
commands
agents
stale
Cluster:
Security Enhancements and Fixes
## Summary
- Add a lightweight Guardian validation script to compare Stable vs Guardian ports, verify audit logging, and ensure configs are unchanged.
- Document the validation workflow for diagnostics.
## Notes
- Guardian layer remains optional and non-breaking; default behavior is unchanged.
- Audit logging is append-only and safe.
## Testing
- corepack pnpm exec tsx scripts/guardian-validate.mts
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Introduces a new optional **Guardian** layer (config + enforcement) that checks file/system actions against path rules and writes append-only JSONL audit logs.
- Wires Guardian into key action entrypoints: `apply_patch` file modifications, `exec` command execution, and OpenClaw coding tool wrappers.
- Adds a `scripts/guardian-validate.mts` script to compare Stable vs Guardian behavior/perf and confirm audit logging + config immutability.
- Adds docs describing Guardian and the validation workflow, and updates docs navigation to include them.
<h3>Confidence Score: 2/5</h3>
- This PR needs fixes before merge due to security/behavioral issues in Guardian enforcement and auditing.
- Guardian enforcement is currently inconsistent (notably reads are not guarded), and audit logging for exec records full command strings which can persist secrets to disk. There is also a likely schema brace/nesting issue in the zod config that could break config validation.
- src/agents/pi-tools.ts, src/agents/bash-tools.exec.ts, src/config/zod-schema.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8086: feat(security): Add prompt injection guard rail
by bobbythelobster · 2026-02-03
76.1%
#14136: feat: add agent collapse safeguards and fix TUI display on abort
by liangweigain-create · 2026-02-11
75.2%
#19500: Custom rust ultimate rewrite
by adybag14-cyber · 2026-02-17
75.2%
#7085: test: skip flaky workspace-paths & safe-bins tests on non-Linux/CI ...
by ThinkIbrokeIt · 2026-02-02
74.9%
#13042: feat(security): add guard model for prompt injection sanitization
by TGambit65 · 2026-02-10
74.5%
#6095: feat(gateway): support modular guardrails extensions for securing a...
by Reapor-Yurnero · 2026-02-01
73.8%
#14222: core: add needsApproval to before_tool_call; move AgentShield to ex...
by Eventedge · 2026-02-11
73.8%
#10367: CLI/Ops: resilient browser fill + failover hardening + operations t...
by cluster2600 · 2026-02-06
73.8%
#10514: Security: harden AGENTS.md with gateway, prompt injection, and supp...
by catpilothq · 2026-02-06
73.3%
#17273: feat: add security-guard extension — agentic safety guardrails
by miloudbelarebia · 2026-02-15
73.1%