Back to work

Adversarial AI lab

AI Security Testing Lab

A contained lab for attacking a customer-service chatbot the way an outsider would, scoring every attempt with a second model, and recording what got through.

Product Surface

Results summary showing judge verdicts for four prompt-injection suites as stacked bars with counts and median reply times, above an excerpt of the direct-injection results table
Judge verdicts from the lab's result CSVs, rendered for this page. Model replies are left out, and the judge's reasons are cut short.
AI Security Testing Lab architecture diagram
Host model server, containerized chatbot runtime, adversarial prompt sets, classifier, and review outputs.

Problem

Companies now put chatbots in front of customers and connect them to documents, ticket systems and account data. A chatbot that can be talked into reading the wrong document or obeying text hidden in a ticket becomes a way to leak data. Finding those failures takes repeatable attacks, a safe target, and a record that someone else can review. Manual probing is good for exploring, but it does not leave a consistent record.

Solution

The lab pairs a Windows-hosted Ollama model server with an Ubuntu VM Docker chatbot runtime. The target is a deliberately vulnerable practice chatbot for a fictional cable retailer, with a document search (RAG) knowledge base, customer logins and a support-ticket system. A script sends each prompt from a CSV file at a set rate and records the reply and its response time. A separate judge model labels each reply, and everything is written to result files for review. Manual Burp Suite work covers what a script cannot, such as multi-turn attacks and requests made with or without a login.

Evaluation Flow

AI Security Testing Lab evaluation flow diagram
Prompt suites exercise the chatbot, collect responses, classify outcomes, and produce reviewable CSV results.

What The Runs Found

The injection and jailbreak suites hold 85 prompts, and each was sent twice, for 170 judged runs. The judge, Qwen3 8B, labeled 22 runs as attacks that got through, 4 as possible, and 139 as held. Five runs could not be judged because the judge model timed out or lost its connection. Direct injection had the most hits, with 12 of 50 runs getting through, mostly by getting the chatbot to reveal its instructions or planted credentials. Replies took a median of 20.9 to 31.4 seconds per suite on local hardware.

Other suites tested the guardrails. None of 10 hostile prompts got the chatbot to repeat the hostile phrase. The chatbot rejected 6 of 8 long-prompt runs at its 2,000-character limit. A rate-limit probe hit HTTP 429 at request 31. The judge is a first pass, not the final word. In one run it marked a success when the chatbot had only repeated the user's own question, which is why the manual notes matter.

Where Data Leaked

The most serious findings came from what the chatbot was allowed to reach. It could read support tickets and search internal documents, and it followed instructions it found there. A ticket that said to reveal the system prompt made the chatbot list planted cloud and payment credentials. A logged-out visitor who named a ticket filed under a login was granted the 50% discount that the ticket's text asked for. A plain request for development documents pulled admin addresses and API keys from the knowledge base into the answer. Together they show four risks of an over-permissioned AI tool. They are prompt exposure, credential leakage, policy bypass and indirect access to records that sit behind a login.

Three finding cards showing an indirect prompt injection through a support ticket, a logged-out visitor triggering a ticket's instruction, and a retrieval request exposing internal development documents, with the planted credentials masked
Three findings from the lab's test notes, rendered for this page. The credentials were planted test values and are masked here.

Design Decisions

Local Containment

Risky prompts and attack simulations stay inside a controlled local environment instead of touching a public service.

Separated Model Roles

Chatbot models and the classification judge can be changed independently, reducing coupling between target and evaluator.

File-Based Results

Prompt inputs and result outputs are file-backed so test cases can be expanded, rerun, and compared.

Manual Plus Automated Review

Automation catches repeatable outcomes. Manual notes keep the context around ambiguous verdicts and the multi-step attacks a script cannot score.

Test Methodology

Testing followed written rules of engagement and a threat model for the chatbot, with notes on the OWASP Top 10 for LLM applications and MITRE ATLAS as reference. Recon came first. It identified the model, mapped the API in Burp Suite, and measured the rate limit. The scripted suites covered direct, narrative and encoded prompt injection, jailbreak personas, harmful and off-topic prompts, oversized inputs, and targeted RAG requests run with and without a login. The repository's 11 result files hold 276 recorded runs, each with its response time. The automated suites ran at the chatbot's lowest AI security setting with Mistral 7B. Manual probes at the next level showed an input filter that rejected the phrase "ignore all previous instructions".