2026-11-16Gunner Technology
If a Machine Can Check the Rule, Stop Writing Reminders
Yes: enforce an AI agent instruction in code whenever a machine can detect the violation. Prose should explain intent and guide judgment. It should not carry a production boundary that the agent is free to forget.
Which AI agent instructions belong in code?
Any instruction with a detectable pass or fail belongs in code. Required file shapes, forbidden dependencies, permission boundaries, test commands, formatting rules and release conditions are not advice. They are acceptance criteria, which means the factory should evaluate them the same way on every run.
Start with the consequence. If breaking the instruction could expose data, ship a broken route or create work that must be repaired, the control cannot depend on whether the model noticed one paragraph in a long document. Put the rule at the boundary where the action happens, and make failure stop or reroute the work.
This does not make the instruction file useless. Keep a short explanation there so the agent understands what the control protects and how to satisfy it. But let the validator carry authority. Your task runner is an agent interface because one stable command can expose the real contract without asking every model to rediscover it.
What should stay in the instruction file?
Keep intent, local context and judgment calls in prose when they cannot be reduced to a reliable mechanical test. An instruction can explain why a migration must preserve an old behavior, which trade-off a product owner chose or when an uncertain result needs a person. Those details shape the work without pretending every decision is binary.
Write that guidance for the next action. Name the situation, the expected decision and the evidence the agent should return. A history lesson that never changes a choice is baggage. A vague principle such as use good judgment is not a boundary. If the agent needs a person, say what question it should ask and what work must wait for the answer.
Keep the prose small enough to remain visible. Duplicate instructions drift, and contradictions force the agent to choose which rule sounds newer. Agent documentation needs a cleanup rule, so remove stale copies only after the surviving control and its references are proven to work.
How do you turn a repeated reminder into a control?
Turn a repeated reminder into a control by naming the forbidden state, placing a check at the earliest reliable boundary and returning a repairable failure. Do not begin by converting the sentence into a larger prompt. Begin with the event the factory can observe.
Suppose agents are repeatedly told not to edit generated files. The observable failure is a diff that changes one of those files without running its generator. A repository check can compare the generated output, reject the mismatch and tell the builder which command owns the file. That is stronger than another capitalized warning because it catches the same violation from every model and every entry point.
Test the control against a known bad change and a known good one. A gate that never rejects anything is decoration. A gate that rejects permitted work is also broken. Keep both cases beside the control so a later toolchain or model change cannot quietly turn a real boundary back into prose.
When does an enforced rule still need context?
An enforced rule still needs context when the agent must choose a compliant path rather than merely avoid a forbidden one. A validator can reject an unapproved network destination, but the agent still needs to know which approved service fits the task. A type checker can reject the wrong shape, but it cannot decide which product behavior the shape should represent.
Deliver only the context needed for that decision, close to the work. Include the current requirement, the available route and the evidence expected at the end. Architecture has to become agent context, but context should point toward controls instead of duplicating them in softer language.
The split is deliberate: prose helps the builder choose, and machinery decides whether the result may pass. When those roles blur, the agent can reinterpret the rule while it works. When they are separate, a better explanation can improve the attempt without changing the acceptance bar.
How do you know the change worked?
You know the change worked when the targeted violation is rejected without creating a new human sorting queue. Track how often the control fires, whether builders can repair the failure and whether the same defect reaches later review or production. A falling violation count is useful only if the rule still catches the known bad case.
Do not reward the team for deleting documentation. The outcome is a smaller ambiguous surface and a stronger enforced one. Some prose will remain because software still contains product choices and exceptions that people own. The goal is not to encode every thought. It is to stop spending model attention on boundaries the factory can guarantee.
Gunner Technology's position is simple: an instruction is the right home for judgment, not enforcement. If a machine can prove the rule was broken, make the machine prove it every time. Then let people spend their attention on the decisions that cannot be compiled.
Quick answers
Should the code check replace the written instruction?
Keep a short explanation when the agent needs to understand why the check exists or how to satisfy it. Remove duplicated warning language that no longer carries a decision.
What if a rule cannot be checked perfectly?
Enforce the part you can detect reliably and route the remaining judgment to a named person or review step. Do not present a noisy guess as a hard gate.
Where should an agent control run?
Run it at the earliest boundary that sees the complete action, then repeat critical checks before release. Earlier feedback makes repair cheaper, while the release check protects the final artifact.