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

# Adversarial testing

> Synthetic edge cases and tricky inputs

Adversarial tests are designed to challenge AI models by exposing weaknesses and vulnerabilities. These inputs may attempt to:

* Bypass safety protections and generate harmful responses.
* Trick the model into revealing sensitive or unintended information.
* Exploit edge cases to evaluate system robustness.

Evidently Cloud lets you automate adversarial test generation based on defined categories of risk.

## Create an adversarial test dataset

You can configure your own adversarial dataset.

### 1. Create a Project

In the Evidently UI, start a new Project or open an existing one.

* Navigate to “Datasets” in the left menu.
* Click “Generate” and select the “Adversarial testing” option.

<img src="https://mintcdn.com/evi/8OEti_y2YYYC9e0v/images/synthetic/synthetic_data_select_method.png?fit=max&auto=format&n=8OEti_y2YYYC9e0v&q=85&s=3fea853e4837f812a269046e5ee53437" alt="" width="2448" height="1354" data-path="images/synthetic/synthetic_data_select_method.png" />

### 2. Select a test scenario

Choose a predefined adversarial scenario:

<img src="https://mintcdn.com/evi/DLHmQMW9F8KXZznS/images/synthetic/synthetic_data_adversarial.png?fit=max&auto=format&n=DLHmQMW9F8KXZznS&q=85&s=3cc1b22d2c2e809fb1fce09459b8ccaf" alt="" width="2526" height="1644" data-path="images/synthetic/synthetic_data_adversarial.png" />

You can choose the following categories:

* Harmful content (e.g., profanity, toxicity, illegal advice).
* Forbidden topics (e.g., financial, legal, medical queries).
* Brand image (eliciting negative feedback on a company or product).
* Competition (comparisons with competitor products).
* Offers and promises (attempting to get AI to make commitments).
* Hijacking (out-of-scope questions unrelated to the intended purpose).
* Prompt leakage (extracting system instructions or hidden prompts).

### 3. Configure the dataset

After selecting a scenario

* Provide an optional dataset name and description. (This applies if you export each dataset separately).
* Set the number of inputs to generate.

<img src="https://mintcdn.com/evi/DLHmQMW9F8KXZznS/images/synthetic/synthetic_data_brand_image.png?fit=max&auto=format&n=DLHmQMW9F8KXZznS&q=85&s=16aef92237b36fa19c8b71ca0b342465" alt="" width="2524" height="1662" data-path="images/synthetic/synthetic_data_brand_image.png" />

Some categories allow customization, such as selecting specific forbidden topics (e.g., legal, financial, or medical advice).

<img src="https://mintcdn.com/evi/DLHmQMW9F8KXZznS/images/synthetic/synthetic_data_forbidden.png?fit=max&auto=format&n=DLHmQMW9F8KXZznS&q=85&s=80422ebbc3890cb1efb37560295b9cce" alt="" width="2516" height="1662" data-path="images/synthetic/synthetic_data_forbidden.png" />

You can configure multiple scenarios at once.

### 4. Generate the data

You can choose to:

* Combine multiple scenarios into a single dataset. If you select multiple categories (e.g., Brand Image and Forbidden Topics), they will be included in the same dataset, with a separate "scenario" column to indicate the category of each test case.

* Export each scenario separately. Generate individual datasets for each selected test type.

Once generated, you can:

* Open and edit each dataset as needed.
* Download it as a CSV file.
* Access it via the Python API using the dataset ID.

<Info>
  **Dataset API.** How to work with [Evidently datasets](/docs/platform/datasets_overview).
</Info>
