A patched injection could come back after, say, a model upgrade with no change to the prompt. And catching it most often lies in simple delivery habits, like having a test that runs on every build.
Most engineering teams would without hesitation size up prompt injection as a security issue. That’s because companies build their security programs in a way that keeps security apart from delivery and doesn’t take into account the stakeholders who ship changes every week, where specialists run an adversarial review once or twice a year, patch whatever that review finds and move on. That kind of cadence made some sense when it was extended from legacy systems, where code changed through planned releases and a closed hole would usually stay closed between releases. But agentic systems have changed the pace, since an agent’s behavior can now shift between two reviews without anyone touching the reviewed code.
This matters because, unlike the slow-moving threats that review cadence was built for, an agent stack keeps shifting under the patch, and a model upgrade, a prompt edit or a new data connector can reopen a gap that was closed months earlier. And so an injection that circles back after it was patched is but a regression, and catching regressions is the job test suites already do. But then there’s also a timing gap, because a scheduled review checks the system at one moment, while a regression suite can run every time any part of that stack changes.
Agent Handoffs Were Never Built to Be Suspicious
Part of the reason these holes reopen is how agentic systems are wired. The output of one model becomes the input of the next. And nothing in that handoff treats what comes through with any suspicion.
Akash Agrawal, Vice President of DevOps and DevSecOps at TestMu AI, an agentic AI quality engineering platform, has worked where delivery pipelines and security controls meet, and in his current role he has spent much of his work on this failure mode. He warns that “a malicious instruction introduced into one model can propagate to others it communicates with, producing a chain reaction where compromised output becomes the next agent’s input.” The spread is hard to see from the outside, because a model can act on a poisoned instruction and still hand something downstream that looks like ordinary output.
Agrawal recommends carrying “the zero-trust posture security already applies to users and services to the models themselves, treating no agent’s output as safe simply because it came from inside the system.” A team that is bound by delivery deadlines to accept some risk, and quick to assume trust is a given for internal agent traffic, has no reason to test it. And so problems in that traffic tend to surface in production first. In practice that means logging every message one agent passes to another and running it through the same input validation a public API endpoint would get, which gives the test suite something concrete to assert against.
A Model Upgrade Could Reopen a Closed Injection
Jose Lejin P J, Principal Member of Technical Staff at Salesforce, has seen fixed issues flare back from his engineering purview, going through repeated cycles of patching and retesting AI features. And in one case, he shares, a patched injection came back through a retrieval connector that let malicious instructions ride inside a document the agent read. The instructions told the agent to disregard its guardrails along with the context from every prior step. I wrote on Techstrong.ai about RAG systems that fail upstream in the data they pull in (https://techstrong.ai/features/rag-fails-upstream-and-most-teams-are-fixing-the-wrong-problem/), and an attacker who controls a single document can exploit that weakness on purpose.
Even closing the hole the first time took weeks. “This flaw was corrected by tightening the structure and processing of system prompts and inputs,” Lejin explains, “but we still observed it failing for several weeks before we finally fixed it.” The fix held until a model upgrade brought the injection straight back. “The updated version was just more compliant to the instructions found in retrieved documents, so it executed the instructions previously disregarded by the older version. Our prompt did not change at all,” he adds.
Because nothing in the team’s own code changed, a code review or a prompt diff had nothing to show. A test that replays the old attack against each new model version would have flagged it before release. For engineering teams the practical change is to treat a model version bump as a release event in its own right, logged and tested like any code change. Pinning the model version in configuration makes that possible, because an upgrade then has to arrive as a reviewed change and not as a silent swap by the provider.
Every Patched Jailbreak Becomes a Fixture
Lejin’s team changed what a patch means. “We no longer treated every patch as a fix, but as a test case,” he explains. Every jailbreak the team has shut down now becomes a fixture that pairs the original payload with the rejection the system is supposed to produce, and the fixtures run from a red-team database whenever the prompt code, the model or a connector changes. “Builds that can’t withstand attack vectors we’ve already successfully fended off are simply not released,” he notes. Each new incident also seeds a more aggressive variant of the payload, so the suite grows with every attack the system meets.
For teams copying this, placement matters. Running the suite in the same pipeline stage that blocks a release on a failing unit test keeps it from turning into a report someone reads after the fact. And this also gives the security team a release signal it can read without chasing engineers for status. Because a blocked build names the exact payload that got through, the fix starts from evidence before anyone schedules a meeting about it.
User Input Is Only Half the Attack Surface
The harder decision is what goes into the suite, because a payload library built only from what a user might type leaves other paths into the system untested.
Agrawal splits the attack surface into two vectors that need separate coverage. The first is user-driven, where somebody crafts an input to override the agent’s instructions. The second is infected external data, where a document or another model carries a hidden command that fires the moment the agent reads it. Lejin’s retrieval connector was the second kind. So Agrawal recommends keeping fixtures for both, since a suite weighted toward user input can pass cleanly while the connector path stays open.
Persistence is the gap Agrawal has flagged the longest. An infection does not always stay inside a single request, because “the persistence of the infection is much more about the context of memory.” Long-term memory and session state give a hidden instruction somewhere to wait after the request that carried it has finished, so a test that fires one payload at a clean session can pass while the instruction waits for the next turn. His recommendation is to run payloads across a full session instead of a single call, and to test the chain of agents along with each agent on its own. An agent that refuses an instruction can still pass it along to the next one that doesn’t.
For teams running agents with memory, this means stored context needs the same scrutiny as any other untrusted input. That includes validating what an agent writes to memory and keeping a way to purge it after an incident, so a cleaned-up attack does not wait in storage for the next session.
Security Owns the Bar and Delivery Owns the Gate
Interestingly, ownership gets contested the moment a regressed injection ships. Lejin remembers the standoff in two lines. “Security said that your prompt regressed. The team said that your model changed under them.”
His team settled it by splitting the work. “The security guys own the bar,” he explains, meaning security decides what counts as safe and which attacks must fail. “The delivery guys own the gate,” meaning engineering runs those attacks as a regression check before every release.
A practical first step is to turn every injection the team has already patched into a fixture, pair it with the rejection the system should produce, and run the full set against the next model version before it ships. In Lejin’s case, a model upgrade was the change that brought a patched injection back.
Credits for Commentary
- Akash Agrawal, Vice President of DevOps and DevSecOps, TestMu AI - linkedin.com/in/akashmagrawal/
- Jose Lejin P J, Principal Member of Technical Staff, Salesforce - linkedin.com/in/joselejinpj/