# Claude Code agent hooks for guardrails

Gate and validate agent actions by classifying hook events \(pre-tool, post-tool, stop\) and deciding block/allow/mutate on each action

Grade: S — Top tier. Meets A, and the payoff is major with high confidence.. Score: 5.63.

Vertical: Software & tech.

Function: Agents & dev.

Status: Seen in the wild.

Volume: high.

Value: major.

Risk: high.

Evidence: described plan.

Flags: human-review.

- [Source](https://bitbytebit.substack.com/p/agent-hooks-deterministic-guardrails)
- [Vertical](/verticals/saas_tech/)
- [Function](/functions/agents_dev/)
- [Prompt injection detection guardrail](/use-cases/prompt-injection-detection-guardrail/)
- [LLM output safety classification](/use-cases/llm-output-safety-classification/)
- [LLM cost-quality routing with RouteLLM](/use-cases/llm-cost-quality-routing-with-routellm/)
- [Claude Code hooks pre-tool-use validation](/use-cases/claude-code-hooks-pre-tool-use-validation/)
- [Log sensitive-data leak](/use-cases/log-sensitive-data-leak/)
- [Prompt injection scanner](/use-cases/prompt-injection-scanner/)
