Toolchain Setup

Project Rules, Hooks, Guardrails & CLI/MCP Wiring

01 / 12

In Practice

  • Write a tight AGENTS.md / CLAUDE.md: project overview, scripts, and team conventions agents should follow
  • Split deep rules into skills so the always-on file stays lean
  • Run in safe auto mode, not YOLO: let it act, but keep approval on risky stuff
  • Add deny rules so it cannot read sensitive data like .env files or secrets manager
  • Map trust boundaries clearly: secrets, PII, auth paths, external inputs, privileged commands, and untrusted sources the agent must treat as data, not instructions
  • Use PreToolUse hooks for guardrails that static rules alone cannot prevent
  • Wire only the CLIs / MCP you need; vet MCP servers first, and disable the rest
  • Treat what the agent reads as untrusted: issues, READMEs, and tool descriptions can hijack it
  • Review and scan its output: AI code can carry vulnerabilities and look-alike packages
  • Codify repeated corrections back into the rules file, not just that thread alone

Page 5 of 72: Toolchain Setup: In Practice

Contents