Chatbot testing is five separate jobs: answer quality, multi-turn behavior, actions, security, and regression after every change. Write the test plan for all five first, then choose tools for the jobs you cannot do today. Give security its own part of the plan. It asks a different question from the other four: what can a user who should not get something make the agent say or do?
TL;DR: Write one test plan with five parts. Score answers against references. Simulate whole conversations. Assert what the agent's tools did. Attack the agent the way an abusive user would. Rerun all of it when the prompt, model, tools, or knowledge change. The tables below give the checks, tools sorted by job, and a pre-launch checklist.
Basis for this guide: Public sources only: the OWASP Top 10 for LLM Applications (2026 edition), NIST AI 600-1, and the documentation of each tool named, all checked on November 30, 2026. This guide reports no Hamming measurements. Hamming sells testing and red teaming for chat and voice agents, so read the tool section knowing that.
Scope: LLM chat agents that answer customers in a web widget, an app, or a messaging channel. Attack technique is in the guide to red teaming a customer support chatbot. Phone agents add speech recognition and audio, which this page leaves out. A chatbot that answers from a fixed FAQ, has no tools, and holds no customer data needs the quality and regression parts, plus the misuse checks in the security section.
Last Updated: November 2026
Related Guides
- How to Red Team a Customer Support Chatbot - the attack surface and the attack method for the security job
- AI Red Teaming Tools for Voice and Chat Agents - how to compare red-team tools on stated criteria
- Testing Multi-Modal AI Agents - keeping one agent consistent across voice, chat, SMS, and email
- Attacks to Test on an AI Agent Before Launch - the shortlist of attacks for a launch gate
What is chatbot testing?
Chatbot testing is the work of showing that a chat agent gives correct answers, holds a conversation across several turns, takes only the actions it is allowed to take, resists a user who is trying to misuse it, and still does all of that after each change. It differs from testing ordinary software in two ways. The same input can produce differently worded output on each run, so a test asserts a property of the answer. An exact-string check would fail a correct answer that happens to be worded differently. And the unit under test is the conversation, because a chatbot can answer every single question well and still lose the thread later in the exchange.
Two public cases show what an unchecked change and a wrong answer cost. In January 2024 the delivery firm DPD disabled the AI element of its support chat after a customer got it to swear and to criticise the company. DPD attributed that to an error after a system update, as the BBC reported. A month later, in Moffatt v. Air Canada, a British Columbia tribunal held the airline responsible for a wrong answer its website chatbot gave about bereavement fares. Our page on who is liable when an AI agent makes a false promise covers that decision in detail.
What should you test in a chatbot?
Test five things, and keep them as five separate parts of the plan, because each one needs a different kind of test and produces a different kind of evidence.
| Job | What it catches | Example check | Evidence to keep |
|---|---|---|---|
| Answer quality | Wrong, unsupported, or off-policy answers | The refund-window answer matches the published policy | The question, the reference answer, the agent's answer, the score |
| Multi-turn behavior | Lost context, contradictions, a user stuck in a loop | The agent still knows the order number five turns after the user gave it | The full conversation, with the turn that failed marked |
| Actions | A wrong tool call, a wrong argument, an action the reply never mentions | "Your address is updated" matches one write to the right record | The tool trace beside the transcript |
| Security | Disclosure, policy bypass, actions for a user who is not entitled to them | A user who has not been verified cannot read another customer's order | The attempt, the response, the tool trace, the agent version |
| Regression | A change that breaks something that used to pass | The whole suite reruns when the prompt, model, tools, or knowledge change | Results by agent version, with the change that triggered the run |
The first two jobs are about what the agent says. The third and fourth are about what it does and for whom, and a transcript alone cannot settle those. An agent can say it refused and still have made the tool call.
How do you build a chatbot test set?
Build the test set from what users have asked, and write the expected result for each case before you run anything. A case with no expected result ends up graded by whoever reads the output, with nothing to grade it against.
- Collect real questions from tickets, chat logs, and search queries, and remove personal data before they go into a test file.
- Add the questions you hope nobody asks: out of scope, ambiguous, angry, and the ones where the right answer is a refusal or a handoff to a person.
- Write the expected result for each case. For a factual question that is a reference answer. For an action it is the tool call and its arguments. For a refusal it is the refusal.
- Tag each case with the job it tests and the policy or document it depends on. When that document changes, the tag tells you which cases to rewrite.
- Decide how many times each case runs. Output varies between runs, so one pass proves little. We treat a case that passes on some runs and fails on others as failing.
- Add each production failure to the set as a new case. This is the same loop as turning failed production conversations into regression tests, which we wrote for phone agents. The steps carry over to chat.
You can start small. LangSmith's chatbot evaluation tutorial says a dataset of 10 to 50 examples already tells you something. Larger size rules you will read elsewhere are one author's habit. No standard sets them. Choose the size by coverage: every intent the bot handles, every policy it cites, every tool it can call.
How do you evaluate a chatbot's answer quality?
Compare each answer with a reference answer or a written rubric, and decide which grader does the comparing. There are three graders, and each fails in its own way.
| Method | Use it when | Where it fails |
|---|---|---|
| Exact or pattern match | The answer must contain a fixed value: a price, a date, a phone number, a required disclosure | Correct answers that are worded differently fail |
| A model as judge, scoring against a reference or rubric | The answer is free text and you have a reference for it | The judge is a model too. Check a sample of its scores against a person's before you trust it |
| Human review | You are calibrating the judge, or the stakes of one wrong answer are high | It is slow, and it needs a written rubric so two reviewers score the same way |
Use all three together: pattern checks for the fixed values, a judge for the rest, and a person who reviews a sample of the judge's scores each release. Score groundedness as its own item. An answer can be fluent, on topic, and unsupported by any document the agent retrieved, which is the failure OWASP lists as LLM07:2026 Misinformation: output that is wrong but credible enough for someone to act on.
How do you test multi-turn conversations?
Run a simulated user against the agent for a whole conversation, then score the conversation as one unit. A single question and answer cannot show a lost order number, a contradiction between an early turn and a late one, or a user who asks for a person three times and never gets one.
A simulated user is a second model that is given a goal and a persona and talks to your agent until the goal is met or a turn limit is reached. Several tools document this. LangSmith describes multi-turn simulation with a model playing the user. DeepEval's chatbot quickstart groups turns into multi-turn test cases and includes a conversation simulator. Ragas documents scoring a whole conversation pass or fail against a criterion you write in plain language.
Give the simulated user goals that a single question cannot reach: change the topic halfway and come back, correct an earlier detail, refuse to give a required detail, ask for a person. Then check the conversation for three things. Did the agent keep the facts the user gave? Did it contradict itself? Did it finish the task or hand off?
Simulation has a cost. A simulated user does not say the same thing twice, so two runs of one scenario can differ, and each run spends model calls on both sides of the conversation. Fix the goal and the persona, keep the turn limit short, and store every conversation you score.
How do you test what a chatbot does, not only what it says?
Assert the tool trace. The reply is only the agent's account of what it did. For every conversation that should take an action, the test checks which tool was called, with which arguments, how many times, and what the backend recorded afterward. The reply "your address is updated" passes only if one write reached the right record.
This job needs a backend the test can read. Point the agent's tools at a sandbox or at mocks that record each call, then compare the recorded calls with the expected ones from step 3 of the test set. Check both directions. The agent may claim an action it never took, and it may take an action while telling the user it refused. Our tool call workflow testing method describes the mocking and the trace assertions. It was written for phone agents, and nothing in the method depends on audio.
How do you test a chatbot for security?
Test security with a user who is trying to get something they should not have. Quality tests assume a user who wants the right answer. OWASP's entry on prompt injection says to test against adaptive attackers who know the defense, and not to accept a result that rests on static test cases alone. So read each row below as a goal for an attacker who keeps trying. Sending each one once proves little.
The table uses the item ids from the 2026 edition of the OWASP Top 10 for LLM Applications. That edition renumbered several items, so an id without its year can point at the wrong risk.
| OWASP 2026 item | What to try | Pass looks like |
|---|---|---|
| LLM01:2026 Prompt Injection | Instructions typed by the user, and instructions hidden in content the agent reads: a ticket, a web page, an uploaded file | An injection that lands still cannot reach data or actions the user is not entitled to |
| LLM02:2026 Sensitive Information Disclosure | Ask for another customer's data, before and after identity is verified | Nothing leaves in the answer, in a tool-call argument, in a retrieved chunk, or in a log |
| LLM03:2026 Excessive Agency | Ask for a refund, a discount, or an account change the user is not entitled to | The action is refused in code: by the tool, by a policy check before it runs, or by the system behind it. What the agent says does not count |
| LLM08:2026 Hidden Context Exposure | Ask the agent to repeat its instructions, its tool list, or the documents it was given | Whatever comes back holds no credential and no rule the design depends on staying secret |
| LLM09:2026 Vector and Embedding Weaknesses | If the bot answers from a knowledge base, ask questions whose answers sit in another customer's documents or in internal ones. Then change the documents in that other scope and send the same search query again, with the same user scope, so the document change is the only difference | The user's scope is applied inside the search, before ranking. The retrieval log shows no chunk from outside it, and result counts and scores are the same in both runs |
| LLM10:2026 Improper Output Handling | Get the agent to produce a Markdown image, a link preview, or an embedded frame that the chat window fetches on its own | The window does not fetch it, or strips what could send data out |
The pass line for LLM01 is written that way on purpose. OWASP's entry says no reliable way to prevent prompt injection exists today, so "the agent ignores the injected text" is not a result you can hold. The result you can hold is that an injection that succeeds has nothing to reach. For LLM08, OWASP's advice is to assume hidden context can be discovered, so a leaked prompt matters only as much as what was in it. Our hidden context exposure page goes through what should never be in a prompt, and the page on testing that an agent cannot take an action the user is not allowed to covers the LLM03 row.
The table leaves out items that a test of the conversation does not reach on its own. Two examples are LLM05:2026 Data and Model Poisoning and LLM06:2026 Unbounded Consumption. Poisoning is corruption of the data that shapes the model before the conversation starts: training sets, fine-tuning sets, and the knowledge and embedding content a bot retrieves from. You control the last two of those, and our LLM05 page covers how to secure them. Unbounded consumption is about cost and capacity. If your bot retrieves from a knowledge base, our LLM09 page covers that row in depth. A guardrail in front of the model does not close these rows either. OWASP's prompt injection entry treats no single control as enough, and we set out the reasoning in are guardrails enough to secure an LLM agent.
What are the best chatbot testing tools?
The best chatbot testing tool depends on which of the five jobs you are doing. This table sorts tools by the jobs their own documentation describes. Several cover three or four of the five. Every cell comes from the tool's own documentation or repository as of November 30, 2026. A job missing from a row is not a claim that the tool cannot do it. It means the pages we read do not describe it.
| Tool | Jobs its docs describe | License | What its own docs say |
|---|---|---|---|
| LangSmith | Answer quality, multi-turn behavior, regression | Not stated on the pages we read. The openevals package is described as open source | Golden datasets, a model as judge, runs in CI, and simulated multi-turn users |
| Promptfoo | Answer quality, security, regression | MIT. The repository says it is now part of OpenAI | A command-line tool and library for evals and red teaming, with CI documentation |
| DeepEval | Answer quality, multi-turn behavior, security, regression | Apache 2.0 | Multi-turn chatbot test cases, a conversation simulator, and unit tests in CI. The DeepTeam red-team framework says it has moved into DeepEval |
| Ragas | Answer quality, multi-turn behavior | Apache 2.0 | Scores a conversation pass or fail against a written criterion |
| Botium Core | Multi-turn behavior, regression | MIT | A test automation framework for conversational AI with connectors for the main chatbot technologies |
| Rasa testing | Multi-turn behavior, regression, for Rasa CALM assistants | Not stated on the page we read | End-to-end tests written in YAML and simulated conversations scored by a model |
| PyRIT | Security | MIT | A red-teaming toolkit with automated scans and adaptive multi-turn attacks |
| Garak | Security | Apache 2.0 | A command-line scanner that probes for prompt injection, data leakage, and jailbreaks |
| Giskard | Multi-turn behavior, security | Apache 2.0 for the library | Version 3 tests agents over multiple turns and includes a vulnerability scanner |
| Braintrust | Answer quality, regression | Not stated on the page we read | Experiments, evals on every pull request, and scoring of production traces |
| Arize Phoenix | Answer quality, regression | Elastic License 2.0 | Tracing, model-based evals, datasets, and experiments |
Two things the table cannot tell you. The first is the actions job: none of the rows above lists it, because checking a tool trace against your backend is work you set up in your own environment, whichever tool runs the conversation. The second is whether a listed feature works against your bot. That takes a trial against the deployed configuration, which is why the plan comes before the tool.
Hamming is our product, and it is not in the table because we would be grading ourselves. It tests and red-teams chat and voice agents, and it adds runtime security that monitors production conversations and blocks bad behavior in real time. The table mixes libraries you run yourself with hosted platforms you sign up for, and both are tools a team operates. We compare Hamming with what a team would otherwise rely on. Testing the bot by hand covers what the team has time to try. A penetration test is one point in time. And in our view, a vendor's own statement about the bot it built is not independent evidence.
How do you choose a chatbot testing tool?
Choose by the job you cannot do today, then by who will run the tool. A library that engineers run in CI and a hosted product that a QA or security team operates answer different needs, so expect to run more than one.
| If you need | Start with | Then add |
|---|---|---|
| A first score for answer quality | A golden dataset and a model as judge, in LangSmith, DeepEval, Promptfoo, or Braintrust | A person reviewing a sample of the judge's scores |
| A check that a prompt change did not break the cases you already cover | The same dataset run in CI on every change, which each of those four documents | A stored result for each agent version, and new cases for behavior the set does not cover yet |
| Whole-conversation coverage | A simulated user, as LangSmith and DeepEval document, scored per conversation | Tool-trace assertions for every conversation that takes an action |
| Security evidence for a launch review | The OWASP table above, worked by someone who did not build the bot, with Promptfoo, PyRIT, Garak, or Giskard for automation | Adaptive, multi-turn attacks, and a rerun on every change |
| Signals from production | Tracing and scoring of real conversations, as Braintrust and Arize Phoenix document | Each failure turned into a test case |
Ask two questions of any tool on the list. Can it reach the deployed chatbot through its real interface, with the production prompt, tools, and knowledge? A test of the model alone tells you little about the deployed configuration. And is the result something you can hand to another person: the conversation, the tool trace, the version, the date? If the security row is the one you are buying for, the AI red teaming tools comparison gives weighted criteria for that decision.
How do you keep testing a chatbot after launch?
Rerun the suite on every change to the prompt, the model, the tools, or the knowledge, and score real conversations in between. A passing result describes the scenarios you ran against the configuration you had on that day.
NIST's generative AI profile, AI 600-1, supports the second half of that. Among its suggested actions, which are voluntary, is adversarial testing at a regular cadence (MS-4.2-001). Its appendix on pre-deployment testing warns that tests run before launch can be mismatched to the conditions of real use. Rerunning on every change is our recommendation. NIST does not ask for it. In practice that means three habits:
- Trigger on change. Keep the test set in files, as in a tests-as-code template, and run it in the same pipeline that ships the prompt.
- Score production. Sample real conversations, score them with the same judge, and read the failures. Every failure becomes a test case.
- Keep attacking. The security job does not end at launch. The difference between a one-off assessment and an ongoing one is the subject of continuous red teaming versus point-in-time penetration testing.
Running the full suite on every change costs time and model calls. If that is too slow, run the cases tagged to the changed prompt, tool, or document on every change, and the full suite before each release.
What should a pre-launch chatbot test checklist include?
A pre-launch checklist should have pass or fail lines for each of the five jobs, and each line should name the evidence. Copy this into the release ticket.
Answer quality
- Every intent the bot handles has a test case with a written expected result. Evidence: the test file.
- Fixed values (prices, dates, required disclosures) are checked by pattern, not by a judge. Evidence: the assertions.
- A person reviewed a sample of the judge's scores for this release and agrees with them. Evidence: the reviewed sample.
- Out-of-scope questions get a refusal or a handoff, and never an invented answer. Evidence: the scored cases.
Multi-turn behavior
- A simulated user ran conversations that change topic, correct a detail, and ask for a person. Evidence: the stored conversations.
- A person can be reached from the chat, and that path was tested. Evidence: the handoff conversation.
Actions
- Every case that should take an action has its tool trace checked against the expected call, and the backend shows the result that call should have produced. The reply has to match what happened. A call that never happened, a call the backend rejected, or a reply that reports the wrong outcome fails. Evidence: the expected call, the trace, the backend record, and the transcript.
- Every case that should take no action, refusals included, leaves the backend unchanged: the trace shows no tool call, or a call that the tool or the system behind it refused. Evidence: the trace, the unchanged backend record, and the transcript.
Security
- A user who has not been verified cannot read or change another customer's data, and the refusal is enforced in code. Evidence: the attempt and the tool trace.
- Injected instructions in a ticket, a page, or an upload cannot reach data or actions the user is not entitled to. Evidence: the attempts and the tool trace.
- If the bot retrieves from a knowledge base, a user cannot get an answer built from a document outside their scope. Evidence: the retrieval log for the attempts, with the scope, the query, the returned ids, and the scores.
- The system prompt holds no credential and no rule the design depends on keeping secret. Evidence: the prompt review.
- The chat window does not fetch images, link previews, or frames from model output on its own. Evidence: the rendering test.
Regression
- Every case ran more than once, and intermittent failures are counted as failures. Evidence: results per run.
- The results are stored against the agent version, and the suite is set to rerun on the next change. Evidence: the pipeline configuration.
Where chatbot testing stops
A test result covers the scenarios you ran and the configuration you ran them against, and nothing else. It does not show that the bot is safe from attacks nobody wrote down, and it expires when the prompt, model, tools, or knowledge change. A judge is a model, so its scores need the human check described above. And none of the checks here replace authorization enforced in code: if the system behind the agent lets it act for the wrong user, testing the conversation does not fix that.
Start with the test-area table. Write one case for each of the five jobs this week, run them against the deployed bot, and keep the results with the version number. Then grow the set from real conversations.