1.6Injection Testing Best Practices
Maintain a living payload library. New injection techniques emerge weekly. Subscribe to AI security research feeds and update your test payloads regularly.
Test in multiple languages. Models may be less guarded against injection in non-English languages.
Test with different roles. An injection might fail for a regular user but succeed when the user has elevated permissions.
Test indirect injection through every input channel. Documents, URLs, database records, file uploads -- any data the LLM processes can carry injections.
Test chained attacks. A single injection might fail, but a sequence of carefully crafted messages might gradually erode the system prompt's authority.
Automate and run in CI. Injection tests should run on every deployment that changes prompts, LLM configuration, or the retrieval pipeline.
Prompt injection is not a problem that will be "solved" -- it is an ongoing arms race between attackers and defenders. The QA architect's role is to ensure the defense is tested as rigorously as the offense.