AI agent prompt: how to set a task so the agent gets it right
To keep an AI agent from making mistakes, put four things in your very first message: what counts as done, where to take the data from, where it decides on its own and where it asks you, and how to check the work. Without a check, the agent will finish when the work only looks done. You do not need a long prompt. Start with the sign by which you will accept the result, and write it down before you start the agent.
Roman Kaufman, founder of Kaufman Lab · Data as of: October 2026
In early December 2025, a designer from Greece was building a photo sorting program in Antigravity, Google's AI agent. He asked the agent to clear the project cache, meaning the temporary files. The agent wiped the whole D drive without asking and bypassed the Recycle Bin, The Register reported. The request did not say what to do outside the project or what to show at the end. According to reports, command confirmation was also turned off. That is the mode where the agent waits for your "yes" before it acts. The request can be rewritten in four lines.
An AI agent says "done" when the work only looks done
An AI agent is a program that carries out the steps of a task by itself. It stops when the work looks finished. This is stated in the Claude Code documentation, Anthropic's agent. If there is no check the agent can run on its own, it will not know it made a mistake, and you will have to do the checking.
This happened to us with a personal AI assistant that builds a task summary every morning. On August 24, 2026, the "Today" section had 13 tasks, but only 10 made it into the summary.
The assistant showed no error and no warning, and the list looked complete, even though three tasks were missing. Now the code matches each task by its opening words and checks that every task from "Today" made it into the summary.
Your agent may also say "done" about a page it never opened on a phone, if you did not ask it to open it.
A task for an agent fits in four lines of one message
A prompt is the text of a task for an agent. It rests on four lines, and you can copy their opening words.
- "Done when..." plus a sign you can see, for example "the page opens on a phone".
- "Take data from..." plus which files it may use. Here also say what is not part of the task.
- "Ask before..." plus the points where the agent stops, for example deleting or paying. If the answer is not in the data, it should say "I don't know" and ask you.
- "Show..." plus how the agent proves the work, for example a screenshot or a test.
Write it all at once, in one message. In a study by Philippe Laban and co-authors (May 2025), more than 200,000 conversations were run on 15 models. When the task was given piece by piece, one turn at a time, quality dropped by 39% on average across six types of tasks. This was measured on chats, not on building a website.
Before you start, decide how you will accept the agent's work
The acceptance bar, meaning the sign of "done", is written down before the start. Otherwise it gets adjusted to fit whatever came out. And a "yes" from the agent without proof means little, because a model tends to confirm what it was asked about.
When we reviewed 29 competitor websites, we asked a model to check whether they state a price or a timeframe for the client. The model answered "yes" almost every time. So we accepted a "yes" only with a word-for-word quote, and code checked that the number from the quote was on the page. This way 9 "yes" answers out of 29 were thrown out, and 20 sites passed the check.
If the agent answers your clients, the bar needs to be in numbers. For our AI lead manager, we wrote it down before launch. On 9 conversations taken from real inquiries, it had to get at least 90% of answers right and give zero facts from outside its knowledge base. It also had to resist 10 attempts to slip it a command to break the rules.
How to set a task for an agent today
An agent is kept safe by a boundary and a check, written down before the start. The designer's request in four lines would look like this. "Done when the cache folder inside the project is empty. Take data only from the project folder. Ask before deleting anything outside it. Show the list of what you deleted." The third line would have saved the drive, but still do not turn off command confirmation.
- Take one task, one page, not the whole site. Task by task, this is how we built our own website together with AI.
- Start your message with that task and add the four lines: "Done when...", "Take data from...", "Ask before...", "Show...".
- Compare the agent's reply with the "Show..." line. No screenshot or test means the work is not accepted.
If you have corrected the agent in one place more than twice, do not keep going in the same chat. Open a new one and give it the fixed task. This is what the Claude Code documentation and the study authors advise. In a long chat, the failed attempts get in the way. If the agent did the job, save the task as a template for next time.
Frequently asked questions
What is a system prompt?
A system prompt is a set of standing rules the agent gets in every conversation before your message. Keep only the rules without which the agent would make mistakes. The Claude Code documentation advises asking about each line: would the agent start making mistakes if you removed it? A bloated list of rules does harm, because the agent starts skipping real instructions.
Is a ban in the prompt enough to stop the agent from doing something dangerous?
No. A ban in the prompt is still just a request, and the Claude Code documentation itself calls rules from a file a recommendation. What protects you is command confirmation, so do not turn it off. The designer whose drive the agent wiped had a no-confirmation mode turned on, according to The Register.
Can I give the agent a task and walk away?
Yes, if the agent runs a check itself, for example a test or a comparison with a screenshot. If there is no such check, it is too early to walk away: you will have to verify the result yourself anyway.