Concept
An agent definition needs more than a name. Four sections shape how the agent behaves.
The runtime puts these sections into the agent prompt. They guide the model. They do not block actions. For hard enforcement, add tools, constraints, guardrails, permissions, or handoff.
The standard prompt for a specialist or standalone agent includes
LIMITATIONS. The standard prompt for a supervisor with the router or orchestrator role does not. Put routing boundaries for a supervisor in its HANDOFF and DELEGATE entries and its goal.
Write the goal as an owned responsibility, not a slogan. Write the persona as observable behavior, not a list of brand adjectives. Write limitations as specific prohibited actions, and name the next action when you can.
Minimal working example
order_id and customer_id are project-local assumptions. This example does not declare a source for them. In your project, collect them with GATHER, store them in MEMORY, or set them from a tool result before the handoff.
How it works
The refund agent owns policy explanation and does not take payment actions. One limitation also names the correct boundary for disputes. TheHANDOFF makes that boundary executable. It routes charge disputes to Billing_Specialist.
Customers do not know which internal team owns an issue. They ask in natural language. The goal and limitations keep the agent helpful and stop the wrong agent from taking a sensitive action.
The HANDOFF above omits HISTORY. Billing_Specialist receives the full conversation history by default. Set an explicit HISTORY strategy to send bounded or summary-only context.
Common variations
Short persona
Use a one-line persona for simple specialists.Multiline persona
Use a multiline persona when tone, format, and operating style matter.Detailed instructions
UseINSTRUCTIONS for working rules that do not fit in a one-line goal. Place INSTRUCTIONS after GOAL. The parser appends the instructions to the goal text under an “Instructions:” heading.
INSTRUCTIONS comes before GOAL, the later GOAL replaces the goal text and the instructions are lost.
IDENTITY section
IDENTITY is an alternative way to group role, persona, expertise, and limitations in one section. Use it only when your project standard prefers that shape. Otherwise, GOAL, PERSONA, and LIMITATIONS are easier to scan.
IDENTITY maps to the same fields:
Each key takes a single-line value. Do not mix
IDENTITY with GOAL and LIMITATIONS in the same agent. The last section to appear wins.
Values from the session
GOAL, PERSONA, and LIMITATIONS text accepts {{variable}} placeholders. The runtime fills them from session values when it builds the prompt.
GATHER field, a memory field, or a context value.
Custom system prompt
ASYSTEM_PROMPT section replaces the standard prompt. Your template must then reference {{goal}} and {{persona}} to use them. The limitations list is not a template variable in a custom prompt, so write the limits into the template text.
SYSTEM_PROMPT: alone on its line, with the template indented below it. The form SYSTEM_PROMPT: | is not recognized.
Verification
- Validate the agent. Confirm no
E124error appears. - Test an in-scope request. Confirm the agent answers directly and in the persona voice.
- Test a boundary request. Confirm the agent hands off, delegates, or declines instead of improvising.
- Test a sensitive request, such as refund approval or payment reversal. Confirm the agent follows the limitation.
- Inspect the handoff target and the passed fields. Confirm the receiving agent has the context it needs.
- If you use
INSTRUCTIONS,IDENTITY, or{{variable}}placeholders, test one request that depends on that text.
Production readiness checklist
- Every agent has one primary responsibility.
- Limitations name prohibited work and the correct next path.
- Routing conditions match the boundaries that the limitations describe.
- Sensitive actions go to the right specialist, workflow, tool, or human escalation.
- Every handoff target exists in the project.
- Every
PASSfield and{{variable}}has a source. - Test cases cover in-scope, adjacent, out-of-scope, and ambiguous requests.