What you can unit-test
You cannot deterministically unit-test 'the model picks the right tool', but you can test: tool definitions are valid JSON Schema, hooks return the expected verdict for each pattern, the permission handler approves/denies correctly, and the audit logger emits the right shape. The deterministic seams around the model are testable normally.
What needs integration tests
End-to-end behavior — does the agent solve the task, does it stay within sandbox, does it produce correct citations — needs integration tests against a date-pinned model. Write them as scenarios with expected behavioral assertions ('produces a one-line summary', 'never calls Write', 'cites at least one source').
Regression tests for safety
The most important tests are the ones that prove your defenses fire. Inject a known prompt-injection string in a fixture; assert the agent surfaces it. Provide a deny-listed Bash command in a prompt; assert the hook refuses. These tests catch the day someone removes a safeguard 'because it was failing'.