> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-mintlify-cli-docs-1773354647.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Profiles & Secrets

> Run tasks on authenticated sites using saved browser profiles and domain-scoped credentials.

Use a browser profile to skip login flows — the agent starts already authenticated. Add secrets as a fallback for sites that expire cookies quickly.

When to use this approach:

* You have accounts you log into regularly and want the agent to use them
* You need the agent to interact with private dashboards, inboxes, or settings pages
* You want to avoid passing raw credentials when possible

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk import AsyncBrowserUse

  client = AsyncBrowserUse()

  # 1. Create session with profile
  session = await client.sessions.create(profile_id="your-profile-id")

  # 2. Run authenticated task
  result = await client.run(
      "Go to my GitHub notifications and summarize the unread ones",
      session_id=session.id,
      secrets={"github.com": "backup-token-if-needed"},
      allowed_domains=["github.com"],
  )
  print(result.output)

  # 3. Clean up
  await client.sessions.stop(session.id)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk";

  const client = new BrowserUse();

  // 1. Create session with profile
  const session = await client.sessions.create({ profileId: "your-profile-id" });

  // 2. Run authenticated task
  const result = await client.run(
    "Go to my GitHub notifications and summarize the unread ones",
    {
      sessionId: session.id,
      secrets: { "github.com": "backup-token-if-needed" },
      allowedDomains: ["github.com"],
    },
  );
  console.log(result.output);

  // 3. Clean up
  await client.sessions.stop(session.id);
  ```
</CodeGroup>

<Warning>
  Always stop the session when you are done — profile state (cookies, localStorage) is only saved when the session ends.
</Warning>

<Tip>
  Profiles preserve cookies, localStorage, and saved passwords. Secrets are domain-scoped — the agent only uses them on matching domains. Combine both for maximum reliability.
</Tip>

See [Authentication & 2FA](/cloud/guides/authentication) for setup instructions including profile sync and 1Password integration.
