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
improve
mertunsallf3e1a596429c
diff --git a/browser_use/agent/system_prompt.md b/browser_use/agent/system_prompt.mdindex 411fca56f..0c0b4c4ed 100644--- a/browser_use/agent/system_prompt.md+++ b/browser_use/agent/system_prompt.md@@ -91,6 +91,7 @@ Strictly follow these rules while using the browser and navigating the web:<file_system>- You have access to a persistent file system which you can use to track progress, store results, and manage long tasks.- Your file system is initialized with a `todo.md`: Use this to keep a checklist for known subtasks. Update it to mark completed items and track what remains. This file should guide your step-by-step execution when the task involves multiple known entities (e.g., a list of links or items to visit). ALWAYS use `write_file` to rewrite entire `todo.md` when you want to update your progress. NEVER use `append_file` on `todo.md` as this can explode your context.+- If you are writing a `csv` file, make sure to use double quotes if cell elements contain commas.- Note that `write_file` overwrites the entire file, use it with care on existing files.- When you `append_file`, ALWAYS put newlines in the beginning and not at the end.- If the file is too large, you are only given a preview of your file. Use `read_file` to see the full content if necessary.diff --git a/browser_use/agent/system_prompt_no_thinking.md b/browser_use/agent/system_prompt_no_thinking.mdindex dee039363..792d0466e 100644--- a/browser_use/agent/system_prompt_no_thinking.md+++ b/browser_use/agent/system_prompt_no_thinking.md@@ -91,6 +91,7 @@ Strictly follow these rules while using the browser and navigating the web:<file_system>- You have access to a persistent file system which you can use to track progress, store results, and manage long tasks.- Your file system is initialized with a `todo.md`: Use this to keep a checklist for known subtasks. Update it to mark completed items and track what remains. This file should guide your step-by-step execution when the task involves multiple known entities (e.g., a list of links or items to visit). ALWAYS use `write_file` to rewrite entire `todo.md` when you want to update your progress. NEVER use `append_file` on `todo.md` as this can explode your context.+- If you are writing a `csv` file, make sure to use double quotes if cell elements contain commas.- Note that `write_file` overwrites the entire file, use it with care on existing files.- When you `append_file`, ALWAYS put newlines in the beginning and not at the end.- If the file is too large, you are only given a preview of your file. Use `read_file` to see the full content if necessary.diff --git a/browser_use/filesystem/file_system.py b/browser_use/filesystem/file_system.pyindex 6a72e5a6e..2bd16da86 100644--- a/browser_use/filesystem/file_system.py+++ b/browser_use/filesystem/file_system.py@@ -235,7 +235,7 @@ class FileSystem:except PermissionError:return f"Error: Permission denied to read file '{full_filename}'."except Exception as e:- return f"Error: Could not read external file '{full_filename}'. {str(e)}"+ return f"Error: Could not read file '{full_filename}'."if not self._is_valid_filename(full_filename):return INVALID_FILENAME_ERROR_MESSAGE