What this is about
You can give an AI agent a rule in two ways. You can write it in the instructions: "Always use the search tool before opening files." Or you can build a check that stops the agent when it breaks the rule.
The first is a wish. The second is a rule. This article shows the difference with real cases from our machine, and gives you a quick way to tell which one you have.
Why it matters
Agents are good at following instructions most of the time. "Most of the time" is not enough when the rule protects something: a secret, a shared folder, a bill.
If a rule matters, you want it to hold on the day the agent is in a hurry, or the instructions are long, or the model simply does not think of it. A wish does not hold then. A check does.
How it works
The wish: a line in a file
An instruction file is text the agent reads at the start. It works like a notice on a wall. The agent may follow it. Nothing happens if it does not.
We learned this on a plain case. Our instructions said that code search should go through our knowledge graph first. The agent still reached for a raw text search first, even though the session instructions said otherwise. The written rule was not enough.
The check: a hook that blocks
A hook is a small program that runs at a set moment, for example just before the agent uses a tool. It can look at what the agent is about to do and say yes or no.
For the search case, we built a hook that blocks the first raw search and sets a marker once the preferred tool has been used. After that, every later call goes through. We call it gating the first move. It is a nudge with teeth at the exact moment when habit beats instruction.
Good checks stay narrow. Ours has one trigger (the first raw search), one change of state (after the preferred tool is used) and an escape hatch for a deliberate audit. A check that blocks too much teaches people to switch it off.
The danger: a check that is not really there
Here is the case that taught us the most.
On 20 July we wrote that a hook injected our list of token cuts into every Claude Code run. On 26 July we found that the settings file had no hooks block at all. The hook never ran. Neither did 18 other hook scripts, 19 in total. The panel said "enforced" for six days while nothing enforced it.
Its own log later said it plainly: the enforcement claim was false when written.
Why did nobody notice? A tesseract install on the same machine showed the pattern. It had no English language data, so it exited with success and printed an empty line. That looks exactly like a picture with no text in it. Our receipt put the lesson this way: a policy whose failure mode is silence will not be noticed.
The fix was to rebuild the hooks block from the scripts on disk. It now lists 17 hooks across five events. And we changed what counts as enforcement.
What counts: a hook that appears in the settings file and fires on its event, and a log line from that hook in a fresh run.
What does not count: a checkbox, a line in a panel, or a rule in an instructions file.
Three questions to sort your rules
Take any rule you gave an agent and ask:
- What happens if the agent breaks it? If the answer is "nothing," it is a wish.
- Where would I see the block? If you cannot name the message or the log line, you cannot tell whether it works.
- When did I last see it fire? If never, test it with a deliberate break.
Not every rule needs a check. A style preference can stay a wish. But a rule about secrets, deletions or shared files should be a check, and you should have seen it fire once.
Where the rule and the check meet
The best setup uses both. The written rule explains why. The check enforces it. When a check blocks a call, the message it shows should name the fix. In another case of ours, a guard blocked a read and told the agent which tool to run instead. A refusal that only says no sends the agent back to the same wrong move. A refusal that carries the fix ends the search.
Our ledger of mistakes follows the same idea: when a mistake repeats, the lesson becomes a gate in the same turn, so the next session meets the rule at the moment it would repeat the mistake, and not only when it happens to read the file.
Glossary
- Rule: something an agent must or must not do.
- Instruction file: a text file the agent reads at the start of a session.
- Hook: a small program that runs at a set moment, such as before a tool call, and can allow or block it.
- Gate: a hook that blocks an action until a condition is met.
- Marker: a small saved note that a step has happened, so the gate lets later calls through.
- Escape hatch: a deliberate way to switch a check off for one call.
- Silent failure: a failure that shows no error, so nobody notices.
Try it
- Browse our skills. The skills page shows how we package knowledge for agents. Read one with the sort questions above in mind: which lines are wishes, and which would need a check?
- Check your own wiring. If you use an agent with hooks, open its settings file and look for the hooks block. Then run one task and look for a log line from each hook. If a hook has no line, it may be like our panel.
- Break a rule on purpose. Pick one rule you rely on and try to break it in a safe test. See what blocks you. If nothing does, you have a wish.

Comentarii
Niciun comentariu încă.
Conectare pentru a comenta.