Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
added better data grounding in done action
Saurav Panda179d5267865e
diff --git a/browser_use/agent/system_prompts/system_prompt.md b/browser_use/agent/system_prompts/system_prompt.mdindex 4e1af5b57..900114480 100644--- a/browser_use/agent/system_prompts/system_prompt.md+++ b/browser_use/agent/system_prompts/system_prompt.md@@ -147,7 +147,7 @@ BEFORE calling `done` with `success=true`, you MUST perform this verification:3. **Verify actions actually completed:**- If you submitted a form, posted a comment, or saved a file — check the page state or screenshot to confirm it happened.- If you took a screenshot or downloaded a file — verify it exists in your file system.-4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Never construct URLs or use "representative" values. If not extracted, say not found — do not substitute.+4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Do NOT use your training knowledge to fill gaps — if information was not found on the page during this session, say so explicitly. Never fabricate or invent values.5. **If ANY requirement is unmet, uncertain, or unverifiable — set `success` to `false`.**Partial results with `success=false` are more valuable than overclaiming success.</pre_done_verification>diff --git a/browser_use/agent/system_prompts/system_prompt_anthropic_flash.md b/browser_use/agent/system_prompts/system_prompt_anthropic_flash.mdindex 8022537b9..78dafdcc9 100644--- a/browser_use/agent/system_prompts/system_prompt_anthropic_flash.md+++ b/browser_use/agent/system_prompts/system_prompt_anthropic_flash.md@@ -95,7 +95,7 @@ BEFORE calling `done` with `success=true`, you MUST perform this verification:3. **Verify actions actually completed:**- If you submitted a form, posted a comment, or saved a file — check the page state or screenshot to confirm it happened.- If you took a screenshot or downloaded a file — verify it exists in your file system.-4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Never construct URLs or use "representative" values. If not extracted, say not found — do not substitute.+4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Do NOT use your training knowledge to fill gaps — if information was not found on the page during this session, say so explicitly. Never fabricate or invent values.5. **If ANY requirement is unmet, uncertain, or unverifiable — set `success` to `false`.**Partial results with `success=false` are more valuable than overclaiming success.</pre_done_verification>diff --git a/browser_use/agent/system_prompts/system_prompt_browser_use.md b/browser_use/agent/system_prompts/system_prompt_browser_use.mdindex 372771e09..3b5fe1d03 100644--- a/browser_use/agent/system_prompts/system_prompt_browser_use.md+++ b/browser_use/agent/system_prompts/system_prompt_browser_use.md@@ -14,5 +14,5 @@ You must ALWAYS respond with a valid JSON in this exact format:"action": [{{"action_name": {{...params...}}}}]}}Action list should NEVER be empty.-DATA GROUNDING: Only report data observed in browser state or tool outputs. Never fabricate URLs, prices, or values. If not found, say so.+DATA GROUNDING: Only report data observed in browser state or tool outputs. Do NOT use training knowledge to fill gaps — if not found on the page, say so explicitly. Never fabricate values.</output>diff --git a/browser_use/agent/system_prompts/system_prompt_browser_use_flash.md b/browser_use/agent/system_prompts/system_prompt_browser_use_flash.mdindex 0a04cf5e1..435d77a85 100644--- a/browser_use/agent/system_prompts/system_prompt_browser_use_flash.md+++ b/browser_use/agent/system_prompts/system_prompt_browser_use_flash.md@@ -11,5 +11,5 @@ You must respond with a valid JSON in this exact format:"action": [{{"action_name": {{...params...}}}}]}}Action list should NEVER be empty.-DATA GROUNDING: Only report data observed in browser state or tool outputs. Never fabricate URLs, prices, or values. If not found, say so.+DATA GROUNDING: Only report data observed in browser state or tool outputs. Do NOT use training knowledge to fill gaps — if not found on the page, say so explicitly. Never fabricate values.</output>diff --git a/browser_use/agent/system_prompts/system_prompt_browser_use_no_thinking.md b/browser_use/agent/system_prompts/system_prompt_browser_use_no_thinking.mdindex ca5be037b..e33b4f978 100644--- a/browser_use/agent/system_prompts/system_prompt_browser_use_no_thinking.md+++ b/browser_use/agent/system_prompts/system_prompt_browser_use_no_thinking.md@@ -13,5 +13,5 @@ You must ALWAYS respond with a valid JSON in this exact format:"action": [{{"action_name": {{...params...}}}}]}}Action list should NEVER be empty.-DATA GROUNDING: Only report data observed in browser state or tool outputs. Never fabricate URLs, prices, or values. If not found, say so.+DATA GROUNDING: Only report data observed in browser state or tool outputs. Do NOT use training knowledge to fill gaps — if not found on the page, say so explicitly. Never fabricate values.</output>diff --git a/browser_use/agent/system_prompts/system_prompt_flash.md b/browser_use/agent/system_prompts/system_prompt_flash.mdindex 984707949..b7c0a1927 100644--- a/browser_use/agent/system_prompts/system_prompt_flash.md+++ b/browser_use/agent/system_prompts/system_prompt_flash.md@@ -15,5 +15,5 @@ Instructions containing "do NOT", "never", "avoid", "skip", or "only X" are hard"action":[{{"navigate": {{ "url": "url_value"}}}}]}}Before calling `done` with `success=true`: re-read the user request, verify every requirement is met (correct count, filters applied, format matched), confirm actions actually completed via page state/screenshot, and ensure no data was fabricated. If anything is unmet or uncertain, set `success` to `false`.-DATA GROUNDING: Only report data observed in browser state or tool outputs. Never fabricate URLs, prices, or values — including "representative" ones. If not found, say so.+DATA GROUNDING: Only report data observed in browser state or tool outputs. Do NOT use training knowledge to fill gaps — if not found on the page, say so explicitly. Never fabricate values.</output>diff --git a/browser_use/agent/system_prompts/system_prompt_flash_anthropic.md b/browser_use/agent/system_prompts/system_prompt_flash_anthropic.mdindex 7fd4edc06..64d45560a 100644--- a/browser_use/agent/system_prompts/system_prompt_flash_anthropic.md+++ b/browser_use/agent/system_prompts/system_prompt_flash_anthropic.md@@ -30,5 +30,5 @@ Instructions containing "do NOT", "never", "avoid", "skip", or "only X" are hardAlways put `memory` field before the `action` field.Before calling `done` with `success=true`: re-read the user request, verify every requirement is met (correct count, filters applied, format matched), confirm actions actually completed via page state/screenshot, and ensure no data was fabricated. If anything is unmet or uncertain, set `success` to `false`.-DATA GROUNDING: Only report data observed in browser state or tool outputs. Never fabricate URLs, prices, or values — including "representative" ones. If not found, say so.+DATA GROUNDING: Only report data observed in browser state or tool outputs. Do NOT use training knowledge to fill gaps — if not found on the page, say so explicitly. Never fabricate values.</output>diff --git a/browser_use/agent/system_prompts/system_prompt_no_thinking.md b/browser_use/agent/system_prompts/system_prompt_no_thinking.mdindex c666a86a9..4fc53bc0a 100644--- a/browser_use/agent/system_prompts/system_prompt_no_thinking.md+++ b/browser_use/agent/system_prompts/system_prompt_no_thinking.md@@ -132,7 +132,7 @@ BEFORE calling `done` with `success=true`, you MUST perform this verification:3. **Verify actions actually completed:**- If you submitted a form, posted a comment, or saved a file — check the page state or screenshot to confirm it happened.- If you took a screenshot or downloaded a file — verify it exists in your file system.-4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Never construct URLs or use "representative" values. If not extracted, say not found — do not substitute.+4. **Verify data grounding:** Every URL, price, name, and value must appear verbatim in your tool outputs or browser_state. Do NOT use your training knowledge to fill gaps — if information was not found on the page during this session, say so explicitly. Never fabricate or invent values.5. **If ANY requirement is unmet, uncertain, or unverifiable — set `success` to `false`.**Partial results with `success=false` are more valuable than overclaiming success.</pre_done_verification>diff --git a/browser_use/tools/views.py b/browser_use/tools/views.pyindex a8102ecf9..89e15aa01 100644--- a/browser_use/tools/views.py+++ b/browser_use/tools/views.py@@ -83,7 +83,15 @@ class InputTextAction(BaseModel):class DoneAction(BaseModel):- text: str = Field(description='Final user message in the format the user requested')+ text: str = Field(+ description=(+ 'Final message to the user. '+ 'ONLY report data you directly observed in browser_state, tool outputs, or screenshots during this session. '+ 'Do NOT use training knowledge to fill gaps — if information was not found on the page, say so explicitly. '+ 'Do NOT claim completion of steps from compacted_memory or prior session summaries '+ 'unless you explicitly verified them yourself.'+ )+ )success: bool = Field(default=True, description='True if user_request completed successfully')files_to_display: list[str] | None = Field(default=[])