Native Rust PreToolUse and Lifecycle Guardrails
How do you stop coding agents from running destructive commands or faking tests?
Vestige replaces fragile bash or Python regex scripts with a native Rust binary called vestige-hook that runs in under 10 milliseconds across Claude Code, Cursor, Windsurf, Codex CLI, and Antigravity. It blocks unsafe tool calls before execution, saves your rules and commits automatically to Strata, and verifies receipts before turns end.
What does a blocked command look like in practice?
Agent attempts: git reset --hard HEAD~1
Vestige hook: BLOCKED (OP-004): git reset --hard wipes uncommitted work.
Agent attempts: npm install untrusted-pkg
Vestige hook: BLOCKED (OP-SUPPLY-CHAIN): installing packages without --ignore-scripts
executes untrusted lifecycle scripts.
Agent attempts: cargo test || true
Vestige hook: BLOCKED (OP-TEST-INTEGRITY): || true hides real test failures.
Run the check directly and inspect its real exit code.Core rule families enforced by vestige-hook
| Rule Family | What It Protects | Blocked Examples | Outcome |
|---|---|---|---|
| OP-004 | Git destruction and hook bypasses | git reset --hard, git clean -fdx, git commit --amend, --no-verify, HUSKY=0 | Blocks destructive resets and hook skips before the repository loses uncommitted edits. |
| OP-CLOUD-INFRA | Cloud, database, and package publishing | terraform destroy, kubectl delete, aws s3 rm, supabase db reset, npm publish | Halts irreversible infrastructure teardown or public package releases without explicit owner approval. |
| OP-SUPPLY-CHAIN | Lifecycle script remote execution | npm install pkg or pnpm add pkg without --ignore-scripts | Prevents untrusted postinstall scripts and slopsquatting payloads from running during package installs. |
| OP-TEST-INTEGRITY | Hidden test exit-code masking | cargo test || true, pytest; exit 0, set +e before test runners | Forces agents to inspect real non-zero test failures instead of faking green checks. |
| OP-TRIFECTA-EGRESS | Outbound exfiltration and smuggling | webhook.site, ngrok sinks, DNS subshell tunnels, Unicode TAG or Bidi smuggling | Blocks known exfiltration domains and concealed characters before secrets leave the machine. |
| Chesterton Fence & Anti-Spiral | Guarded bug fixes and blind edit loops | Overwriting guarded code or repeating failed commands without causal inspection | Requires the agent to run causal_walk or recall on prior commit causes before editing. |
Automatic memory capture without manual reminders
Whenever you tell your agent a standing instruction, the PreInvocation hook detects the rule and writes it into Strata as a pinned owner directive before the agent replies. When you make a git commit, the post-commit hook anchors the commit SHA and modified line ranges in Strata so Chesterton's Fence protects that fix in every future session.
npx @vestige/init --guard