SARIF — the Static Analysis Results Interchange Format — is a JSON format for the output of static analysis tools. It exists so that a linter, a compiler, a SAST scanner and a dependency auditor can all emit their findings in one shape, and so that a single viewer, dashboard or CI gate can read all of them without knowing which tool produced the file.
SARIF is an OASIS Open standard. Version 2.1.0 was approved as an OASIS Standard on 27 March 2020, and the current published text is SARIF Version 2.1.0 plus Errata 01, dated 28 August 2023. Everything on this site refers to that version.
The shape of a SARIF file. A file is one sarifLog object.
It holds a runs array; each run describes the tool
that produced it and carries a results array. A result is one
finding — the unit that everything else in the format exists to describe.
{
"version": "2.1.0",
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
"runs": [
{
"tool": {
"driver": {
"name": "ExampleScanner",
"informationUri": "https://example.com/scanner",
"rules": [
{
"id": "EX1001",
"shortDescription": { "text": "Unused local variable." }
}
]
}
},
"results": [
{
"ruleId": "EX1001",
"level": "warning",
"message": { "text": "The local variable 'count' is never read." },
"locations": [
{
"physicalLocation": {
"artifactLocation": { "uri": "src/parser.c" },
"region": { "startLine": 42, "startColumn": 7 }
}
}
]
}
]
}
]
}
That is a complete, valid SARIF log. The only property the specification requires on a
result is message; everything else — rule identity,
severity, location, fingerprints, fix suggestions — is optional and additive.
See the result object for the full property set.
Specification and documentation
The normative text is published by OASIS and is free to read.
SARIF v2.1.0 + Errata 01
The OASIS Standard, in full. The result object is §3.27.
JSON schema
The normative schema, as published by OASIS alongside the specification.
oasis-tcs/sarif-spec
The technical committee's repository — issues, drafts and work toward 2.2.0.
OASIS SARIF TC
The committee itself: membership, meeting records and mailing lists.
Tools and libraries
Libraries for producing, consuming and checking SARIF files. These are third-party projects; this site does not maintain any of them.
sarif-sdk
C#/.NET object model, converters from other tool formats, and the Sarif.Multitool command-line tool.
sarif-tools
Python command line for summarising, diffing and converting SARIF files. Source at microsoft/sarif-tools.
Sarif.Sdk
The NuGet package for reading and writing SARIF from .NET code.
GCC -fdiagnostics-format=sarif
GCC emits its diagnostics as SARIF directly, and ships sarif-replay
to render a SARIF file back as compiler-style output.
Viewers
SARIF is JSON, so any text editor will open it. These render it as findings instead.
VS Code SARIF Viewer
Lists results and maps them onto the source. Source at sarif-vscode-extension.
Visual Studio extension
Loads SARIF into the Visual Studio Error List with result details and source overlays.
sarif-web-component
A React component for rendering SARIF in a web page.
GitHub code scanning
Ingests SARIF 2.1.0 and renders results as code-scanning alerts. It applies extra requirements beyond the standard.