ALENZA CODES

Red teaming generative AI: the basics

How to plan a small, useful adversarial test of a chatbot or AI assistant before launch.

Red teaming means deliberately trying to make a system fail, so you find problems before users or attackers do.

Plan

  1. Scope: which system, which version, which risks matter most (wrong answers, data leakage, harmful content, prompt injection, unfair treatment).
  2. Team: people who know the domain, people who know the users (including people with disabilities and speakers of the languages you serve), and someone with security skills.
  3. Rules: test environment, no real personal data, how to record findings.

Test

  • Accuracy: questions with known answers, including edge cases from your policies. Ask for sources and check them.
  • Confidential information: try to extract system prompts, other users' data, internal documents in the retrieval index.
  • Prompt injection: hide instructions in documents, emails or web pages the system reads.
  • Harmful content: requests for dangerous advice, harassment, self-harm scenarios (with care).
  • Consistency and fairness: ask the same question with different names, languages or phrasing; compare answers.
  • Over-reach: if the system can take actions, test whether it can be tricked into doing too much (see excessive agency).

Report and fix

Record each failure with the exact input, output, severity and suggested fix. Retest after fixes, and keep the failing cases as a regression suite. Open-source tools such as Inspect, garak and promptfoo can automate parts of this.