DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to automate a logged-in workflow without giving the model your password with Stagehand

Use observe to find login fields and fill them yourself, then let act drive the rest of the task.

Short answer: Install Stagehand and make sure Chrome is installed locally; then 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. All steps.

Credentials. The persisted browser-data folder holds live session cookies; store it like a password and keep it out of version control.

Who it is forSomeone automating a dull task inside a web app they log into, like downloading monthly invoices.

The problemLetting an AI agent type your password means the credentials pass through the model.

The outcomeA script that signs in once, keeps the session in ./browser-data and repeats the task on later runs.

What you need first

  • 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

Steps

  1. Install Stagehand and make sure Chrome is installed locally
  2. Launch the local browser with a userDataDir such as ./browser-data so cookies persist between runs
  3. 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
  4. Use Stagehand.act for steps like click the sign in button and open the billing page
  5. Run it again later: the next run starts already signed in

Prompt for your agent

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.

Caveat. Automating a site you log into may break its terms of service, so check before running it on a schedule.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for browserbase/stagehand and "Automate a logged-in workflow without giving the model your password"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer