By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: depthfirstPublished March 31, 2026

TL;DR: A reinforcement-learning trained security agent reached state-of-the-art pass@8 on EVMBench Detect while running 10 to 30 times cheaper than frontier-model baselines, according to depthfirst. This suggests that specialised post-training can improve vulnerability recall without relying on broader model generality. The practical question is no longer whether agents can audit code, but how teams govern false positives, context limits, and tool scope as detection workloads scale.


At a glance

What this is: Depthfirst describes training a security-focused vulnerability discovery agent with reinforcement learning, showing strong benchmark recall and lower cost than frontier-model baselines.

Why it matters: This matters because AI-assisted code audit workflows are becoming a governance problem as much as a detection problem, especially where agent behaviour, tool access, and verification quality affect identity-adjacent controls and software risk.

By the numbers:

👉 Read depthfirst's analysis of RL-trained vulnerability discovery agents


Context

Reinforcement-learning based vulnerability discovery is moving code security from static scanning toward agentic auditing, where the model must search, reason, and verify inside a live container. The central issue is not whether an agent can produce findings, but whether its search strategy, tool use, and confidence boundaries are governed tightly enough to make those findings dependable.

In identity and software security programmes, this raises a familiar governance question in a new form. An agent that can inspect repositories, compaction summaries, and tool outputs becomes a runtime actor with bounded permissions, which means access design, auditability, and verification discipline matter as much as model quality. The article is a research update, but the control implications are broader than the benchmark itself.


Key questions

Q: How should security teams evaluate AI tools for code vulnerability discovery?

A: Use a fixed vulnerable corpus, repeat each test several times, and score the union of findings as well as the average single-pass result. That approach reveals variance, missed paths, and cost efficiency. A model that looks weak once may be useful when pooled, while a headline score can hide unreliable performance.

Q: When do specialised tools make vulnerability discovery agents worse?

A: Specialised tools become a problem when they narrow the agent's search strategy before it has explored the codebase. If the tool biases the model toward one detection method, the agent may miss classes of flaws that require broader reasoning and manual composition.

Q: What breaks when long-horizon security agents cannot preserve context?

A: The agent loses the thread of the investigation. Missing a prior dependency, trust boundary, or partial finding can cause the system to revisit dead ends, miss vulnerabilities, or produce summaries that no longer match the underlying code state.

Q: How should organisations govern shell-enabled audit agents in practice?

A: Treat them as privileged workloads with explicit scope, logging, and review. The environment should constrain filesystem reach, outbound network behaviour, and command execution, while every action remains traceable enough to support investigation and rollback.


Technical breakdown

How reinforcement learning changes vulnerability detection behavior

Reinforcement learning reshapes the agent from a passive classifier into a policy that selects actions across a search process. In this case, reward is based on detection coverage, so the model is optimised to find more real vulnerabilities over multiple rollouts rather than to produce one perfect answer. That is why pass@k becomes the relevant metric: the system is measured on whether at least one trajectory finds the flaw. This changes the failure mode from single-shot reasoning errors to search quality, rollout diversity, and calibration of recall versus false positives.

Practical implication: Practitioners should evaluate agentic audit systems on multi-rollout coverage and false-positive burden, not on a single response score.

Why context compaction matters in long-horizon agent audits

The article shows that a restricted 32k context window can still support long-running audits if the agent learns to compress state into summaries. Context compaction acts as working memory management, preserving only the information most relevant to the current audit trajectory. That is useful because large codebases and multi-turn investigations quickly exceed practical context limits. The trade-off is that summarisation becomes part of the security control surface: if compaction omits a relevant dependency, trust boundary, or prior finding, the agent may lose the thread and miss the vulnerability entirely.

Practical implication: Treat compaction logic as part of the audit pipeline and test it for information loss on long, multi-file investigations.

Why low-level tools can outperform specialised scanners for agents

Depthfirst argues that exposing only a shell tool helped avoid tunnel vision on static analysis outputs. This is a classic control design issue: higher-level tools can constrain the agent into a narrow detection method, while a lower-level primitive forces it to compose its own approach. For vulnerability discovery, that can improve exploration because the agent can inspect code, run commands, and pivot between hypotheses without inheriting a fixed scanner bias. The downside is larger operational responsibility, because the environment must constrain what the shell can touch and log every action.

Practical implication: Give audit agents the minimum toolset needed for the task and monitor shell-level behaviour as a privileged runtime control.


Threat narrative

Attacker objective: The objective is to improve discovery of high-severity software flaws before they can be exploited, while keeping cost low enough for broad operational use.

  1. Entry occurs when the agent is placed inside a sandboxed repository audit environment with shell access and benchmark-targeted objectives.
  2. Escalation happens through repeated rollouts, compaction, and tool-driven exploration that let the model deepen its search across code paths and identify latent flaws.
  3. Impact is achieved when the agent reliably surfaces real vulnerabilities that previously required more expensive or less specialised detection workflows.

NHI Mgmt Group analysis

Agentic vulnerability discovery is becoming an access-governance problem, not just a model-quality problem. Once an audit agent can inspect code, run commands, and iterate across rollouts, its permissions and tool boundaries become part of the control model. That makes the security posture of the harness as important as the benchmark score, especially when the same agent is later used against production repositories. Practitioners should treat agent audit environments as governed execution zones, not convenience wrappers.

RL-optimised security agents create a named failure mode: detection drift through recall bias. When the reward signal privileges finding more vulnerabilities, the system can drift toward over-reporting and false-positive inflation. That is not a model defect alone; it is a governance issue because downstream teams may start discounting valid findings. The right lesson is that precision and verification need to be engineered alongside recall, or the workflow becomes noisy enough to erode trust. Practitioners should align reward design with operational triage capacity.

Context compaction is the new memory control for long-horizon security agents. The article shows that summarisation can preserve task momentum under a constrained window, but it also introduces an information-loss risk that is easy to miss in conventional model evaluations. In NHI and agentic AI governance terms, compaction is analogous to lifecycle state management: what is retained, dropped, or rewritten changes what the system can prove later. Practitioners should validate summaries as part of the audit trail.

Specialised security agents will increasingly pressure conventional AppSec workflows to separate finding from proving. The post explicitly points to future end-to-end exploitation training, which is the natural boundary between plausible detection and verified vulnerability. That matters because many security teams already struggle to prioritise findings that are not reproducible. A policy for agent-generated findings needs a verification path, an exception path, and clear ownership for each stage. Practitioners should plan for agent output to move from suggestion to evidence.

AI security and NHI governance now intersect at the execution layer of the audit pipeline. Even when the article is about software vulnerability discovery rather than identity, the same governance logic applies to tool access, privilege scoping, and runtime observability. An agent with shell access is a non-human runtime actor, so least privilege and stepwise authorisation remain relevant controls. Practitioners should evaluate these systems as privileged workloads with traceable identity and constrained blast radius.

What this signals

Detection speed is only valuable when remediation speed keeps pace. If AI-assisted discovery improves the rate at which vulnerabilities are found, security programmes still fail when the downstream response path cannot verify and close findings quickly enough. The gap between discovery and remediation is where operational debt accumulates, especially in environments where secrets, credentials, or code paths are reused across pipelines. That is why workflow ownership matters as much as model performance.

Agentic audit tooling will force AppSec teams to formalise evidence standards. Findings produced by autonomous or semi-autonomous systems need a reproducible proof path, otherwise teams will spend more time triaging noise than fixing risk. The most mature programmes will define when an agent can flag, when a human must confirm, and what artefacts prove the issue existed. That governance line will become a normal part of secure development operations.


For practitioners

  • Define the agent's minimum viable toolset Expose only the primitives required for audit work and avoid adding specialised scanners unless they are demonstrably necessary. The article's own results suggest that over-specific tools can bias the search and reduce discovery breadth. Keep shell access tightly scoped and logged.
  • Measure audit systems on pass@k and precision together Do not evaluate security agents on recall alone. Track multi-rollout coverage, false-positive rate, and the effort required to verify each finding, because a high-recall agent can still create operational drag if precision collapses.
  • Treat context compaction as a governed control Test summarisation steps against long, multi-file investigations and compare compressed summaries with source state to detect information loss. If the agent forgets trust boundaries, dependencies, or prior findings, compaction is failing as a security control.
  • Build a verification path before production use Require reproducible evidence for any agent-generated vulnerability finding, including the command sequence or code path that supports it. That separates plausible detection from validated exposure and reduces the chance of noisy findings entering remediation queues.

Key takeaways

  • RL-trained security agents can improve vulnerability discovery, but the real control question is how their search, tooling, and verification are governed.
  • Benchmark gains are only meaningful when teams can separate genuine findings from false-positive inflation and preserve context across long audits.
  • As agentic AppSec matures, privileged execution, reproducible evidence, and verification workflow design become the controls that determine whether the system is operationally usable.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10N/AAgentic security tooling raises tool-use and verification risks central to this research.
NIST AI RMFGOVERNThis work introduces governance issues for AI systems acting in security workflows.
MITRE ATLASTA0003Adversarial AI concepts help frame how audit agents can drift, misreason, or be manipulated.
NIST CSF 2.0PR.AC-4Agent audit environments require scoped access and least privilege for shell-enabled execution.
NIST SP 800-53 Rev 5AC-6Least privilege is relevant where agents receive shell access in controlled audit environments.

Assign clear ownership, auditability, and escalation paths for agent-assisted vulnerability discovery.


Key terms

  • Pass@3: A repeat-evaluation method where the same model is run multiple times and a finding counts if any run detects it. It is useful when outputs vary between runs, because the pooled result can show the model’s practical coverage better than a single score.
  • Context Compaction: Context compaction is the process of summarising or pruning conversation history so a long-running AI session can continue inside a fixed token window. It is useful for continuity, but it can also remove standing instructions, making it a security-sensitive operation in agentic systems.
  • Reward Signal: A reward signal is the scoring feedback used in reinforcement learning to shape what the model learns to do. For security agents, it determines whether the system optimises for recall, precision, or some balance of both, which directly affects operational usefulness.
  • Verification workflow: A verification workflow is the sequence of checks, decision branches, and escalation rules used to approve or reject an onboarding attempt. Strong workflows are configurable by risk and geography, and they preserve an audit trail showing why each identity decision was made.

What's in the full report

depthfirst's full article covers the operational detail this post intentionally leaves for the source:

  • Training setup details for the RL harness, including how thousands of Kubernetes sandboxes were orchestrated
  • Benchmark methodology for EVMBench Detect, including pass@k scoring and rollout aggregation
  • Comparative cost and token-usage analysis across pass@1 to pass@8 rollouts
  • The authors' discussion of precision-recall trade-offs and the planned next step of end-to-end verification

👉 The full depthfirst article covers the training harness, benchmark design, and cost-performance analysis in detail.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps practitioners connect runtime access controls and lifecycle governance to the broader security programme.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 21, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org