JevMade Sign in
← Back to guides

JevMade field notes / Tool-call guard walkthrough

Combine fixed rules with checks on an AI's proposed actions

Shane Larson builds a two-layer check for an AI assistant's proposed actions: fixed rules set a minimum restriction, and Jev can ask for stricter handling.

Original by Shane LarsonGuardrails

Listen to this guide

JevMade’s plain-English explanation

0:00 /

Our summary

An AI assistant can understand a message yet propose the wrong action. Shane Larson places a check between the assistant's proposal and the tool that would carry it out. Ordinary code sets rules for known tools, refund amounts and destructive commands; Jev compares the proposal with the user's request.

Code combines Jev's answers about actions beyond the request, outside instructions and harm with the fixed rules. On success, it uses whichever result is stricter: allow, confirmation, review or denial. It ignores recommendations the model is unsure about. Suspected outside instructions need another agreeing signal to cause denial rather than review.

Larson adjusted the checks using the same eleven examples he later reports as passing. That is not an independent safety test, and the store tools are fake. A separate script checks actions in Claude Code only while it succeeds. If Jev or another step fails, ordinary Claude Code permissions remain.

Key takeaways

  1. Keep exact limits and amount comparisons in code; a model must not lower the restriction those rules require.
  2. Compare the proposed action with the user's words and distinguish instructions in outside content from the user's request.
  3. Test on new examples and decide what failures should do. If this checking script fails, normal permissions remain but its extra rules do not run.

The eleven test cases were used to adjust the checks. The live assistants rejected the planted instructions themselves, so that run did not test catching a fooled assistant. The archived code uses the stricter rule on successful calls, but errors, including failure to save a log, can skip the script's extra decision.

Grizzly Peak Software · Original published

Read the original guide Opens the author’s site in a new tab.

Keep this for later

Sign in to bookmark experiments, guides and videos, and keep notes only you can see.

Continue to sign in

We’ll bring you back to this listing.