# Headless Authentication

For users who wish to perform scans on machines with no browser, e.g. EC2 instances, it is possible to authenticate the scan session by leveraging another machine with a browser installed.

1. Start by installing the latest version of Safety:

```
pip install safety==3.4.0
```

2. When installed, start by authenticating the session using the new headless option.

```
safety auth login --headless
```

3. You should see the following: “Running in headless mode. Please copy and open the following URL in a browser. Copy and paste this url into your browser.”

* Copy and paste the URL from the Terminal into a browser on another machine that does have one.
* Once authenticated on that browser a code will show on the success screen.
* Click the JSON code on the screen. This will copy the code to the clipboard.
* Paste that JSON code string into the original prompt in your Terminal.
* The Safety session should now be authenticated on the machine without a browser installed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safetycli.com/safety-docs/support/headless-authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
