# Denial-of-Service Poisoning Attacks on Large Language Models

## Installation

This code is tested on our local environment (python=3.10.12, cuda=11.8), and we recommend you to use anaconda to create a vitural environment:

```bash
conda create -n pdos python=3.10.12
```
Then, activate the environment:
```bash
conda activate pdos
```

Install requirements:

```bash
pip install -r requirements.txt
```

## Data Preparation

Please download AgentInstruct dataset to the path datasets.

## P-DoS attacks on LLM agents

Run the following command to create xthe poisoned dataset for P-DoS on LLM agents.

```shell
bash scripts/poison.sh
```

Run the following command to launch P-DoS on LLM agents.

```shell
bash scripts/dos.sh
```

Run the following command to evaluate DoS attacks on LLM agents.

```shell
bash scripts/eval.sh
```
