Skip to content

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

Refactor: Lower default max_actions_per_step to 4

Cursor Agent487bd19e80d1
diff --git a/AGENTS.md b/AGENTS.md
index ae8a0fda4..0e60fb0a6 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -300,7 +300,7 @@ Check out all customizable parameters <a href="/customize/agent/all-parameters">
### Actions & Behavior
* `initial_actions`: List of actions to run before the main task without LLM. [Example](https://github.com/browser-use/browser-use/blob/main/examples/features/initial_actions.py)
-* `max_actions_per_step` (default: `10`): Maximum actions per step, e.g. for form filling the agent can output 10 fields at once. We execute the actions until the page changes.
+* `max_actions_per_step` (default: `4`): Maximum actions per step, e.g. for form filling the agent can output 4 fields at once. We execute the actions until the page changes.
* `max_failures` (default: `3`): Maximum retries for steps with errors
* `final_response_after_failure` (default: `True`): If True, attempt to force one final model call with intermediate output after max\_failures is reached
* `use_thinking` (default: `True`): Controls whether the agent uses its internal "thinking" field for explicit reasoning steps.
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index b781a7766..fd283714e 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
class SystemPrompt:
def __init__(
self,
- max_actions_per_step: int = 10,
+ max_actions_per_step: int = 4,
override_system_message: str | None = None,
extend_system_message: str | None = None,
use_thinking: bool = True,
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 1f604d94e..0af91c2a1 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -159,7 +159,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):
generate_gif: bool | str = False,
available_file_paths: list[str] | None = None,
include_attributes: list[str] | None = None,
- max_actions_per_step: int = 10,
+ max_actions_per_step: int = 4,
use_thinking: bool = True,
flash_mode: bool = False,
demo_mode: bool | None = None,
diff --git a/docs/customize/agent/all-parameters.mdx b/docs/customize/agent/all-parameters.mdx
index e190c26be..cd31624b5 100644
--- a/docs/customize/agent/all-parameters.mdx
+++ b/docs/customize/agent/all-parameters.mdx
@@ -19,7 +19,7 @@ mode: "wide"
### Actions & Behavior
- `initial_actions`: List of actions to run before the main task without LLM. [Example](https://github.com/browser-use/browser-use/blob/main/examples/features/initial_actions.py)
-- `max_actions_per_step` (default: `10`): Maximum actions per step, e.g. for form filling the agent can output 10 fields at once. We execute the actions until the page changes.
+- `max_actions_per_step` (default: `4`): Maximum actions per step, e.g. for form filling the agent can output 4 fields at once. We execute the actions until the page changes.
- `max_failures` (default: `3`): Maximum retries for steps with errors
- `final_response_after_failure` (default: `True`): If True, attempt to force one final model call with intermediate output after max_failures is reached
- `use_thinking` (default: `True`): Controls whether the agent uses its internal "thinking" field for explicit reasoning steps.