Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Improve judge system prompt for browser_state

Magnus Müller6c2c1c04128d
diff --git a/eval/judge_system.py b/eval/judge_system.py
index d36cff979..4212f5a94 100644
--- a/eval/judge_system.py
+++ b/eval/judge_system.py
@@ -31,7 +31,7 @@ EXPECTED AGENT BEHAVIORS:
- Saves findings to results.md for user output
- Reasons explicitly about browser state, history, and progress
- Handles page changes, scrolling, form interactions systematically
-- Uses extract_structured_data when needed information isn't in browser_state
+- Uses extract_structured_data or scrollwhen needed information isn't in the step view
- Opens new tabs for research rather than reusing current tab
- Calls done action only when task complete or impossible to continue
@@ -101,9 +101,6 @@ class ErrorCategory(Enum):
LOAD_TIMEOUT = 'load_timeout'
JAVASCRIPT_ERROR = 'javascript_error'
- # Content & Understanding
- MISUNDERSTOOD_TASK = 'misunderstood_task'
-
CONTENT_PARSING_ERROR = 'content_parsing_error'
# Enhanced Detection Categories
@@ -362,14 +359,16 @@ The browser-use agent operates in iterative loops receiving structured input:
**CRITICAL: BROWSER STATE CONTAINS READABLE TEXT**
- The DOM is converted to text with indexed interactive elements: [index]<type>text content</type>
-- Agent can READ TEXT CONTENT directly from browser_state without needing extract_structured_data
+- Agent has access to browser_state at every step without needing extract_structured_data
- extract_structured_data is only needed for complex parsing or when browser_state text is insufficient
+- extract_structured_data gets the markdown of the entire page and not just the visible part
+- Instead of extract_structured_data the agent can also scroll to get more information and update the browser_state
- Hierarchical structure with \t indentation shows parent-child HTML relationships
- New elements since last step marked with asterisks (*)
+- The browser_state is the ground truth, but can be improved if information is missing
**AGENT INTERACTION MODEL:**
-- Agent can only interact with explicitly provided numeric indexes [index]
-- Agent can READ all text content visible in browser_state structure
+- Agent can only interact with explicitly provided numeric indexes [index] (example is in the last message)
- Max N actions per step (configurable), browser actions interrupt sequences
**AGENT OUTPUT FORMAT (always JSON):**
@@ -380,8 +379,8 @@ The browser-use agent operates in iterative loops receiving structured input:
- action: List of actions to execute sequentially
**EXPECTED AGENT BEHAVIORS:**
-- READS text content directly from structured browser_state when information is visible
-- Uses extract_structured_data ONLY when browser_state text is insufficient or complex parsing needed
+- READS text content directly from structured browser_state when information is visible without extract_structured_data
+- Uses extract_structured_data when browser_state text is insufficient - an example of browser_state is in the last message.
- Follows task output format requirements precisely (direct output vs file writing)
- Uses todo.md for multi-step task planning and progress tracking
- Saves findings to results.md when the task is long or the user asks for it
@@ -392,18 +391,12 @@ The browser-use agent operates in iterative loops receiving structured input:
- If the agent needs to repeat the same extraction over and over, has a good trajectory, but hits the max step limit its still very good
**EVALUATION CRITERIA:**
-
1. **Task Satisfaction**: Understand the user intent - Is the user satisfied with the final result? - This is the most important criterion.
2. **Tool Usage**: How well did the tools work? - How does the trajectory of the agent look like?
-3. **Agent Reasoning**: Quality of decision-making and problem-solving
+3. **Agent Reasoning**: Quality of decision-making and problem-solving - good todo.md usage for tasks above 20 steps?
4. **Browser Handling**: How well did the navigation and browser interaction work?
5. **Final Output**: How does the output presented is it exactly what the user asked for?
-**BROWSER-USE SPECIFIC EVALUATION FOCUS:**
-- Data Extraction: Did agent properly read information from browser_state text structure?
-- State Adaptation: Did agent adapt when page changed after actions?
-- Planning Quality: Evidence of good todo.md usage for multi-step tasks
-- Action Sequencing: Logical action ordering respecting browser state changes
{error_categories_text}
@@ -437,7 +430,7 @@ extraction, interaction, login, research, shopping, booking, comparison, qa_test
**PASS THRESHOLD: 70%**
**IMPORTANT: DO NOT EVALUATE FOR HALLUCINATION**
-The agent has access to more information than you can see (browser_state text content, full DOM context, etc.). If the agent states something as fact or provides specific data, assume it is correct and extracted from information available to the agent. Focus on evaluating trajectory quality, tool usage, and task completion rather than data accuracy.
+The agent has access at every step to browser_state so it has more information than you can see. If the agent states something as fact or provides specific data, assume it is correct. Focus on evaluating trajectory quality, tool usage, and task completion rather than data accuracy.
Respond with EXACTLY this JSON structure (no additional text):
@@ -445,7 +438,7 @@ Respond with EXACTLY this JSON structure (no additional text):
"task_summary": "One sentence summary of what the task was trying to accomplish",
"task_categories": ["category1", "category2"],
"task_clarity_score": 85,
- "reasoning": "Detailed analysis of what went well and what didn't, trajectory quality, planning assessment",
+ "reasoning": "Detailed analysis of what went well and what didn't, trajectory quality, planning assessment, output quality, user satisfaction",
"error_categories": ["error1", "error2"],
"scores": {{
"task_satisfaction": 70
@@ -479,7 +472,7 @@ Respond with EXACTLY this JSON structure (no additional text):
**TOTAL STEPS:** {len(complete_history)}
**SCREENSHOTS PROVIDED:** {len(selected_images)}
-Analyze this execution and respond with the exact JSON structure requested."""
+Evaluate this execution and respond with the exact JSON structure requested."""
# Build messages
content_parts: list[ContentPartTextParam | ContentPartImageParam] = [ContentPartTextParam(text=user_prompt)]