
Capsule Security and NVIDIA collaborated to solve the rogue AI agent threat by engineering specialized Small Language Models (SLMs) for real-time intent security detection. By fine-tuning NVIDIA Nemotron architectures, this solution achieves inline, ultra-low latency interception of unauthorized agent actions before damage occurs. Discover how domain-specialized models deliver up to 96.9% accuracy and sub-200ms response times to keep autonomous enterprise workflows secure.

By Elnatan Revital, Bar Kaduri, Lidan Hazout from Capsule Security, in collaboration with Amit Bleiweiss, Gal Mizan, Shiri Hochhauser from NVIDIA
AI agents are rapidly moving beyond simple chat interactions and into environments where they can modify code, access databases, interact with infrastructure, and execute actions autonomously. This new level of capability creates a new category of intent security risk: agents that take actions outside their intended scope.
These failures don't require a malicious actor. An agent can misinterpret instructions, bypass approval workflows, overstep operational boundaries, or independently decide that a risky action is the "best" way to accomplish its goal. When this happens, the result can be just as damaging as a traditional security incident. Recent events have shown that this risk is no longer theoretical:

These incidents illustrate a common pattern: agents deviating from their intended role and taking actions that humans never explicitly authorized. Preventing these failures requires evaluating agent behavior as it happens - before a tool call is executed, not after the damage is done. However, real-time protection introduces a new challenge: latency. Sending every action to a large frontier model for intent security review is often too slow and too expensive to sit inline with agent execution.
A detector is only as good as the boundary it learns. To build a high-precision, low-latency detection mechanism, our pipeline is built to teach the model precisely where acceptable behavior ends and a violation begins. We established a rigorous methodology:

Our journey to the ultimate rogue-agent detector happened in two distinct phases, allowing us to deeply explore the tradeoff between size, speed, and architectural efficiency.
We began by selecting the NVIDIA Nemotron-3-Nano-4B-BF16 (an open hybrid Mamba-2 + Transformer + MLP architecture) as our initial base model. We prioritized this because Nemotron models are cost-effective and built for fast inference. In the critical path of inline agent interception, every millisecond counts.
The results were phenomenal. On an AWS ml.g5.2xlarge (A10G) instance, the fine-tuned 4B model achieved 93.8% accuracy, significantly outperforming larger models. In production security environments, alert fatigue is a dealbreaker. We fixed precision at a strict floor of ≥95% and measured recall. The 4B model achieved 97.3% recall, while the next-best competitor caught only 16.8%.

Following this success, We tried to push the results even higher and applied our pipeline to the flagship model NVIDIA Nemotron-3-Nano-30B-A3B - a hybrid Mamba-2 + Transformer Mixture-of-Experts (MoE) architecture. Although the model loads 31.6 billion parameters in memory, its MoE design activates only ~3.2 billion per token (the "A3B"). Leveraging this efficient architecture, we followed NVIDIA's LoRA fine-tuning approach for Nemotron-3-Nano to specialize the model. This combination delivered the reasoning quality of a 30B-class model while maintaining the per-token compute and latency profile of a ~3B model.
The benchmark results were astounding. The 30B-A3B model achieved a 96.9% accuracy and a 0.994 ROC-AUC, extending our lead to +10.9 points over the best third-party model tested.

The following graph shows the accuracy and performance metrics across the evaluated detection models:

For context, the graph compares our specialized LoRA fine-tuned models against various off-the-shelf close and open-weight models. These other models were evaluated in their base, non-fine-tuned state to demonstrate the significant performance gains achieved specifically through our domain-specific training and specialization.
Beating best in class accuracy is only half the job; to run inline at enterprise scale, the detector must be cheap to serve. Following NVIDIA's recommended recipe, we quantized the fine-tuned Nemotron-3-Nano-30B detector to FP8, nearly halving its memory footprint (from 63 GB to 32 GB) with no measurable loss in quality.
This efficiency completely changes where the detector can run. While full precision demands a flagship H100, the FP8 model fits comfortably on a cost-efficient, widely-available L40S (48 GB) GPU. Running on the L40S, it serves at a median 205ms per decision, well inside the 500 ms inline budget.
We also tested the smaller Nemotron-3-Nano-4B variant on the same L40S, achieving even faster times - 71 ms median (roughly 3× quicker) at 93.9% accuracy. On identical hardware, that gives a clean speed-vs-accuracy dial: Nemotron-3-Nano-30B for peak accuracy, and Nemotron-3-Nano-4B for maximum throughput - both well within the 500 ms inline budget.

The choice between these two architectures represents a strategic trade-off based on deployment constraints. The Nemotron-3-Nano-4B model is ideal for environments prioritizing an extremely low memory footprint and maximum cost-efficiency. In contrast, the Nemotron-3-Nano-30B-A3B model offers superior reasoning capabilities and higher performance, making it the preferred choice for complex intent security analysis where the higher memory overhead is acceptable.

To test our detector against an independent benchmark, we evaluated it on StepShield, a public benchmark for step-level rogue-agent detection (released under CC-BY-4.0): Its held-out evaluation set contains 216 agent trajectories - 108 rogue and 108 clean - built from incident templates that never appear in training, spanning six violation categories (data exfiltration, privilege escalation, resource hijacking, supply-chain, destructive actions, and covert persistence) across three severity levels.
StepShield's key contribution is treating detection timeliness as a first-class metric via EIR (Early Intervention Rate): among trajectories a detector catches, the fraction it flags at the divergence step or within k=3 steps after - penalizing "Forensics Trap" monitors that fire indiscriminately on benign prefix code.
We tested our models on the same in-domain protocol behind StepShield's published numbers, scored with their own EIR implementation. Against all four of their reported baselines:

*StepShield benchmark by Gloria Felicia et al. (2026), used under [CC BY 4.0]
Source: stepShield
Baseline figures (GPT-4.1-mini, StaticGuard, HybridGuard, ConstraintGuard) are as reported by the authors.*
Our 30B detector leads on all three axes: it catches 99% of rogue trajectories, false positives on under 1% of clean runs (~6× better than the strongest baseline), and - critically - flags the violation at the exact step it occurs (median intervention gap of 0 steps), giving the highest early-intervention rate on the board.
By leveraging the NVIDIA Nemotron architecture across both the highly efficient 4B and the powerful 30B MoE models, we've demonstrated that specialized Small Language Models (SLMs) are the key to safely scaling trusted agentic workflows across the enterprise. Moving beyond general-purpose models to specialized, efficient detectors allows organizations to secure their agentic workflows without sacrificing speed, cost, or performance.
On this page
Section heading
Capsule adds real-time prevention at the Amazon Bedrock AgentCore gateway, using agent context and policy to evaluate requests before they reach their targets. Learn how it blocks risky actions across tools, models and other agents while working alongside AWS’s existing controls.