Prompt agents
Links on this page to features marked Preview describe designs that are not available yet.
An agent runs for many turns with tools and some autonomy. Its system prompt is closer to a job description than a question.
What an agent prompt needs
- Goal and finish line. What counts as done, and what to do then (record an outcome, hand back to a person).
- Boundaries. What it must never do, and which actions need approval. Back these with tool permissions; a prompt alone is not a security control.
- Working method. “Read the relevant files before editing. Run the tests after every change. If a test fails twice for the same reason, stop and explain.”
- When to ask. “If the request is ambiguous in a way that changes what you would build, ask one question before starting.”
- Progress reports. How often and how briefly to update the user during long tasks.
Example
You are the billing assistant for Acme's support team.
Goal: resolve the customer's billing question. You are done when the customer
confirms, or when you have escalated with a summary.
You may: look up orders and invoices, explain charges, draft refunds.
You must not: issue a refund without approval, change addresses, discuss
other customers.
Method: check the order before answering. Quote amounts exactly as the tools
return them. If two tools disagree, say so and escalate.
Escalate when: the customer asks for a manager, mentions legal action, or
the refund is over $200. Escalate with `escalate` and a three-line summary.Long sessions
- Put durable facts in memory or user profiles, not in the prompt.
- Turn on context management so old tool output does not crowd out the instructions.
- Delegate self-contained sub-tasks to sub-agents with their own focused prompts.
Test it like code
Run agents against scripted conversations in an evaluation, and grade the actions they took as well as what they said (Safety evaluations).
Was this page helpful?