Agent engineering
Pre-Flight: The Checks That Run Before an Agent Publishes
Guardrails written as instructions are suggestions. Guardrails written as code are guardrails.
Key takeaways
- Deterministic checks belong outside the model, in code, after generation.
- Nine checks catch the overwhelming majority of embarrassing publishes.
- Every block must name the failed check, a silent block is an outage.
- Pre-flight is cheap; the incident it prevents is not.
The instinct is to solve output problems with better prompting. It works about seventy percent of the time, which is a catastrophic reliability figure for anything that publishes under a real name. The remaining thirty percent is what pre-flight is for.
Pre-flight runs after generation, after critique, before the publish call. It is ordinary code with no model in the path, so it behaves the same way every time, which is the entire point.
The nine
- Banned phrases. String match against the voice profile ban list. Zero tolerance, instant block.
- Placeholder detection.
[INSERT,TODO,XX,Lorem,{{,your company here. This check has saved us twice and both would have been humiliating. - Unresolved template variables. Anything matching
{{\w+}}or${...}that survived rendering. - Claim-to-evidence linkage. Every sentence containing a number must reference an evidence ID from the brief. Numbers with no provenance are the highest-risk content in any draft.
- Link validation. HEAD request every URL. A 404 in a published post is a small, permanent embarrassment.
- Duplication window. Similarity check against everything published in the last 90 days. Above threshold, block and surface the near-match.
- PII scan. Emails, phone numbers, and anything shaped like a customer identifier. Regex plus a named-entity pass against your CRM.
- Length and format. Channel-specific limits enforced before the API rejects them, so failures surface in review rather than at 6am.
- Attribution completeness. Every borrowed statistic has a linked source. Missing source is a block, not a warning.
Ordering matters more than it looks
Run the cheap deterministic checks first. Banned phrases, placeholders, and template variables cost microseconds; link validation costs network round trips; the similarity check costs an embedding call. There is no reason to pay for embeddings on a draft containing the string TODO.
tier 1 (free, instant): banned, placeholder, template, format
tier 2 (local compute): PII regex, claim-evidence linkage
tier 3 (network/cost): link HEAD checks, duplication similarity
fail fast at the first tier that blocksWhat pre-flight cannot do
It cannot tell you the post is boring, wrong-headed, or badly timed. Those are judgement calls, and they belong to the critic model and the human reviewer respectively. Pre-flight has exactly one job: ensure nothing mechanically defective reaches an audience.
Conflating the two is a common design error. Teams put "is this interesting?" into the pre-flight layer, it returns a probabilistic answer, and now the deterministic gate is no longer deterministic. Keep the layers separate: judgement upstream, mechanics at the door.
The last check before publish should be the one you can reason about at 3am without reading a model card.
Instrument the checks themselves
Log every pass and block by check name. Over a few months the distribution tells you where the generation stage is genuinely weak. If the claim-evidence check blocks 15% of drafts, that is not a guardrail success story, it is a research stage failing to attach evidence. Guardrails should get quieter over time. If yours are not, they are papering over an upstream defect.
Related: evals or it did not ship and autonomy levels.
Every check in our gate, with the reasoning behind each one, is listed at my site (opens in a new tab). The enforcement layer is built and maintained at TechTide AI (opens in a new tab). A gate nobody can override is not a gate, it is a wall.
“Never ask a model to check something a regular expression can check.”
Questions people actually ask
- What are AI guardrails in practice?
- Deterministic checks in code that run around the model (before input and after output) rather than instructions inside the prompt. Code cannot be talked out of enforcing a rule.
- Should guardrails use a model?
- Only for things code genuinely cannot decide, like tone or claim accuracy. Anything a regex, string match, or HTTP request can verify should never go to a model.
- What is the single highest-value check?
- Placeholder detection. It is trivial to implement and prevents the most publicly embarrassing class of failure.
- Do guardrails slow down publishing?
- Tier one checks are microseconds. Even with link validation and similarity scoring, total pre-flight is typically under two seconds. Negligible against the cost of one bad publish.
Sources & further reading
Written by
Alex Cinovoj, Founder, TechTide AI
Alex Cinovoj builds ClawLI at TechTide AI, a fleet of specialist agents that research, draft, schedule, and grade LinkedIn content with a human approving every send. He writes about what breaks when you put agents in front of a real audience.
Keep reading
- Agent engineeringMulti-Agent Systems Fail QuietlyMulti-agent systems degrade without erroring. Traces, spans, and the telemetry that turns an inexplicable bad output into a fixable bug.
- Agent engineeringEvals or It Didn’t ShipLLM evals for agents that write, when there is no correct answer. Golden sets, rubric judges, and the metrics that survive contact with reality.
- Agent engineeringYour Agent Costs 10x More in Production Than in the DemoWhere the money actually goes when an agent leaves the prototype: retries, context growth, judge models, and the human review nobody budgeted.