[KongchangAI]
· 2 min read· 1,346 words

Built-in Security in the Inference Engine: vLLM's New Approach to Intercepting AI Attacks

Built-in Security in the Inference Engine: vLLM's New Approach to Intercepting AI Attacks

Reflection AI and vLLM launch Beam + Iris to read hidden states before the first token and block attacks.

Reflection AI and vLLM have collaborated to launch the Beam + Iris cybersecurity probe, moving the security defense line from "post-output filtering" forward to "pre-generation blocking." Traditional solutions filter after the model generates content, creating a time gap in which malicious instructions may already have triggered tool calls or data leakage; Beam + Iris directly reads the model's real-time hidden states when processing the prompt, providing risk judgment and interception before the first token leaves the server. The solution is built inside the open-source inference engine vLLM, supports linear, MLP, and stateful minGRU online activation monitoring probes, and coexists with optimizations such as CUDA graphs, chunked prefill, and speculative decoding without sacrificing throughput. Its model-agnostic design allows security policies to be reused across multiple models, and it is positioned as the starting point of vLLM's open inference security initiative.

The battleground for AI security defense is moving earlier. In the past, we were used to adding a content filter layer after model output; but attackers often succeed before the model generates its first token. The Beam + Iris cybersecurity probe, launched through a collaboration between Reflection AI and vLLM, attempts to embed the defense line directly inside the inference engine—reading hidden states the moment the model processes the prompt, and completing interception before the token leaves the server.

From "post-hoc filtering" to "pre-generation blocking"

Most traditional security solutions are deployed after model output: first let the model generate content, then use classifiers or rules to filter violating results. This model has an obvious time gap—malicious instructions may have already triggered tool calls or data leakage during generation. Beam + Iris takes a different approach: the probe directly reads the model's real-time hidden states when processing the prompt, and gives a risk judgment before the first token is generated. According to Reflection AI's explanation on social platforms, this Day 0 support already runs on vLLM, can flag and block real attacks, while allowing similar-looking but harmless security-related questions to pass.

The key to this "mind-reading" detection is that the model's understanding of the input is reflected in its hidden states, and the probe can capture anomalous signals before generation begins. Compared with post-output filtering, it moves the response window forward to the starting point of inference.

Hidden states are the internal vector representations the model forms for the current input at each layer. Unlike the final output text, hidden states carry information about "how the model understands the input"—including whether it recognizes a prompt as instruction injection, a jailbreak template, or tool-call inducement. The probe is based on this premise: during the prefill stage (when the model has read the prompt and has not yet generated the first token), it reads the hidden states of specific layers and uses a trained classifier to judge risk. Since no token has left the server at this point, interception can achieve "zero leakage"; and because it only reads activations and does not modify the generation logic, it can also distinguish semantically similar but harmless security-related questions, reducing false positives.

Security capabilities inside an open-source inference engine

The most noteworthy aspect of this solution is that it is built directly inside the open-source inference engine vLLM, rather than wrapped behind some closed-source API. Reflection AI's engineers proactively initiated a PR and worked with the vLLM team to build an interface compatible with all models. Specifically, online activation monitoring in vLLM supports three types of probes: linear probes, MLP probes, and stateful minGRU probes. This means developers can choose detectors of different complexity based on the model and scenario, without relying on external services.

Real-time per-token risk scoring coexists with inference optimization features such as CUDA graphs, chunked prefill, and speculative decoding, showing that security monitoring does not come at the cost of throughput. For teams that need to serve open-source models, this provides a path to handle security uniformly at the inference layer.

Linear probes and MLP probes are the two most basic forms of detectors in activation-space monitoring. A linear probe is essentially a linear classifier (logistic regression) trained on the hidden states of a certain layer of the model. It assumes that the distinction between "malicious" and "safe" is approximately linearly separable in hidden space; training cost is low, inference overhead is small, and it is suitable for rapid deployment. An MLP probe introduces one or more layers of nonlinear transformation, which can capture more complex risk patterns, at the cost of more parameters and more labeled data for training. The minGRU probe is a stateful detector: minGRU is a lightweight variant of GRU that can maintain a hidden state along the token sequence, making it more sensitive to "gradual inducement"-style multi-turn attacks, rather than viewing each token's activation in isolation. The three types of probes, from simple to complex, form a composable detection spectrum.

Online activation monitoring refers to reading model internal activations in real time during inference and making judgments, rather than analyzing logs offline after the fact. Its engineering difficulty lies in the fact that: for throughput, vLLM uses CUDA graphs to freeze computation graphs, chunked prefill to process long prompts in batches, and speculative decoding to generate draft tokens in parallel. These optimizations all disrupt the naive assumption of "reading hidden states token by token in order." For the probe to still obtain correct activations and score synchronously under these optimizations, it must be deeply integrated into the scheduling and execution path, rather than attached as a sidecar process. This is also why the project chose to submit a PR directly to vLLM instead of building an independent service.

The design philosophy of model agnosticism

Beam + Iris is designed to be model-agnostic: it is built for the various models served by vLLM, rather than bound to a specific architecture. This is especially important in the open-source ecosystem—teams often deploy multiple models at the same time, and if a security solution can only adapt to one of them, operations become fragmented. Model agnosticism means the probe interface can be reused, and security policies can be migrated across different models.

Of course, model agnosticism also brings challenges: the hidden-state spaces of different models vary greatly, and the generalization ability of probes needs practical verification. Reflection AI's collaboration with vLLM to build a unified interface is precisely to solve this part of the engineering complexity.

The distinction between the prefill and decode stages is key to understanding this solution. In the prefill stage, the model processes the entire prompt in parallel at once, which is the best time to read "the overall understanding of the input"; the decode stage then generates autoregressively token by token. Beam + Iris chooses to judge before the first token is generated, precisely leveraging the fact that at the end of prefill the hidden states have fully encoded the prompt semantics. But this also means the probe's latency must be extremely low, otherwise it will slow down time to first token (TTFT). Per-token risk scoring continues during the decode stage, which can capture risks that only surface midway through generation; the combination of the two forms monitoring that covers the entire inference lifecycle.

The starting point of the open inference security initiative

Reflection AI positions this collaboration as the starting point, not the endpoint, of vLLM's open inference security initiative. On social platforms, they invite developers who train probes, build guardrails, or deploy open-source models to participate. This sends a signal: inference security is shifting from an exclusive capability of closed-source vendors to part of open-source infrastructure.

For AI application developers, this means that when deploying models on vLLM in the future, security monitoring may be as natural as enabling a configuration option. For security researchers, probe training and evaluation will become a new focus. Inference itself has not yet been fully solved, and the下沉 of security capabilities makes this field even more interesting.

One-line Summary

Reflection AI and vLLM launch Beam + Iris, reading hidden states before the first token is generated to block attacks.

Paragraph Summary

Reflection AI and vLLM have collaborated to launch the Beam + Iris cybersecurity probe, moving the security defense line from "post-output filtering" forward to "pre-generation blocking." Traditional solutions use classifiers to filter after the model generates content, creating a time gap in which malicious instructions may already have triggered tool calls or data leakage during generation; Beam + Iris instead directly reads the model's real-time hidden states when processing the prompt, providing a risk judgment and interception before the first token leaves the server. The solution is built inside the open-source inference engine vLLM, supports three types of online activation monitoring probes—linear, MLP, and stateful minGRU—and coexists with optimizations such as CUDA graphs, chunked prefill, and speculative decoding without sacrificing throughput. Its model-agnostic design allows security policies to be reused across multiple models, and it is positioned as the starting point of vLLM's open inference security initiative.

#vLLM#AI security#hidden states#inference engine#Beam + Iris#online activation monitoring#model-agnostic#open-source security
Share:

Related articles