> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/automate-authentication-configuration.md).

# Automate authentication configuration

Snyk API & Web uses a large language model (LLM) to automatically map a web target's login structure and generate a complete [login sequence](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/configure-login-sequence.md), including two-factor authentication (2FA). This entirely eliminates the need to manually record browser sessions or configure CSS selectors.

## Prerequisites

* Enable AI capabilities for your account. For details, visit [Enhancing your security with AI](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/managing-account/enhancing-your-security-with-ai.md).
* Ensure the web target uses a login sequence.

## Configure authentication automatically

In Snyk API & Web, navigate to **Target** > **Settings** > **Authentication**. In the **Login Sequence** section, click **Configure Authentication Automatically**.

{% stepper %}
{% step %}

### Enter credentials

Enter the authentication values in the corresponding fields:

* **Username or email**: the login identifier.
* **Password**: the account password.
* **OTP seed**: the time-based one-time password seed, when required.
* **Other login credentials**: any value the login flow needs, such as a company name or phone number.

{% hint style="info" %}
Add reusable credentials with the [Credential Manager](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/manage-credentials.md).
{% endhint %}
{% endstep %}

{% step %}

### Add instructions (optional)

For a non-standard or complex login flow, provide natural-language instructions to guide the LLM:

* Multiple roles: "Sign in as a student."
* Single sign-on: "Select SSO, then enter the company name."
* Regional server: "Select the EU server before signing in."

{% hint style="warning" %}
Do not enter credentials into the instructions field. Use the dedicated credential fields so Snyk does not send sensitive information to the LLM.
{% endhint %}
{% endstep %}
{% endstepper %}

## Validate generated output

LLM-generated output is sometimes incomplete or inaccurate, depending on application complexity. Validate the generated login sequence before you scan:

* Confirm that authentication succeeds. Navigate to [Test target configuration](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/test-target-configuration.md).
* If the sequence is incorrect, add additional instructions or manually configure login steps. Navigate to [Configure the login sequence](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/configure-login-sequence.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/automate-authentication-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
