TechniquecurrentRunning agents

How to decide whether an agent constraint is a prompt rule or a code check

Three buckets for every constraint in an agent prompt.

SymptomYour outbound prompt carries a long must-not list, and per-batch rules such as caps or no-repeat openers still fail.

The outbound email pipeline I built kept accumulating slot rules, phrase bans and per-batch caps. Stacked in the prompt, the cross-item ones failed first in drafts, because no single generation call sees the whole batch.

Every constraint now goes in one of three buckets.

  • Procedural micro-rule: one principle in the prompt, plus a deterministic check after the stage.
  • Honesty, brand or human-commitment rail: stays hard; its literally checkable part becomes lint.
  • Schema, enum or curated menu: stays, and gets stronger.

I write non-negotiables as failing tests rather than sentences. My signal-based selling package is no-send, and a test fails on any send surface in its source. A prose rule degrades quietly, and a failing test can't.

The Claude Code hooks guide describes hooks as shell commands run at fixed points in the lifecycle that give deterministic control, so actions happen without relying on the model to choose them.

I prove a new gate by replay instead of fixtures. Replay on a batch a reviewer already graded caught a softened ask for feedback, a variant of a banned opener that my synthetic fixtures missed.

Incident history stays out of the prompt. When I split a 99K agent prompt into operative rules and a maintainer-only ledger, pure narrative was only about 5.6K. Most explanation that reads like story is mechanism.

The sorting still takes judgment. Telling a rule that compensates for a model weakness from one born of a market defect takes an A/B test at each model change. Overused phrases stay banned whatever the model.

Check your setup read-only

Take the prompt file of each agent that generates text in batches. List the constraints in the file. Mark each constraint as procedure, rail or schema. Look in the code that runs after the prompt's stage for a check on each procedural constraint. Any cross-item rule with no code check is a gap.

Passes ifEvery cross-item procedural constraint in the prompt has a matching code check after the stage.

Access needed:local-config

If it fails: changes to make later (not part of the check)
  1. 01Sort every prompt constraint into procedure, rail or schema.
  2. 02Move each procedural rule into a check that runs after the stage. Leave one principle in the prompt.
  3. 03Write each non-negotiable as a test that fails, such as no send surface in a no-send package.
  4. 04Validate a new gate by replay. The gate must fire on every finding in a reviewer-graded defect batch. The gate must stay silent on a clean sibling batch.
  5. 05Keep operative rules inline. Move incident history to a file the agent never loads.
Applies ifA job in your setup has an agent generate more than one buyer-facing message or CRM value per run.

← Back to the stream

For your agent

Each post has a read-only check your agent can run against your own setup. Paste this into a read-only session:

Never asks your agent to change anything · send anything anywhere · fetch other pages · run code · read something you can't.

What each rule means, and how it's enforced
  • Change anything. Every check is a question answered by reading. Each one names what it reads. The steps under “If it fails” are for you to weigh later, never part of a check.
  • Send anything anywhere. No post asks an agent to email, post, submit, upload or report back. Your results stay with you; sharing them is your call.
  • Fetch other pages. Post text carries no links, and no post tells an agent to visit one. The only URLs in the feed point to this site's own post pages.
  • Run code. Snippets are illustrations, not commands.
  • Read something you can't. posts.json is generated from this page, field for field. Nothing is hidden from a human reader.

A gate enforces these rules before every publish: it refuses links, instructions aimed at an agent, write verbs inside a check, hidden Unicode characters and any check without an "access needed" line. Each published version carries a version number and a sha256 fingerprint, so you can pin the version you reviewed. Every post is reviewed by a person before it goes out.

Feed version 1.0 · 2026-11-16 · sha256 88d19978389827b7…

Found something that breaks these rules? Tell me on LinkedIn.