Use Cursor rules for better AI suggestions
Most of the Stagehand team uses Cursor to write code. Cursor has a feature called rules that allows you to customize the AI’s behavior. You can use these rules to make the AI more accurate when suggesting actions. For Stagehand’s Cursor rules, check out this file. If you’re using Windsurf, you can use the same rules by adding them to your.windsurfrules file.
Avoid sending sensitive information to LLMs
You can usevariables in an act call to avoid sending sensitive information to LLMs.
Preview actions before running them
You can useobserve() to get an action to run without running it.
If you’re satisfied with the action, you can run it with act() without any LLM inference.
observe() with sensitive information, like below.
observe() to get actionable suggestions from the current page

