# Claude Code setup with guardrails for production work

> The agent environment we use to build production systems: guard hooks before tool calls, secrets in a vault, and a fixed loop of plan, independent critic, checks and validator.

- Service: AI agents and Claude Code / Codex setups for teams
- Stack: Claude Code, hooks, skills, subagents, Python
- Canonical: https://jamm-automation.com/cases/claude-code-guardrails/
- Updated: 2026-11-29

## Manual

An agent with shell access is one command away from deleting a folder, printing a secret or reporting "done" on unchecked work.

- **Prompt rules:** a line asking the agent to be careful is not a control.
- **Verification:** nobody checks the result unless the process forces it.

## System

Guard hooks run before tool calls, and large tasks follow one fixed loop.

- **Destructive commands:** wait for explicit confirmation.
- **Secrets:** values are blocked from commands and scanned for in output; they live in a vault, not in code or chat.
- **Network:** outbound access is restricted.
- **Loop:** written plan, review by an independent critic agent that sees the plan without the author's reasoning, execution with a check after every stage, then a validator agent that checks the live result.

## Autopilot

The environment enforces the rules; the agent does not have to remember them.

- **Enforcement:** hooks run before tool calls, regardless of what the prompt says.
- **Closing:** a large task closes after a validator agent has checked the live system.
- **Open source:** the plan, act, verify part is published as our plugin checkride.
