Automatic checks stop AI agents from slowly breaking document rules
that maintain memory stores, linked notes, or generated documents can follow formatting rules at first and then drift during long tasks. In one test, metadata field names changed, pages grew to three times the requested length, and links back to the index appeared only about 60% of the time. With a , the agent sometimes treated warnings as acceptable exceptions or traded one instruction against another.
Rewriting the prompt three times did not keep the documents within their required structure. A running after every file write instead identified each broken rule and the needed correction. One brought the pages back within their size limits and produced a large one-step improvement in later s.
The structure-checking part was separated into a standalone ed , which defines rules for the structure of Markdown documents.
Key points
- Document rules can degrade as an agent works for a long time.
- Links back to the index were preserved only about 60% of the time in the reported test.
- Three prompt revisions failed to keep the document structure stable.
- A checked every write and named both the violation and the fix.
- Moving fixed rules out of prompts may reduce token use and repeated repair work.