Chapter 3 · Practice 5 of 5
Red-team your app with injection attempts before launch
Why it matters
You will not know how your app fails under attack until you attack it yourself. Do it before launch, not after a user does.
- Write down the worst things your app could do, such as leak another user's data, send an email, spend money or call an internal API.
- Try to make it do each one through user messages.
- Try again through poisoned documents or pages the app reads.
- Turn every successful attack into an eval case and keep it in the regression suite.
Repeat the exercise whenever you add a tool or a new data source, because each one is a new path for instructions to arrive.