All resources (slides, code, etc) for API World 2025: API Security for the AI Era: Detecting and Preventing Adversarial Manipulation
Please see session presentation and recording for details. The short answer, this workshop is broken up into two sections:
- Observing Threat Vectors (And Trying Them Out On Your Own)
- Observing AI Defense Mechanisms (And Trying Them Out On Your Own)
The real value is the session recording as this is a demonstration how our AI/ML systems can be compromised. I wrote this session because I dont't think there are many good tutorials/workshops that discuss these things.
Have only tested on MacOS, but should also work on most favors of Linux.
Using:
- Python 3.11+
I would highly recommend using something like:
- conda - https://docs.anaconda.com/free/miniconda/
- venv - https://docs.python.org/3/library/venv.html
For each demo/lab below, install the required packages by running in your (virtual) environment:
pip install -r requirements.txtHere are some examples for threat vectors into AI/ML systems.
To run the demo, do the following:
# navigate to the folder
cd ./demo/1_sentiment-pos-vs-neg-deberta
# install the Python dependencies
pip install -r requirements.txt
# run the example
python main.pyOpen up the source code main.py and trying manipulating the input strings and see how it affects the output.
To run the demo, do the following:
# navigate to the folder
cd ./demo/2_which_animal_pixel
# install the Python dependencies
pip install -r requirements.txt
# run the example
python main.pyTo run the demo, do the following:
# navigate to the folder
cd ./demo/3_sentiment_supply
# install the Python dependencies
pip install -r requirements.txt
# run the example
python main.pyOpen up the source code main.py and trying manipulating the input strings and see how it affects the output.
Here are some examples for defending against threads.
To run the demo, do the following:
# navigate to the folder
cd ./demo/4_nlp_defend
# install the Python dependencies
pip install -r requirements.txt
# run the example
python main.pyOpen up the source code main.py and trying manipulating the input strings and see how it affects the output.
To run the demo, do the following:
# navigate to the folder
cd ./demo/5_one_pixel_defend
# install the Python dependencies
pip install -r requirements.txt
# run the example
python main.py