Implement a state machine that enforces structural safety guarantees:
- RESOLVING: Initial state, must discover resources before writing
- READING: Read tools allowed after discovery
- WRITING: Transitions to VERIFYING after any write operation
- VERIFYING: Must perform read verification before next write
This prevents:
- Write operations without resource discovery
- Consecutive writes without verification
- Final answers without post-write verification
The FSM is enforced at the tool execution layer, providing defense-in-depth
that doesn't rely on prompt instructions alone.