Reading the Residual Stream: Productizing Activation-Probe Security at Intuit

Guy Shtar (AI Security & Safety Architect, GenAI Security, Threat Modeling, and AI-Assisted Risk Assessment · Intuit), Guy Elad (AI Science Tech Lead, AI Security · Intuit)

[un]prompted II 2026 — The AI Security Practitioner Conference · Day 3 · Stage 2

Overview

Prompt injection and goal hijacking represent some of the most critical security vulnerabilities in modern agentic AI systems. As organizations increasingly deploy Generative AI across diverse applications, the challenge of mitigating these threats at an enterprise scale, balancing robust detection with performance and cost, becomes paramount. Traditional security approaches often fall short: rule-based or classical machine learning models are easily bypassed by sophisticated attackers, while highly accurate judge LLMs are prohibitively expensive, slow, and simply do not scale to handle thousands of transactions per second.

Watch on YouTube

Visual summary for Reading the Residual Stream: Productizing Activation-Probe Security at Intuit by Guy Shtar, Guy Elad
Visual summary for Reading the Residual Stream: Productizing Activation-Probe Security at Intuit by Guy Shtar, Guy Elad

Key moments

  1. 0:00 Introduction: Scanning LLM hidden states for threats
  2. 2:40 Five-step process for building the detector
  3. 4:20 Live demo: Detecting attacks in various inputs
  4. 8:40 Productization: Code implementation and hooks
  5. 12:00 Enterprise scale challenges and optimizations
  6. 16:00 Performance results: Recall, FPR, latency, cost
  7. 19:40 Key takeaway: Transferability to commercial models confirmed
  8. 20:50 Q&A: Comparison with Google's Jef model

Reading the Residual Stream: Productizing Activation-Probe Security at Intuit

Speakers: Guy Shtar (AI Security & Safety Architect, GenAI Security, Threat Modeling, and AI-Assisted Risk Assessment, Intuit); Guy Elad (AI Science Tech Lead, AI Security, Intuit)

Conference: [un]prompted II

YouTube: https://www.youtube.com/watch?v=U7xN7Nj7m1o

Overview

Prompt injection and goal hijacking represent some of the most critical security vulnerabilities in modern agentic AI systems. As organizations increasingly deploy Generative AI across diverse applications, the challenge of mitigating these threats at an enterprise scale, balancing robust detection with performance and cost, becomes paramount. Traditional security approaches often fall short: rule-based or classical machine learning models are easily bypassed by sophisticated attackers, while highly accurate judge LLMs are prohibitively expensive, slow, and simply do not scale to handle thousands of transactions per second.

In this talk, Intuit AI security experts Guy Elad and Guy Shtar introduce a groundbreaking approach to AI security, moving beyond scanning prompts to directly analyzing the internal states of Small Language Models (SLMs). Their method, termed activation-probe security, leverages insights from mechanistic interpretability to detect malicious intent within the model's "residual stream" — its hidden states — even before a single token is generated. This allows for detection capabilities akin to a judge LLM but with the latency and cost profile of a classical machine learning model.

The core innovation lies in observing how malicious inputs trigger distinct activation patterns within an SLM's internal layers. By training lightweight probes on these hidden states, Intuit has developed a scalable, efficient, and highly effective detector capable of safeguarding hundreds of Gen AI use cases across various product channels. This talk not only outlines the technical architecture but also delves into the practical productization challenges and the impressive performance metrics achieved at Intuit, providing a blueprint for other enterprises grappling with AI security at scale.

Background

▶ Watch: Introduction: Scanning LLM hidden states for threats (0:00)

The rapid proliferation of Generative AI (Gen AI) within enterprise environments presents a unique set of security challenges, particularly concerning prompt injection and goal hijacking. Intuit, with hundreds of Gen AI use cases already in production across various product channels like assistants and copilots, faces these threats daily. The input modalities are diverse, ranging from short chats to extensive documents, images, and code. A critical requirement for any security solution is the ability to scan every input to the LLM, often needing to process thousands of transactions per second during peak times, all while adhering to strict latency and cost budgets.

Existing mitigation strategies have demonstrated significant limitations. Rule-based models and classical machine learning models are fast and cheap, meeting the operational requirements for latency and cost. However, their reliance on surface-level patterns makes them notoriously easy for attackers to bypass with minor obfuscation or creative phrasing. On the other end of the spectrum, employing judge LLMs for security analysis offers superior semantic and contextual understanding, making them highly effective at identifying sophisticated attacks. Unfortunately, their computational demands translate into high costs, slow inference times, and an inherent inability to scale efficiently for enterprise-wide deployment, rendering them impractical for real-time, high-volume threat detection.

This dilemma led Intuit to a core question: how can they achieve the deep semantic and contextual understanding characteristic of judge LLMs, but with the speed and affordability of classical machine learning models? Their inspiration stemmed from the nascent field of mechanistic interpretability, which seeks to understand the internal workings of neural networks. The hypothesis was simple yet profound: instead of just scanning the input prompt, what if one could "scan the LLM itself"? The idea is that when a benign input (e.g., "Summarize this article in three bullets") is fed into an SLM, the internal activations look "normal." However, a malicious input (e.g., "Ignore all prior instructions and...") would cause a distinctly different set of activations to "light up" inside the model, signaling an attack even before the model generates any output. This insight forms the foundational premise for Intuit's activation-probe security.

Key Findings

▶ Watch: Live demo: Detecting attacks in various inputs (4:20)

Intuit's research and productization efforts yielded several significant findings that underscore the efficacy and practicality of activation-probe security for enterprise-scale AI defense. The primary discovery is the undeniable correlation between malicious inputs and distinct internal activation patterns within Small Language Models (SLMs). This means that attacks like prompt injection can be reliably detected by "reading the residual stream" of an SLM, effectively bypassing the limitations of external prompt analysis.

A critical finding was the ability to achieve judge LLM-level semantic understanding at a cost and latency profile comparable to classical machine learning models. This addresses the fundamental scalability challenge that has plagued robust AI security solutions. Specifically, the system demonstrated a 70% improvement in attack catch rate (recall) compared to Intuit's previous syntactic baseline models. While "not perfect yet," this represents a substantial leap forward in detection capabilities, especially considering the reliance on synthetic attack datasets due to the rarity of real-world attacks.

Furthermore, the solution achieved an exceptionally low false positive rate of 7 out of a million. This metric is crucial for enterprise applications serving real customers, where false alarms can severely degrade user experience and trust. The system's latency was measured at a median of less than 650 milliseconds (P99 slightly lower than 650ms) on a GPU-accelerated P-machine in Amazon, which, while not as fast as traditional machine learning models (<200ms), is entirely feasible for large-scale enterprise deployment. Economically, the approach proved to be immensely beneficial, being 11 times cheaper than using a full judge LLM to achieve similar accuracy results.

Beyond these performance metrics, the research highlighted the importance of nuanced configuration. It was found that the optimal band of layers from which to extract hidden states varies significantly depending on the specific SLM backbone (e.g., Phi, small VLM, Gemma) and even the input modality (text versus image). This necessitates an exploratory phase for each new backbone or modality. Additionally, the last token hidden states were found to be sufficiently rich in information, simplifying the feature extraction process, and logistic regression proved to be an ideal choice for the probe model due to its speed, low cost (a simple dot product), and effective results. Finally, the talk affirmed the transferability of this white-box approach, with evidence suggesting it works effectively with commercial, black-box LLMs as well.

Technical Deep Dive

▶ Watch: Enterprise scale challenges and optimizations (12:00)

The core of Intuit's activation-probe security lies in a five-step process designed to efficiently scan the internal states of a Small Language Model (SLM) for malicious patterns. This methodology is engineered for enterprise scale, prioritizing both accuracy and performance.

  1. Prompt Chunking: Long input prompts are first divided into fixed-size windows, typically 512 tokens in Intuit's implementation. This chunking balances the need to detect short attacks within extensive inputs with latency considerations.
  2. SLM Inference: Each window is then fed into an open-weight SLM. The choice of SLM is flexible, with examples like Gemma or Phi being mentioned. Crucially, this SLM is never fine-tuned for malicious content; it serves as a robust feature extractor.
  3. Hidden State Extraction: From a predefined "band of layers" within the SLM, the last token hidden states are extracted. Extensive experimentation revealed that the optimal layers for extraction vary significantly depending on the specific SLM backbone and even the input modality. For instance, Phi might perform best with deeper layers, while Gemma for text might favor earlier layers, and Gemma for images, later ones. The last token's hidden state was found to compress sufficient information from preceding tokens, simplifying the extraction process.
  4. Logistic Regression Probe: These extracted hidden states are then fed into a logistic regression probe. This probe is a lightweight model, essentially a vector of weights, and it is the only part of the system that is trained. Its simplicity (a dot product operation) contributes significantly to the solution's speed and low cost. The training process for these probes, one per layer, takes only "hours" and requires a modest, representative dataset of benign and malicious examples.
  5. Score Aggregation and Thresholding: Each layer's probe outputs a score. These scores are averaged across the selected layers to reduce noise, yielding a score per window. The maximum score across all windows is then taken as the final detection score for the entire input. This score is compared against an application-specific threshold. This threshold calibration is vital, as different Gen AI use cases have distinct characteristics, data distributions, and risk tolerances.

The implementation details further highlight the system's efficiency. The speaker, Guy Elad, presented a concise code walkthrough, emphasizing several key optimizations:

  • Hook-based Feature Extraction: A capture_in_hook function is registered to run on every forward pass through the SLM layers. This hook selectively captures the activations of the last relevant token for the desired layers, storing them in a dictionary. An early-stopping mechanism (an exception raised) prevents the data from flowing to layers not of interest, further optimizing performance.
  • The score_function: This function orchestrates the detection. It tokenizes the prompt, creates windows, and then runs these windows through the SLM's decoder. Critically, the process stops early after feature extraction, skipping the language head that generates tokens. This is a massive optimization, as the language head's dimensionality can be 30 times larger than the embeddings, significantly reducing computation. The "decoder model" used is specifically designed to generate embeddings, not full language output.
  • Probe Application: The probe object, containing the trained logistic regression weights, is applied to the extracted latent states. The resulting scores are averaged across layers, and the maximal window score is returned as the final maliciousness indicator.

For productization at enterprise scale, Intuit incorporated additional "tricks" to manage latency and cost:

  • Batching: Machines running the detector collect multiple samples over a few milliseconds and process them in a single batch. This significantly increases GPU utilization and efficiency with a minimal latency cost.
  • Application-Specific Thresholds: As mentioned, each of the hundreds of Gen AI agents or use cases has unique input distributions and system prompts. Calibrating a specific detection threshold for each ensures relevance and minimizes false positives.
  • Continuous Retraining: To maintain freshness and relevance against evolving attack vectors, the probes are periodically retrained with updated benign and malicious datasets.

This meticulously engineered approach, combining mechanistic interpretability with robust engineering practices, allows Intuit to deploy a highly effective AI security solution that scales across its vast Gen AI ecosystem.

Demo / Proof of Concept

▶ Watch: Performance results: Recall, FPR, latency, cost (16:00)

The talk included a concise and illustrative demo that visually conveyed the efficacy of Intuit's activation-probe security system. While not a live, interactive demonstration, it effectively showed how the internal scoring mechanism operates in response to different types of inputs.

The demo presented three distinct examples, each showcasing the system's ability to differentiate between benign and malicious content by analyzing the activation scores:

  1. Short Benign Input: The first example involved a simple, harmless input, presumably a standard user query. The visualization displayed the scores generated by the probes across the selected band of layers. As expected, these scores were consistently low. After averaging across layers, the final score for the window was significantly below the application-specific threshold, correctly classifying the input as benign. This demonstrated the system's ability to process legitimate requests without generating false alarms.
  1. Short Jailbreak Input: The second example presented a short, self-contained jailbreak prompt, a classic form of prompt injection. In stark contrast to the benign input, the visualization immediately showed very high scores across the band of layers. The probes' outputs clearly indicated a strong malicious signal. Consequently, the averaged score for this window soared above the predefined threshold, leading the model to correctly flag the input as malicious. This highlighted the system's sensitivity to attack patterns embedded within the SLM's internal states.
  1. Long Input with Embedded Malice: The third and most compelling example showcased the system's handling of longer, more complex inputs. This input was split into three windows as part of the chunking process. Only the second window contained the malicious part of the prompt injection. The demo visually depicted that while the first and third windows produced low, benign scores, the second window exhibited a significantly higher score, indicating the presence of an attack. Since the detection mechanism takes the maximum score across all windows, this elevated score from the second window pushed the overall input's score above the threshold. The system correctly generated an alert and flagged the entire input as malicious, demonstrating its robustness in identifying localized attacks within extensive user inputs.

Through these examples, the demo effectively illustrated how the system "sees" the malicious intent within the SLM's internal activations, providing a clear proof of concept for the activation-probe security approach. It visually reinforced the concept that the model itself "knows" it's an attack, even before generating any output, by exhibiting distinct activation patterns that the logistic regression probes are designed to detect.

Defensive Implications

▶ Watch: Q&A: Comparison with Google's Jef model (20:50)

Intuit's activation-probe security offers a robust and scalable paradigm shift for defending against emerging AI threats, particularly prompt injection and goal hijacking. The defensive implications for enterprises are significant and far-reaching:

  1. Proactive and Semantic Threat Detection: Unlike traditional methods that rely on syntactic patterns or keyword matching, this approach delves into the semantic understanding of the SLM. By analyzing hidden states, defenders can detect malicious intent that is contextually embedded and highly obfuscated, even before the LLM generates any potentially harmful output. This provides a crucial pre-computation defense layer, preventing attacks from ever reaching the main LLM.
  1. Scalability and Cost-Effectiveness: The solution addresses the critical challenge of scaling AI security across an enterprise with hundreds of Gen AI use cases. By utilizing lightweight SLMs and simple logistic regression probes, Intuit has demonstrated that high-fidelity detection can be achieved at a fraction of the cost (11 times cheaper) and with feasible latency (median < 650ms) compared to judge LLMs. This makes advanced AI security economically viable for high-volume, real-time applications.
  1. Enhanced Resilience to Evolving Attacks: The non-fine-tuned nature of the backbone SLM, combined with continuously updated attack datasets for probe retraining, makes the system more resilient to evolving attack vectors. Attackers constantly adapt their prompt injection techniques, but by observing the fundamental shifts in an SLM's internal representation of malicious language, the system is inherently more adaptable than static rule sets.
  1. Application-Specific Tailoring: The emphasis on calibrating detection thresholds per application or agent is a vital defensive strategy. This allows security teams to fine-tune the system's sensitivity based on the specific risk profile, data distribution, and user base of each Gen AI product. A highly sensitive application might have a lower threshold, while a less critical one might tolerate a higher one, optimizing the balance between security and user experience.
  1. Hybrid Security Architectures: While powerful on its own, the activation-probe detector can be integrated into a layered security approach. For instance, it can act as a primary, high-throughput filter, with flagged inputs then cascaded to a judge LLM for secondary, more in-depth analysis. This hybrid model can further improve overall recall while managing costs, ensuring that the most expensive resources are only engaged when truly necessary.
  1. Operational Efficiencies: The productization aspects, such as batching and early stopping, are not just performance optimizations but also defensive enablers. They allow for efficient resource utilization, ensuring that security checks don't become a bottleneck, thereby maintaining the availability and responsiveness of Gen AI services. The automated retraining pipeline ensures that the defense system remains fresh and relevant without constant manual intervention.
  1. Transferability to Commercial Models: The finding that this white-box approach shows transferability to commercial, black-box LLMs is particularly impactful. It suggests that enterprises using proprietary LLMs can still benefit from this detection methodology by using an open-weight SLM as a surrogate for internal state analysis, even if they don't have direct access to the commercial model's internals.

In essence, Intuit's work provides a blueprint for building a scalable, intelligent, and cost-effective defense against complex AI threats, shifting the security perimeter from mere input validation to deep, internal model introspection.

Key Takeaways

  • Scan the Model, Not Just the Prompt: Effective prompt injection and goal hijacking detection can be achieved by analyzing the internal hidden states (activations) of Small Language Models (SLMs), as malicious inputs create distinct, detectable patterns even before token generation.
  • Judge LLM Understanding at ML Cost/Latency: Activation-probe security delivers semantic understanding comparable to expensive judge LLMs, but with the speed and cost efficiency of classical machine learning models, making it viable for enterprise-scale deployment.
  • Enterprise-Ready Optimizations are Crucial: Productization requires techniques like batching, early stopping (skipping the language head), application-specific thresholding, and continuous retraining to manage latency, cost, and maintain relevance across diverse use cases.
  • Rigorous Testing is Paramount: Evaluating AI security models demands using whole, diverse datasets from various sources, not just random samples, and reporting results on every dataset to avoid overlooking blind spots.
  • Trade-offs Exist: Achieving a near-zero false positive rate (e.g., 7 in a million) for customer-facing applications often comes with a trade-off in perfect recall; this balance is a critical decision for security and product teams.
  • Transferability to Commercial LLMs: The principles of activation-probe security show promise for transferability, indicating that this white-box detection method can also be effective in defending against attacks on commercial, black-box LLMs.

About the Speaker(s)

Guy Shtar is an AI Security & Safety Architect at Intuit, specializing in GenAI Security, Threat Modeling, and AI-Assisted Risk Assessment. His work focuses on building robust security frameworks for artificial intelligence systems within the enterprise context.

Guy Elad serves as an AI Science Tech Lead at Intuit, with a focus on AI Security. He is involved in leading scientific and technical initiatives to enhance the security posture of Intuit's AI deployments.

Both Guy Shtar and Guy Elad are integral members of the AI science team at Intuit, contributing their expertise to advance the field of AI security and ensure the safe and responsible deployment of Generative AI technologies.

Reviews

→ Top-rated talks at [un]prompted II 2026 — The AI Security Practitioner Conference

All talks from [un]prompted II 2026 — The AI Security Practitioner Conference