← Latest papers
🤖 AI

Governing the KV Cache: Preventing Timing Side-Channel Leakage in Multi-Tenant LLM Inference

This paper introduces KVGov, a governance layer that prevents timing side-channel attacks in multi-tenant LLM inference by cryptographically isolating KV cache keys across tenants via per-principal salting and an audit scheduler, thereby eliminating cross-tenant leakage while preserving 93% of prefix-cache efficiency.

Original authors: Tejasvi C. Addagada

Published 2026-08-11
📖 8 min read🧠 Deep dive

Original authors: Tejasvi C. Addagada

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a bustling, high-tech library where a magical librarian (the AI) can answer any question you have. To be super fast, this librarian keeps a "reference sheet" of the most common story beginnings right on their desk. If you ask a question that starts with the same words as someone else's, the librarian doesn't need to re-read the whole book; they just glance at the reference sheet and jump straight to the answer. This is incredibly efficient, saving huge amounts of time. However, in a busy library with many different people (tenants) using the same desk, a sneaky person could figure out what the others are reading. They wouldn't need to see the book; they'd just watch how long it takes the librarian to find the answer. If the librarian grabs the answer instantly, the sneaky person knows, "Ah, they must have asked about the same story I just asked about!" If the librarian has to walk to the back shelves, it means the story is new. By timing these tiny delays, a bad actor could reconstruct the private secrets or prompts of other people, turning a speed feature into a security leak.

This paper tackles that exact problem in the world of Large Language Models (LLMs), the super-smart AI chatbots we use today. These models use a "KV cache" (the reference sheet) to speed up responses by remembering previous parts of a conversation. The author discovered that in shared environments, this speed trick creates a "timing side channel"—a secret signal hidden in how long things take. They found that three different groups of hackers have already shown how to use this signal to steal private prompts with nearly 100% success. The paper proposes a new system called KVGov to fix this. Instead of just trying to hide the timing (which is hard), KVGov changes the rules of the game so that the reference sheet is completely different for every single user. It's like giving every library visitor their own unique, invisible ink that makes their specific reference sheet unreadable to anyone else. The author shows through simulations and real hardware tests that this method stops all three types of attacks dead in their tracks, while still keeping the library fast enough to be useful. They also introduce a smart "security guard" system that knows exactly who to watch most closely, and they calculate a tipping point where it becomes safer to stop sharing the reference sheet entirely.

The Great Cache Heist

Think of the AI's memory as a giant, shared whiteboard. When you ask the AI a question, it writes down the key parts of your sentence on the board so it doesn't have to re-calculate them if you ask a similar question later. This is the KV cache. In a multi-tenant setup (where many different companies or users share the same AI server), everyone shares this whiteboard to save time.

The problem is that the whiteboard is too obvious. If a sneaky user (the attacker) asks, "What is the capital of France?" and the AI answers instantly, the attacker knows, "Oh, someone else must have asked that recently!" If the AI takes a long time, the attacker knows, "No one has asked that yet." By trying thousands of different questions and timing the answers, the attacker can map out exactly what other people are asking, even if they can't see the answers themselves. This is called a timing side-channel attack.

The paper highlights three specific ways hackers have used this:

  1. PROMPTPEEK: The hacker guesses a list of possible questions and times them all. If their timing matches the victim's pattern, they know exactly what the victim asked.
  2. EarlyBird: The hacker tries to guess the victim's question one word at a time. If the AI is fast, they know they guessed the right word.
  3. InputSnatch: This is for structured questions, like filling out a form. The hacker knows the template (e.g., "Show transactions for account [NUMBER]") and just tries different numbers until the AI is fast, revealing the secret account number.

The author tested this on real hardware (an NVIDIA A100 GPU) and found that the timing difference is huge: a "cold" request (new info) took 149.6 milliseconds, while a "cached" request (reused info) took only 32.8 milliseconds. That's a ratio of 0.22, which is a massive, easy-to-spot signal for a hacker.

The Solution: KVGov and the Magic Ink

The paper introduces KVGov, a new layer of security that acts like a gatekeeper. Its main trick is HMAC-keyed namespace isolation.

Imagine that every user in the library has a unique, secret stamp (a "salt"). When the librarian writes a question on the whiteboard, they first stamp it with the user's secret ink. Even if two people ask the exact same question, the ink makes the whiteboard entry look completely different to everyone else.

  • How it works: The system takes the user's ID and a secret key to create a unique code. This code is mixed into the very first step of creating the cache key.
  • The Result: If a hacker tries to guess what a victim asked, their own secret stamp won't match the victim's. The hacker's probe will always look like a "miss" (slow) because their code doesn't match the victim's code on the board. The timing signal disappears.

The author ran 1,000 simulated trials and found that this "HMAC-salt" alone was enough to drop the attack success rate from 100% to 0% for all three types of attacks. It was the only part of their system that was strictly necessary; the other parts just added extra layers of safety.

Keeping the Library Fast (The Boundary Trick)

You might think, "If everyone has their own secret whiteboard, won't the library get slow?" If we made every single user have a totally separate board, we'd lose the speed benefit of sharing common questions (like "Hello, how are you?").

The paper offers a clever fix called Boundary Salting.
Imagine a story where the first 2,000 words are the same for everyone (the shared preamble), and only the last 100 words are different (the private part).

  • Old way: Stamp the whole story with secret ink. No one can share the first 2,000 words.
  • KVGov way: Leave the first 2,000 words un-stamped so everyone can share them. Only stamp the very first word where the stories diverge.
  • The Payoff: This keeps 93% of the speed benefit while still keeping the private parts secret. The author estimates that with a 2,000-word shared intro and a 119-word private tail, the system would still be incredibly fast (around 41.2 ms for the private part), retaining most of the efficiency.

The Smart Security Guard: ORIGAMI

Even with the magic ink, the author wanted to make sure no one was trying to sneak around. They created ORIGAMI, a smart audit scheduler.

Think of the library manager having a limited budget of security guards. They can't watch everyone all the time. ORIGAMI uses a mathematical strategy (called a Stackelberg water-filling approach) to decide who to watch.

  • The Logic: If a user is very valuable (high risk) and has a history of suspicious behavior, they get more guards. If a user is low risk, they get fewer.
  • The Result: In simulations with 10 tenants and a realistic mix of user types (a "Gini coefficient" of 0.63), this smart scheduling reduced the attacker's expected success by 12.6% compared to just picking random people to watch.

When to Stop Sharing

Finally, the paper asks a big question: "When is it better to stop sharing the whiteboard entirely?"

They used a concept called Evolutionary Stability to find a tipping point. They modeled a population of users where some share the cache (fast but risky) and some don't (slow but safe).

  • The Finding: If the percentage of hackers in the system goes above 31.6%, it becomes mathematically better for everyone to stop sharing the cache and go back to having their own private boards. Below that number, sharing is still the winning strategy. This gives library managers a clear rule: if you suspect more than about 1 in 3 users are bad actors, stop sharing the cache.

What This Doesn't Do

The paper is very clear about what it doesn't solve.

  • It doesn't stop hackers from stealing the AI's brain (the model weights).
  • It doesn't stop hackers from tricking the AI into saying bad things (prompt injection).
  • It doesn't fix "semantic caches" (where the AI matches ideas rather than exact words). For those, you'd need a different kind of lock.
  • The EarlyBird attack (guessing word-by-word) is mostly blocked by newer AI engines that use larger "blocks" of words, but the author warns that for structured forms (like account numbers), the block size doesn't matter—the timing leak is still there.

The Bottom Line

The author proved that the speed boost we love in AI comes with a hidden cost: a timing signal that leaks private information. They showed that simply hiding the signal isn't enough; you have to break the link between the user and the cache. By using a cryptographic "magic ink" (HMAC-salt) and only applying it where the secrets begin, KVGov stops the leaks completely while keeping the AI fast. It's a win for privacy that doesn't require slowing down the future of AI.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →