Logic-layer Prompt Control Injection is a new vulnerability surface that makes prompt injection look quaint


You have an AI agent. It remembers things across sessions. It pulls documents from a vector store. It calls tools. It runs on a schedule, sometimes without you watching.

That agent has a memory problem — and it's worse than you think.

A paper published this month on arXiv (2507.10457) formally defines a new class of attack called Logic-layer Prompt Control Injection, or LPCI. The authors — Hammad Atta, Ken Huang, Manish Bhatt, and collaborators — ran 1,700 structured test cases against five major LLM platforms. They achieved execution rates up to 49% on less-protected systems. They also built a working framework and published it on GitHub.

This isn't another prompt injection paper. LPCI is something different. It exploits the infrastructure layer — the persistent memory, vector stores, and tool registries that production agents rely on every day.

What Makes LPCI Different

Standard prompt injection is a conversation-level attack. Someone tricks the model into doing something it shouldn't, right now, in this session. You can often catch it with input filters, output moderation, or careful system prompt design.

LPCI doesn't work that way.

An LPCI attack embeds a malicious payload in a persistent storage layer — a vector database, a session memory store, a tool description, or a retrieved document. The payload sits dormant. It can survive session resets. It can wait days or weeks. Then, when a specific condition is met, it fires.

The GitHub repository (mbhatt1/agentic_lpci_framework) describes it plainly: "Unlike traditional prompt injections that affect single interactions, LPCI attacks are persistent, cross-session, infrastructure-level exploits that can compromise entire AI systems."

Think of it as the difference between XSS and stored XSS. One exploits a single page render. The other plants a bomb in the database that detonates for every user who loads the page. LPCI is the stored XSS of the AI world.

The Attack Lifecycle

The paper breaks LPCI into a four-stage operational flow:

  1. Injection. The payload enters the system through a user input, an API response, an uploaded file, or a poisoned document fed into a RAG pipeline.
  2. Storage. The payload gets written to persistent memory — a vector store, a Redis cache, a conversation log, a tool registry. It's now part of the system's state.
  3. Trigger. A condition activates the payload. This could be a time bomb ("activate after 24 hours"), an event trigger ("when the CEO logs in"), or a semantic condition ("when discussing financial data").
  4. Execution. The payload fires. It overrides roles, escalates privileges, exfiltrates data, or redirects the agent's behavior — all from inside the trusted memory layer.

Between storage and trigger, the attack is invisible. No input filter catches it because it's not coming through an input. No output moderation catches it because it hasn't produced output yet. The payload just... waits.

What the Researchers Actually Tested

The team ran 1,700 structured test cases across ChatGPT, Claude, LLaMA3, Gemini 2.5 Pro, and Mixtral-8x7B. They also ran ad-hoc exploits against Poe, Grok, and Bohrium.

The results are sobering. Less-protected systems showed execution rates approaching 50%. The attacks worked across multiple platforms, exploiting common architectural assumptions:

  • Stored messages get replayed across sessions without integrity checks.
  • Retrieved content from vector stores is implicitly trusted.
  • Role assignments and contextual cues from memory drive command execution without verification.
  • Tool outputs are treated as ground truth.

The framework on GitHub demonstrates specific attack patterns:

  • Vector store contamination — malicious embeddings that return harmful content during similarity searches
  • RAG pipeline corruption — poisoned documents that manipulate retrieval-augmented generation
  • Tool registry hijacking — fake tool registrations that execute malicious code when the agent calls them
  • Session memory bombs — data stored in Redis that affects future, unrelated user interactions
  • User-to-user propagation — payloads that spread from one user's context to another's through shared infrastructure

That last one should make you uncomfortable. An attacker interacts with your agent, plants a payload in shared memory, and a completely different user triggers it. The victim never did anything wrong. They just talked to an agent that had a bomb in its memory.

Why Current Defenses Fail

Most AI security work focuses on input filtering and output moderation. Both assume the attack happens in real time, during a single conversation.

LPCI breaks that assumption in three ways:

Timing. The injection and the execution happen in different sessions, sometimes days apart. Input filters scan the wrong moment.

Trust. The payload lives in memory the system already trusts. Vector stores, session logs, and tool registries don't get the same scrutiny as user inputs.

Activation. Conditional triggers mean the payload can pass every check during testing and only fire in production when the right semantic conditions appear.

The paper puts it directly: "Current AI safety measures, which primarily focus on prompt moderation and content filtering, fail to address the sophisticated threat vectors that LPCI introduces."

What Defenses Actually Work

The paper proposes a suite of runtime security controls. None of them are input filters.

Prompt risk scoring. Every prompt — including those reconstructed from memory — gets a risk score based on content analysis, origin tracking, and behavioral patterns. High-risk prompts get flagged before execution.

Memory integrity validation. Every item in persistent memory carries a provenance chain. Where did this come from? Who wrote it? When? Was it validated? Memory entries without clean provenance get quarantined or purged.

Cryptographic attestation for tools and documents. External tools and ingested documents carry cryptographic signatures. If a tool registration or a RAG document lacks a valid signature from a trusted source, the agent refuses to act on it.

Multi-stage validation pipeline. Instead of a single input check, the system validates at injection, at storage, at retrieval, and at execution. Each stage catches what the previous one missed.

Escalation router. When a trigger condition fires and the payload attempts to execute, the router intercepts high-risk actions and routes them to a human reviewer or a sandboxed execution environment.

These are infrastructure-level controls. They require changes to how agents are built, not just how prompts are written.

The Real-World Implications

If you're running production agents with persistent memory, RAG pipelines, or shared infrastructure, LPCI is your problem. Here's what it means in practice:

Multi-tenant agent systems are especially vulnerable. If multiple users share a vector store, a session cache, or a tool registry, a payload planted by one user can fire for another. The cross-user propagation pattern in the framework demonstrates this directly.

Agents that run on schedules are at higher risk. An agent that executes tasks autonomously — without a human in the loop reviewing each action — gives an LPCI payload more opportunities to fire unchecked.

RAG systems are a primary attack surface. If you ingest external documents into a vector store without integrity checks, you're building a delivery mechanism for LPCI. Every unverified document is a potential payload.

Tool registries need the same scrutiny as code dependencies. A poisoned tool registration is no different from a malicious npm package. Treat it with the same severity.

The Bottom Line

The AI security conversation has spent two years focused on prompt injection. LPCI shows that prompt injection is the easy version of the problem. The hard version lives in the infrastructure — in the memory stores, retrieval pipelines, and tool registries that agents trust by default.

The paper is rigorous. The framework is working code. The attack patterns are reproducible. And the defenses proposed are practical enough to implement today.

If you're building agent systems, read the paper. Audit your memory layer. Check your provenance chains. And stop trusting everything your agent remembers.


Paper: Logic-layer Prompt Control Injection (LPCI) — Atta, Huang, Bhatt, Ahmed, Ul Haq, Mehmood (2025)

Framework: github.com/mbhatt1/agentic_lpci_framework

CSA analysis: Cloud Security Alliance coverage