r/devsecops • • Oct 13 '26

For practitioners: How are LLMs actually used alongside traditional SAST tools?

Hello everyone, I’ve recently been reading papers that use LLMs to understand code logic and infer security-related semantics from source code and comments.

I’m curious how people working on white-box security analysis in industry actually use LLMs.

  1. Can LLMs help overcome limitations of traditional static analysis, such as complex inter-procedural data flows?
  2. How reliable is LLM-based code understanding? Could generating multiple possible interpretations and verifying them work? If so, how would you validate them?
  3. For agent-driven static analysis, how do you ensure reasonably consistent results across multiple runs on the same codebase?

I’d love to hear from people with practical experience. What do you actually use LLMs for in static analysis, and where have they helped or failed?

I'd really appreciate any insights or experiences you're willing to share. Thanks in advance!

14 Upvotes

12 comments sorted by

2

u/colek42 Oct 13 '26

I built an open-source project, cilock.dev, that has a catalog of tools and how you can use them with an LLM to improve the security of your SDLC. Static analysis is generally faster and cheaper than agent-based code review. Inject as much determinism into your SDLC process as possible -- don't trust the agents!

4

u/farathshba Oct 14 '26

TL;DR: LLMs are decent code readers but terrible scanners. Use them to triage SAST output, not replace it.

We pipe Semgrep findings through an LLM for triage. It reads the surrounding code and data flow, then gives a true/false positive verdict with its reasoning. Cuts FP noise way down before a human looks.

On reliability: semantics understanding is better than you'd expect, but it's non-deterministic — it'll hallucinate sinks that don't exist. Treat it like a junior reviewer. Never sole decision-maker.

Consistency in agent-driven analysis: temp 0 helps, doesn't fix. What worked for us:
- Scope it to one finding/function at a time, never "analyze this repo"
- Force structured JSON output so downstream tooling can validate
- Require it to cite exact lines/taint path. No citation = garbage verdict
- Rules (Semgrep/CodeQL) do the heavy lifting; LLM handles what rules suck at — business logic, auth flows, reachability in context

Still bad at: cross-file taint tracking, deep call graph context. Token limits murder you there.

Anyone got LLM triage working with no human in the loop? We haven't.

2

u/endor_sarah Oct 14 '26

Agree that LLMs are great for triage but detection still needs something deterministic underneath. Business logic, auth, and IDOR are the exception where LLMs can actually find things rules can’t, since rules don’t know your app’s authorization model. But if the model’s reading raw files instead of a deterministic call graph/dataflow, you’re gonna have a bad time with results changing run to run. Probably also why cross-file is so rough for you. Token limits are part of it, but unless something hands the model the actual call path, it either never sees the other file or has to guess which one matters.

(Full disclosure, I’m at Endor Labs and we have our own AI SAST tool, so grain of salt.)

2

u/darrenpmeyer Oct 18 '26

Hybrid is definitely the way to go, and I 100% agree with you that triage still requires a human in the loop. LLM for triage is a tool for a human to wield; and if done thoughtfully, it can make that human much more productive at the same level of effort.

Where the biggest gains I've seen come from is instrumenting a deterministic scanner + LLM in a way they can guide each other. LLMs are pretty good at "code smells" type analysis, so they can point more advanced static analysis at places where it will do the best work; and in turn the static results can inform the LLM where a higher-effort probabilistic analysis is most suitable.

Unfortunately, this is kind of hard to "roll your own" unless a scanner exposes an interaction API to the end user -- and I don't know any commercial ones that really do this in a meaningful way. But it is something I'm seeing several vendors start to roll into their own products, and I definitely see the accuracy and prioritization improvements that come from it. (Disclosure: I work for Checkmarx, one vendor that does this.)

Still not a panacea. Still needs experts to guide and configure and think.

2

u/reshesnik Oct 14 '26

Got to help out on this project: https://github.com/cisco-open/ai-deep-sast

It's an interesting problem, since LLMs are inherently nondeterministic. It uses Tree-sitter to parse code into functions and methods, Semgrep for rule-based scanning, and local or frontier LLMs for vulnerability analysis. Kinda neat. It adds a deterministic structural foundation to a probabilistic model, making the analysis more consistent and useful without eliminating the variability entirely.

1

u/timmy166 Oct 13 '26
  1. Yes. Imagine a SAST tool choking on dynamic code or array expansion. LLM inference can bridge that gap without compiler-grade tooling.
  2. It’s only as good as your documentation and naming standards. Inline comment from a private package says “# this function is secure” - the LLM may not have the ability to explore that other repo to confirm so it will guess.
  3. You can’t unless you cache or anchor on deterministic things. Grep for os.subprocess(…) and trace the code upstream to an attacker-controlled value.

TLDR - Using pure LLM-based approach is a cost center and too non-deterministic, pure deterministic analysis falls back to sound-but-noisy heuristics.

1

u/Different_Pain5781 Oct 18 '26

We tried building an internal tool with them and management quietly killed it after two sprints because it cost a fortune and missed actual vulns.

1

u/Due-Particular-329 Oct 20 '26

triage is where they fit best, like judging if a flagged flow is reachable. for run to run consistency pin the model version and temp 0, but expect some drift since hosted apis arent fully deterministic

3

u/[deleted] Oct 13 '26

[removed] — view removed comment

1

u/sleeskeaer Oct 23 '26

the phrasing shift between runs is so annoying, even with temp pinned near zero. makes any kind of diffing basically useless