Agent
Web AI agents for any task
Software has always been deterministic and repeatable, but with AI agents it’s difficult to replicate a workflow. Stagehand combines the best of both worlds: intelligence and determinism.
Web Agents in Stagehand are fully customizable. You can use any LLM / VLM / Computer Use provider, set system prompts, add custom tools, and more.
Arguments: AgentOptions
Specifies the LLM provider. Currently supporting:
- OpenAI:
openai
- Anthropic:
anthropic
Specifies the LLM model. Currently supporting:
- OpenAI:
computer-use-preview
- Anthropic:
claude-3-7-sonnet-20250219
andclaude-3-5-sonnet-20240620
Specifies the system prompt
Configuration options for the LLM provider. Currently supports OpenAI and Anthropic SDK client options.
Returns: Promise<AgentResult>
If the agent execution completed without errors
Summary or error message from the agent
List of actions performed during execution
Whether the agent fully completed its task (can be false even if success is true)
Optional additional data about the execution