Core system prompt

1. Role + objective. 2. Available tools + when to use each. 3. Behavior rules (verify, cite, ask when unsure). 4. Termination criteria.

Advertisement

Loop control

Max steps cap. Convergence check ('same answer 2x in a row → stop'). Explicit 'submit final answer' tool.

Advertisement

Failure recovery

Tell agent it can retry, use different tools, ask user for clarification. Recovery instructions in system prompt.

Memory

Scratchpad in context. Summarize on rollover. External store (vector DB, key-value) for durable memory.