By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: SemgrepPublished November 4, 2025

TL;DR: AI-based code review can flag weaknesses with high confidence but still miss whether an issue is actually exploitable, as Semgrep illustrates with a Host header injection finding that did not survive real-world OAuth and proxy constraints. The operational risk is not the alert itself, but the lack of policy context that separates weakness from reachability and keeps security backlogs credible.


At a glance

What this is: This is an analysis of how AI-assisted code review can overstate risk when it lacks exploit context, using a Host header injection example to show the gap between vulnerable and actually exploitable.

Why it matters: For IAM and security teams, the same context problem appears whenever identity-related code paths, OAuth flows, or access controls are judged without understanding the surrounding trust boundaries and enforcement layers.

👉 Read Semgrep's analysis of AI code review false positives and exploitability context


Context

AI-assisted security review is useful only when it understands the environment around the code, not just the pattern inside it. In identity-heavy workflows such as OAuth redirects, host validation, and callback handling, a weakness can exist on paper without creating a realistic path to account takeover or token theft. That distinction matters because security teams need exploitable risk, not just a list of suspicious findings.

This article is really about governance of security signal quality. When tools cannot distinguish vulnerable from reachable or exploitable, they create noise that drains engineering time and weakens trust in the review process. That is especially relevant to identity and access programmes, where false positives around authentication and redirection logic can obscure the issues that actually expand attack surface.


Key questions

Q: How should security teams decide whether an identity-related code finding is actually exploitable?

A: Treat exploitability as a validation step, not a label assigned by the scanner. A finding should be considered actionable only when the attacker can preserve control through the real deployment path, cross a trust boundary, and produce an outcome that matters to authentication, session handling, or access control. If those conditions are absent, downgrade the issue.

Q: Why do AI code reviewers create so many false positives in authentication and redirect logic?

A: They are strong at pattern recognition but weak at environment reasoning. Authentication and redirect issues depend on proxies, host allowlists, browser behaviour, and deployment-specific constraints, so a suspicious code pattern can look severe even when the attack chain fails in practice. The result is noisy triage unless policy adds context.

Q: What do security teams get wrong about vulnerabilities that are not reachable?

A: They often treat a theoretical weakness as a production risk without checking whether the attacker can actually drive the input through the live system. Reachability matters because it tells you whether the flaw sits inside an active trust boundary or only in a code path that surrounding controls already neutralise. That distinction should drive severity.

Q: How can organisations reduce false-positive fatigue in AI-assisted security review?

A: Use explicit policy gates for exploitability, route low-confidence findings out of critical queues, and require human review for identity-sensitive flows such as OAuth callbacks and host validation. The goal is not fewer findings overall, but fewer findings that waste engineering time without changing security exposure.


Technical breakdown

Vulnerable versus exploitable in identity-related code paths

A code path can contain a weakness without exposing a practical attack route. In this example, host header handling appeared to influence OAuth redirect logic, which looks dangerous in isolation. But exploitation depends on whether upstream infrastructure accepts hostile host values, whether browsers will follow the redirect chain, and whether the surrounding deployment actually permits the attacker-controlled inputs to survive long enough to matter. Security review that ignores these environmental checks confuses static weakness with live exposure.

Practical implication: require exploitability validation before escalating identity-related findings to incident-level severity.

Why context is a control in secure software delivery

Context is not a soft concern, it is a control boundary. Reverse proxies, load balancers, browser behaviour, and application-level allowlists all shape whether a finding is reachable. In modern delivery pipelines, AI review tools and SAST engines can surface weak patterns rapidly, but only policy and runtime context tell you whether those patterns map to a real security outcome. Without that layer, teams optimise for ticket volume instead of risk reduction.

Practical implication: encode deployment context and validation rules into review workflows so noisy findings are filtered before backlog creation.

Policy tuning for AI code reviewers and SAST

The practical gap is often not detection, but decision criteria. AI reviewers are good at pattern recognition, yet they struggle when the rule needs to encode business logic, trust assumptions, or deployment-specific constraints. That is why custom policies matter: they let teams decide which weaknesses are genuinely exploitable in their environment and which are only theoretically unsafe. In identity workflows, that includes redirect handling, callback validation, session boundaries, and trusted host enforcement.

Practical implication: tune AI review policies around exploitability thresholds, not generic vulnerability labels.


NHI Mgmt Group analysis

Context collapse is the core failure mode here. The finding looked severe because it matched a known vulnerability pattern, but the surrounding controls made the exploit chain non-viable. That is a governance problem, not just a tooling quirk, because review systems that cannot model runtime constraints will repeatedly surface non-actionable risk. For IAM and software teams, the lesson is to treat environmental trust assumptions as part of the control, not as afterthoughts.

Exploitability is now a policy question, not only a technical one. Security programmes have to decide what qualifies as actionable before the finding is filed. That requires explicit criteria for reachability, privilege boundary crossing, and whether user-controlled input can survive proxies and platform enforcement. In practice, teams need a shared definition of exploitable so engineering, AppSec, and IAM do not argue over severity after the fact.

AI security tooling needs the same governance discipline as identity tooling. Just as identity programmes fail when they over-trust signals without lifecycle context, AI review fails when it over-trusts pattern matching without environment context. The named concept here is exploitability context gap: the difference between a code weakness and a real attack path when deployment, protocol, and trust boundaries are ignored. Practitioners should make that gap visible in policy, triage, and escalation rules.

False positives are a credibility risk, not just an efficiency problem. When teams repeatedly receive dramatic but non-actionable findings, they stop engaging with security review at all. That outcome weakens both application security and identity governance because the same people who validate redirects, session flow, and authentication boundaries are trained to ignore the alert stream. The operational conclusion is straightforward: trust in review tooling must be earned through precision.

What this signals

AI-assisted review will keep getting more useful, but only if teams stop measuring success by how many critical findings the tool emits. The real signal is how often a finding survives exploitability review once deployment context, proxy behaviour, and identity trust boundaries are applied. That pushes AppSec and IAM toward shared triage criteria instead of separate interpretations of the same issue.

Exploitability context gap: this is the programme risk to watch. If your review stack cannot distinguish theoretical weakness from viable attack path, your backlog becomes a credibility problem and your remediation effort becomes misallocated. Teams should align scanner policy, manual triage, and identity flow review around one question: can the attacker actually carry the input through the environment and cause harm?

For identity programmes, the governance lesson is bigger than one AI reviewer. OAuth, redirects, and callback handling sit at the intersection of application security and access management, so false precision in one layer can obscure real control failures in another. That is why teams should connect review tooling to identity governance controls, not treat it as a standalone AppSec concern.


For practitioners

  • Define exploitability thresholds for identity-adjacent findings Require every OAuth, redirect, and host validation finding to include the exact conditions under which it becomes reachable, including proxy behaviour and allowed host handling. Route findings below that threshold to advisory status instead of critical backlog items.
  • Add deployment context to review policies Teach AI reviewers and SAST rules about reverse proxies, load balancers, browser constraints, and trusted host allowlists so they can distinguish theoretical weakness from environment-specific exposure. This prevents findings from being escalated without evidence of a viable attack path.
  • Triage identity flow findings with engineering and IAM jointly Review callback, redirect, and session-related issues with both application security and identity stakeholders present. That joint review helps separate real authentication risk from code patterns that only look dangerous outside the deployment context.
  • Measure false-positive pressure as a governance signal Track the share of critical findings that are downgraded after exploitability review, and use that rate to tune policies. A rising downgrade rate usually means the tool is detecting patterns faster than the programme can separate risk from noise.

Key takeaways

  • A code finding is not the same thing as an exploitable security issue, especially in identity-related flows where proxies and browser behaviour change the attack path.
  • False positives damage more than efficiency because they erode trust in security review, slow engineering response, and hide the issues that truly affect access control.
  • Teams need explicit exploitability policies, joint AppSec and IAM triage, and context-aware tooling if they want AI-assisted review to improve security rather than inflate noise.

Standards & Framework Alignment

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

NIST CSF 2.0, NIST SP 800-53 Rev 5, CIS Controls v8 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.AC-4Identity and access decisions depend on whether control paths are actually reachable.
NIST SP 800-53 Rev 5SI-4Security monitoring must filter noise so analysts can focus on material risk.
CIS Controls v8CIS-16 , Application Software SecurityAI-assisted code review sits inside application security governance and triage.
NIST Zero Trust (SP 800-207)Zero Trust thinking reinforces validation of trust boundaries before actioning findings.

Use SI-4 review logic to prioritise findings that indicate a viable attack path, not just a suspicious pattern.


Key terms

  • Exploitability: Exploitability is the degree to which a weakness can be used to cause real harm in the live environment. A finding may be technically vulnerable but not exploitable if surrounding controls, protocol behaviour, or deployment constraints prevent an attacker from turning it into an actual attack path.
  • Reachability analysis: Reachability analysis checks whether a vulnerability can actually be exploited in the application’s real code paths and dependency graph. It helps teams distinguish theoretical findings from issues that an attacker can reach, which makes prioritisation far more accurate for both AppSec and identity risk management.
  • False Positive: A false positive is a scanner result that looks like a secret but is not actually sensitive. In secret governance, false positives matter because they consume analyst time, weaken trust in alerts, and can delay response to the findings that truly change exposure and access risk.
  • Exploitability context: Exploitability context is the evidence used to decide whether a vulnerability matters in a specific environment. It includes reachability, code path exposure, compensating controls, and product-specific advisories, and it turns raw scan data into a decision that can be defended.

What's in the full article

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

  • How the AI reviewer reasoned through the Host header injection pattern and where its conclusion broke down.
  • Why OAuth redirect handling, reverse proxies, and browser constraints changed the real exploitability outcome.
  • The practical tuning approach for custom rules and policies that reduce critical false positives.
  • How Semgrep positions inline remediation and policy iteration for teams using AI-assisted review.

👉 Semgrep's full post covers the Host header example, the context gap, and how teams can tune findings.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, identity lifecycle, secrets management, and workload identity. It helps security practitioners build the control discipline needed to separate real access risk from noisy findings.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org