> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dendrite.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How to authenticate on any website using Dendrite Vault

Our **Dendrite CLI** enables you to securely to share your website permission with your AI agent, mirroring the access you have in your local browser. Everything is stored locally ensuring that no one else other than you has access to the authenticated sessions.

<Steps>
  <Step title="Run Command">
    First, run the following command in the terminal `dendrite auth --url <url>` where url is the website you want your agent to be authenticated against. For example `dendrite auth --url mail.google.com`. This will open up a browser at that url.
  </Step>

  <Step title="Login and Save Auth Session ">
    In the newly opened browser login into the service. When you are done go back to the terminal where you ran the command and press enter to save the seession.
    extension icon and press **Save authentication session**
  </Step>

  <Step title="Authenticate in Script">
    Once your session has been saved, you can use it in your Dendrite browser like this:

    ```python theme={null}
    Dendrite(auth="domain.com")
    Dendrite(auth=["domain1.com", "domain2.com"])
    ```
  </Step>
</Steps>

## Example: Authenticating on Instagram

To log in to instagram with your agent your need to:

<Steps>
  <Step title="Log in to Instagram in your Local Browser" />

  <Step title="Save your Authentication Session">
    Use the Dendrite CLI to save an authenticated session with Dendrite. Run the following command `dendrite auth --url instagram.` and login with your credentials.
  </Step>

  <Step title="Use with Dendrite">
    Initiate your Dendrite browser with an authenticated session.

    ```python auth_example.py theme={null}
    # Initiate browser with instagram session
    browser = Dendrite(auth="instagram.com")

    # Go to website with authenticated session
    browser.goto(
      "https://instagram.com",
      expected_page="Logged in version of Instagram feed"
    )
    ```
  </Step>
</Steps>

```python auth_example.py theme={null}
from dendrite import Dendrite

browser = Dendrite(auth="instagram.com")

browser.goto(
    "https://instagram.com",
    expected_page="You should be logged in with the instagram feed visible",
)
desc = browser.ask("Describe the first post in my feed")
print("First post description: ", desc)
```

## Let's scale up

<Card title="Remote Browser" icon="arrow-trend-up" href="/examples/remote-browser">
  Use a remote browser to run web automations in the cloud
</Card>
