{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "browserbase-stagehand--automate-a-logged-in-workflow-safely",
 "repo": "browserbase/stagehand",
 "repo_url": "https://github.com/browserbase/stagehand",
 "repo_slug": "browserbase-stagehand",
 "title": "Automate a logged-in workflow without giving the model your password",
 "page_title": "How to automate a logged-in workflow without giving the model your password with Stagehand",
 "summary": "Use observe to find login fields and fill them yourself, then let act drive the rest of the task.",
 "who": "Someone automating a dull task inside a web app they log into, like downloading monthly invoices.",
 "problem": "Letting an AI agent type your password means the credentials pass through the model.",
 "outcome": "A script that signs in once, keeps the session in ./browser-data and repeats the task on later runs.",
 "steps": [
  "Install Stagehand and make sure Chrome is installed locally",
  "Launch the local browser with a userDataDir such as ./browser-data so cookies persist between runs",
  "Call Stagehand.observe to find the email and password inputs, then fill them from environment variables with page.locator; observe returns real selectors, so credentials never reach the model",
  "Use Stagehand.act for steps like click the sign in button and open the billing page",
  "Run it again later: the next run starts already signed in"
 ],
 "agent_prompt": "Build a browserbase/stagehand script for <web app> that signs in using observe plus locator fill with credentials from environment variables, keeps the session in ./browser-data, then uses act to <task steps> and extract to save <data>. Never pass the password to the model.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "Automating a site you log into may break its terms of service, so check before running it on a schedule.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node with pnpm, Python, or Go",
  "Chrome installed for local runs",
  "A model API key such as OPENAI_API_KEY, or a Browserbase API key to use the Model Gateway"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The persisted browser-data folder holds live session cookies; store it like a password and keep it out of version control."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/browserbase-stagehand/automate-a-logged-in-workflow-safely/",
 "md": "https://dedupedai.com/use-cases/browserbase-stagehand/automate-a-logged-in-workflow-safely/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/browserbase-stagehand--automate-a-logged-in-workflow-safely.json",
 "api_version": "v1"
}
