---
title: "Prompt Injection Fixes Need Regression Tests"
description: "Patched prompt injections in agentic systems can reappear after model upgrades or changes to prompts, connectors, or memory, making them regression issues requiring continuous testing. Unlike legacy systems, agentic stacks shift quickly, and a model upgrade can reopen a gap without changing the prompt. Akash Agrawal recommends treating no agent output as trustworthy and continuously logging inter-agent messages. Jose Lejin describes a patched injection that returned through a retrieval connector after a model upgrade. Lejin’s team now converts every patched jailbreak into a test fixture that runs during builds, blocking releases that cannot withstand previously defeated attacks. The practice also tests across full sessions and covers infected external data, with security owning the safety bar and engineering owning the release gate."
---

# Prompt Injection Fixes Need Regression Tests

[Stack Overflow](https://yomu.fyi/company/stack-overflow) · Saqib Jan · Nov 24, 2026

**Type:** Problem & solution

## Summary

Patched prompt injections in agentic systems can reappear after model upgrades or changes to prompts, connectors, or memory, making them regression issues requiring continuous testing. Unlike legacy systems, agentic stacks shift quickly, and a model upgrade can reopen a gap without changing the prompt. Akash Agrawal recommends treating no agent output as trustworthy and continuously logging inter-agent messages. Jose Lejin describes a patched injection that returned through a retrieval connector after a model upgrade. Lejin’s team now converts every patched jailbreak into a test fixture that runs during builds, blocking releases that cannot withstand previously defeated attacks. The practice also tests across full sessions and covers infected external data, with security owning the safety bar and engineering owning the release gate.

## Approach / What changed

Convert every patched injection into a test fixture that pairs the attack payload with the expected system rejection, run the full suite on every build when prompt code, model version, or connectors change, treat model version bumps as release events, test both user-driven inputs and infected external data across full agent sessions, and split ownership with security defining the safety bar and engineering running the gate.

## Takeaways

- A patched prompt injection can return after a model upgrade without any change to the prompt, making it a regression that requires continuous testing rather than one-time review.
- Converting each patched jailbreak into a test fixture that pairs the payload with the expected rejection and running it on every build ensures that previously defeated attacks do not succeed after model or code changes.
- The attack surface includes both user-crafted inputs and infected external data like documents, and tests must cover full agent sessions to catch persistent instructions hiding in memory.

## FAQ

### How can a patched injection reappear without code changes?

A model upgrade can make the model more compliant to instructions in retrieved documents, executing an injection that the older version ignored. The injection can also return through a changed data connector or prompt edit, without any change to the reviewed code.

### What regression testing practices prevent injection regressions?

Convert every patched jailbreak into a test fixture that runs during builds, treat model version changes as release events, and test both user inputs and infected external data across full sessions to catch persistent instructions in memory.

### Why is prompt injection harder to fix in agentic systems than legacy systems?

In agentic systems, model outputs become inputs to other models without suspicion, and the stack can shift between security reviews. A patch can be undone by a model upgrade or new data connector, making scheduled reviews insufficient and requiring continuous regression testing.

**Tags:** [Agentic AI](https://yomu.fyi/topic/agentic-ai), [Prompt Injection](https://yomu.fyi/topic/prompt-injection), [Regression Testing](https://yomu.fyi/topic/regression-testing), [Security](https://yomu.fyi/topic/security)

- Source: [Stack Overflow](https://stackoverflow.blog/2026/11/24/prompt-injection-fixes-need-regression-tests)
- Source URL: https://stackoverflow.blog/2026/11/24/prompt-injection-fixes-need-regression-tests
- Ingested by Yomu: 2026-11-24T18:01:10.613Z

[Read original post](https://stackoverflow.blog/2026/11/24/prompt-injection-fixes-need-regression-tests)
