An AI agent that checks its own work before anything goes out
An AI agent self check before sending: rules in plain words, checks code can make for free, and drafts that fail sent back to be rewritten with what was wrong.
Part of the guide AI employees
An AI agent self check before sending is a second pass over everything the AI wrote, against rules you set, before a customer, a colleague or a CRM sees it. In xMap Flows that pass is the Check the work block: it reads each draft, tests it against your rules, and a draft that fails goes back to the AI that wrote it with the reasons, gets rewritten and is checked again. Only work that passes, or that you chose to keep marked, carries on.
This is for teams that already let AI write emails, summaries or chat answers and still read every one before it leaves, because once in a while one quotes a number that is not in the data, runs too long or slips into the wrong tone. It covers what can be checked, how a redo works, an example from a recruitment firm, and how to choose what happens when a draft keeps failing.
Why one pass is not enough
A language model writes the most likely next words. Most of the time that is exactly right. Sometimes it is a confident sentence about a fact it was never given, a pitch twice the length you asked for, or a phone number copied into a reply where it should not be. Asking the same model to be more careful in its instructions helps, but it cannot be sure it followed them while it was writing.
A separate check reads the finished draft with fresh eyes and only one job: does this meet the rules. That is how an editor works, and it is why the check is its own block rather than a longer instruction.
What Check the work can test
Put Check the work right after the xMap LLM or AI agent whose writing you want checked. A Filter or a Sort between them is fine. It knows three kinds of rule:
- Ready-made checks you tick: every item has a phone, a website or an email; no numbers that are not in the item's own data; no personal data such as email addresses, phone numbers or ID-like numbers in the text; written in one language you name.
- Rules code can check, written in your own words: under 120 words, no emojis, every lead has a phone. These are checked by code, for free, and never guessed.
- Rules only words can say: a formal tone, mentions the role they are hiring for, does not promise a delivery date. xMap AI judges these, item by item.
You choose what it reads. Automatic checks the fields the AI block before it wrote. Fields I choose checks only the ones you name, such as the email body but not the subject. The run's report checks a single report an xMap LLM wrote about the whole list, which suits a weekly brief.
How a redo works
With If it fails set to Send it back, only the drafts that broke a rule go back, each with a note of what was wrong: the email is 164 words; the limit is 120, or gives a salary figure that is not in the posting. The AI rewrites those few with the note in hand, and Check the work reads them again. You set how many tries a draft gets, up to three.
When a draft still fails after its last try, you decide: remove it, or keep it with check_passed set to No and check_issues saying why, so a person can fix it. Every item carries those two fields, and check_redone says how many times it went back, which tells you which rules the AI struggles with.
An example from a recruitment firm (made up)
A recruitment firm in Singapore sends a short note to companies that start hiring for finance roles. Each morning Job postings finds new postings, Apollo finds the head of finance at each company, and xMap LLM writes the note. The partners had three complaints about the drafts: some ran on, a few mentioned salary ranges the posting never gave, and now and then one opened with a cheerful exclamation that did not suit a senior reader.
They added Check the work with four lines: under 110 words, no numbers that are not in the posting (the ready-made check), names the role being hired for, formal, no exclamation marks. Drafts that fail go back up to twice; any still failing are kept and marked for the consultant.
On a typical morning of, say, thirty drafts, most pass at once, a handful come back shorter or without the invented figure, and one or two land in the consultant's list marked with what was wrong. The consultant now reads two drafts instead of thirty, and knows exactly what to fix in each.
Checking a chat agent's answers
The same block works for conversations. A tourism office in Buenos Aires runs a chat page where an AI agent recommends places to visit. Between the agent and Reply sits a check with two rules: written in Spanish and no personal data. An answer that drifts into English, or repeats a visitor's phone number back to them, is written again before the visitor sees it. Because a redo takes a moment, keep chat rules short and clear.
Choosing what happens on a fail
- Send it back suits writing that the AI can fix: length, tone, a missing mention.
- Keep only the ones that pass suits lists where a weak item is simply dropped, such as leads without a phone.
- Keep everything, marked suits work a person reviews anyway: they see the flag and the reason beside each item.
- Pair it with an Approval when the cost of a wrong message is high. The check removes the obvious faults so the approver reads fewer drafts and catches the subtle ones.
Test runs check and redo too, and send nothing, so try your rules on real data before going live. In the editor's preview the code checks run straight away, and the rules for xMap AI wait for a run on the server.
A self-checking step is part of giving an AI employee more freedom safely. The guide to AI employees explains how to decide how much each one does on its own.
Questions
Does checking slow the flow down?
Code checks are instant. Rules judged by xMap AI and any redos add a few seconds per item that needs them, which matters most on a live chat page.
Is a redo paid again?
A draft sent back is rewritten at the price of the AI block that redoes it. Code checks cost nothing.
Can it check a whole report rather than each item?
Yes. Set What to check to The run's report and it reads the one report an xMap LLM wrote about the whole list.
What if the AI keeps failing the same rule?
Look at check_issues across a week of runs. A rule that fails often usually needs a clearer instruction in the AI block itself, with the check left as the safety net.
Templates that do this
Read next
More on ai employees and automation · Every article · Templates