How is a system prompt for a long-running agent different from one for a single-shot feature?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
A feature prompt governs one response. An agent system prompt governs a loop, and the loop will visit states you never imagined. That changes what belongs in it.
Full worked answer
A feature prompt governs one response. An agent system prompt governs a loop, and the loop will visit states you never imagined. That changes what belongs in it.
What an agent system prompt needs that a feature prompt does not:
- Stop conditions and a definition of done. The single most common agent failure is not stopping: searching forever, re-verifying, polishing. Say what finished looks like.
- Error recovery policy. "If a tool fails twice with the same error, do not try a third time. Report what you tried and what failed." Without this you get retry loops that burn the budget and fill the context with identical stack traces.
- Escalation rules. When to ask the human rather than guess, and specifically before anything irreversible.
- Tool-use policy, which is different from tool descriptions. When to prefer search over the database, when to stop gathering and start acting.
- Budget awareness. A rough sense of how many steps this class of task should take.
- Ambiguity handling. Ask or assume, and if assume, state the assumption.
The hard-won principle: describe policy, not cases. A rule set enumerating 60 special cases fails on case 61 and burns attention on the other 59 the whole time. Agents need heuristics that generalise, plus the judgment to apply them.
Keep tool descriptions in the tool schema, not duplicated in the system prompt. Duplicated, they drift, and then the model has two conflicting specs.
Keep it stable. It is your cacheable prefix, and it is read on every single step of the loop, so bloat there is multiplied by the number of steps rather than paid once.
Going further: follow-up territory
And the thing to say unprompted: destructive-action prevention does not belong in the prompt. "Never delete production data" is a wish. The tool layer either has delete permission or it does not. The prompt tells the model what to do; the permission system decides what is possible.
What a good answer covers
- A feature prompt governs one response
- An agent system prompt governs a loop, and the loop will visit states you never imagined
- Stop conditions and a definition of done
- Error recovery policy
- Escalation rules
Key terms: Error recovery policy · Escalation rules · Tool-use policy · Budget awareness · Ambiguity handling · describe policy, not cases
In the glossary: Tool description · Attention · Drift
Interviewer follow-ups to expect
How would you write a stop condition for an open-ended research task?
What would you do if an agent kept asking the human too often after you added escalation rules?
- Stop conditions and a definition of done. The single most common agent failure is not stopping: searching forever, re-verifying, polishing. Say what finished looks like.
- Error recovery policy. "If a tool fails twice with the same error, do not try a third time. Report what you tried and what failed." Without this you get retry loops that burn the budget and fill the context with identical stack traces.
- Escalation rules. When to ask the human rather than guess, and specifically before anything irreversible.
- Tool-use policy, which is different from tool descriptions. When to prefer search over the database, when to stop gathering and start acting.
- Budget awareness. A rough sense of how many steps this class of task should take.
- Ambiguity handling. Ask or assume, and if assume, state the assumption.
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep