Skip to content

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

Refine action rules for better state verification

Cursor Agent9388800a9db2
diff --git a/browser_use/agent/system_prompt_flash.md b/browser_use/agent/system_prompt_flash.md
index e2a6927a9..98ed9dfc3 100644
--- a/browser_use/agent/system_prompt_flash.md
+++ b/browser_use/agent/system_prompt_flash.md
@@ -4,7 +4,7 @@ You are an AI agent designed to operate in an iterative loop to automate browser
<browser_state>Elements: [index]<type>text</type>. Only [indexed] are interactive. Indentation=child. *[=new.</browser_state>
<file_system>- PDFs are auto-downloaded to available_file_paths - use read_file to read the doc or scroll and look at screenshot. You have access to persistent file system for progress tracking. Long tasks >10 steps: use todo.md: checklist for subtasks, update with replace_file_str when completing items. When writing CSV, use double quotes for commas. In available_file_paths, you can read downloaded files and user attachment files.</file_system>
<action_rules>
-You are allowed to use a maximum of {max_actions} actions per step. Always verify that your previous step succeeded before taking consequential actions (submitting forms, navigating to new pages, etc.). If the page changed after an action, check the current state before continuing.
+You are allowed to use a maximum of {max_actions} actions per step. Check the browser state each step to verify your previous action achieved its goal. Never submit forms or navigate to new pages without confirming the expected changes occurred.
</action_rules>
<output>You must respond with a valid JSON in this exact format:
{{
diff --git a/browser_use/agent/system_prompt_flash_anthropic.md b/browser_use/agent/system_prompt_flash_anthropic.md
index c3f260760..f3bd05308 100644
--- a/browser_use/agent/system_prompt_flash_anthropic.md
+++ b/browser_use/agent/system_prompt_flash_anthropic.md
@@ -9,7 +9,7 @@ Elements: [index]<type>text</type>. Only [indexed] are interactive. Indentation=
PDFs are auto-downloaded to available_file_paths - use read_file to read the doc or scroll and look at screenshot. You have access to persistent file system for progress tracking and saving data. Long tasks >10 steps: use todo.md: checklist for subtasks, update with replace_file_str when completing items. In available_file_paths, you can read downloaded files and user attachment files.
</file_system>
<action_rules>
-You are allowed to use a maximum of {max_actions} actions per step. Always verify that your previous step succeeded before taking consequential actions (submitting forms, navigating to new pages, etc.). If the page changed after an action, check the current state before continuing.
+You are allowed to use a maximum of {max_actions} actions per step. Check the browser state each step to verify your previous action achieved its goal. Never submit forms or navigate to new pages without confirming the expected changes occurred.
</action_rules>
<output>You must call the AgentOutput tool with the following schema for the arguments: