Reference · How-to · ~6 min

How to red-team prompt injection

Last updated

Automate adversarial prompts in staging before users find holes.

Automate adversarial prompts in staging before users find holes.

Steps

1. Collect 20–50 known jailbreak / exfil patterns (no public exploit recipes in docs)

2. Run each against your bot with logging redacted

3. Assert: blocked, refused, or safe degraded answer — never secret leak

4. Fail CI on regression when a previously blocked prompt succeeds

5. Rotate new patterns monthly from internal red-team notes

**Try the lesson:** `prompt-injection-in-code` in Lane D