Prompts
Prompts are the initial instructions given to agents at the start of an episode. They provide the context and goal for the task, forming the agent’s initial observation (s₀ in RL terminology).What is a Prompt?
A prompt is a sequence of blocks (text and/or images) that describes the task to the agent:Accessing Prompts
Prompts are retrieved via the API after creating a session:- Create session with task
- Get prompt for that task
- Agent reads prompt to understand what to do
- Agent begins calling tools to solve task
Prompt Structure
Text Prompts
Simple text instructions:Multi-Line Prompts
Complex instructions:Multi-Modal Prompts
Text + images:Generating Prompts
Prompts are generated by the environment’sget_prompt() method:
self.task_spec to access task data
-Return list of blocks (even for single text)
Prompt Design Patterns
Pattern 1: Simple Question
Direct question from task:“What is the capital of France?”
Pattern 2: Contextual Instructions
Add context and instructions:Pattern 3: Role-Playing
Set agent persona:Pattern 4: Multi-Modal
Include images:Pattern 5: Few-Shot Examples
Provide examples in prompt:Pattern 6: Tool Instructions
Explain available tools:Best Practices
1. Be Specific
2. Include Tool Guidance
3. Set Clear Success Criteria
4. Provide Context
5. Format for Readability
Dynamic Prompts
Prompts can be customized based on task properties:Prompt Templates
Reusable prompt structures:Multi-Turn Prompts
For environments with dialogue or multi-step interactions, prompts can evolve:get_prompt() is called once at episode start. For evolving context, include context in tool outputs rather than regenerating prompts.
Debugging Prompts
View Actual Prompt
Common Issues
Issue: Prompt is empty- Cause:
get_prompt()returns empty list - Fix: Ensure returning non-empty Blocks
- Cause: Ambiguous instructions
- Fix: Add more context and tool guidance
- Cause: Including too much information
- Fix: Focus on essentials, use tools for additional info
Next Steps
Tools
Design tools agents use after reading prompts
Tasks & Splits
Organize tasks that prompts are generated from
Implementing a Server
Implement get_prompt() in your environment
Data Types
See prompt data structure (Blocks)
Key Takeaway: Prompts are the agent’s starting point for each episode. Design them to be clear, specific, and informative. Good prompts guide agents toward successful task completion by setting context and explaining available tools.

