Lessons / Part 5. Writing and publishing with AI
29 A scripted gate before anything goes out
A script refuses any report that carries a listed term or lacks its review and release flags, and names the check that fired.
What people usually ask
Make sure nothing restricted ever goes out in our reports.
What comes back
A line added to a rules file asking the assistant to be careful, which the next session may or may not read, and which enforces nothing.
Ask this instead
Write check_release.py. It takes a folder of Markdown reports and refuses a file when any of these holds:
1. a term from restricted_terms.txt appears in it (whole words, case insensitive)
2. the front matter has no line "reviewed: true"
3. the front matter has no line "release: true"
For every refusal print the file name, the number of the check that fired and, for a term hit, the term and the line number. Exit with a non zero code when any file is refused, so a release step after it cannot run.
No exceptions list and no allow list. When a term fires on an innocent sentence, I reword the sentence; the list stays as it is.
Run it on <reports folder> now and show the full output. This is a gate only: every file still gets read by a person before it goes out.
Attach: restricted_terms.txt and a note of the folder layout, with one report showing what the front matter looks like.
Why it works: A script applies the same three checks to every file and names what it caught, so the rule no longer depends on the model remembering it.
Drafted with Fable 5.1 from my notes; chosen and edited by me.