r/devsecops • u/Puzzleheaded_Trip374 • 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.
- Can LLMs help overcome limitations of traditional static analysis, such as complex inter-procedural data flows?
- How reliable is LLM-based code understanding? Could generating multiple possible interpretations and verifying them work? If so, how would you validate them?
- 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
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/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
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