SAST (Static Application Security Testing)
Analysing source code for vulnerabilities without running it.
What is Static Application Security Testing?
SAST reads your source code and looks for security flaws in it without executing anything. It parses each file into a syntax tree, builds a model of how data moves through the program, and reports the places where untrusted input can reach an operation that should not receive it — a SQL query, a shell command, a file path, a deserialiser.
"Static" is the whole trade-off. Because nothing runs, SAST can reach every branch, including the error paths and the code behind a feature flag that nobody has enabled yet. Because nothing runs, it also cannot know which of those branches your deployment actually takes, which is where its false positives come from.
How it works
Modern SAST is a data-flow problem, not a pattern-matching one:
- 01
Parse to a syntax tree
Each file becomes a concrete syntax tree, and the trees are linked into a call graph so the analysis can follow execution across function and file boundaries.
- 02
Trace tainted data
Taint analysis marks every value that originates from outside the program — a request parameter, an environment variable, a file — and follows it forward through assignments, calls and returns to see where it lands.
- 03
Report only the flows that complete
A finding is a *path*: a specific source, a specific sink, and the sequence of assignments between them. Reporting the sink alone is what produces the unreadable output SAST is known for.
Why it matters
SAST catches the whole class of bugs that come from the code you own: injection, path traversal, unsafe deserialisation, hardcoded secrets, weak cryptography. SCA will never find these, because they are not in a dependency, and DAST will only find them on the routes it happens to exercise.
It is also the only technique that works before the code is deployable. A finding at pull-request time is a five-minute change; the same finding after release is an incident, a patch and a disclosure. That is the entire argument for running it in CI.
The reason SAST has a poor reputation is precision, not coverage. A tool that flags every call to a dangerous function will be right occasionally and ignored permanently. What distinguishes a usable SAST engine is how aggressively it discards flows that cannot complete.
What value it adds
Finds flaws in the code you wrote
The bugs that are yours to fix, and the only class no dependency scanner can see.
Runs before anything is deployed
A pull-request gate is the cheapest possible place to catch an injection flaw.
Complete branch coverage
Error handlers, feature-flagged paths, and admin routes get analysed even though no test exercises them.
Evidence, not assertions
A flow with a named source, a named sink and the assignments between them is reviewable. A severity label is not.
Feeds automated remediation
A precise path is specific enough to generate a fix PR against.
How Safeguard uses it
Safeguard's SAST engine builds a call graph per language and runs interprocedural taint analysis over it, so findings arrive as complete source-to-sink paths rather than flagged lines. See Safeguard Code and the auto-fix workflow.
See the flow, not just the line.
Run Safeguard against a repository and get source-to-sink paths you can review in a pull request.
Self-healing security runs on Safeguard.
Your first fix PR is minutes away.
No sales call required, even your agent can complete the purchase over MCP.