SARIF 2.1.0 and GitHub Code Scanning for Refract
How to export Refract findings as SARIF 2.1.0 and publish them to GitHub Code Scanning with record-chain verification and CI gating.
Refract turns AI safety testing from a report into a release gate. refract gate returns a non-zero exit when a scan crosses a threshold you define.
--max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70.The gate should run after a scan and after record-chain verification so the evidence backing the decision is tamper-evident.
refract scan --target $TARGET --battery baseline --sarif refract.sarif
refract verify
refract gate --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
Place a trusted Refract wheel in wheelhouse/ before the install step. See prerelease installation for build instructions.
name: refract-safety-scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install the Refract prerelease wheel
shell: bash
run: |
shopt -s nullglob
wheels=(wheelhouse/refract_eval-*.whl)
if [ "${#wheels[@]}" -ne 1 ]; then
echo "Provide exactly one trusted Refract wheel in wheelhouse/." >&2
exit 1
fi
python -m pip install "${wheels[0]}"
- run: refract scan --target ${{ vars.REFRACT_TARGET }} --battery baseline --sarif refract.sarif
- run: refract verify
- run: refract gate --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
Add github/codeql-action/upload-sarif@v4 so the same findings appear natively in GitHub Code Scanning.
How to export Refract findings as SARIF 2.1.0 and publish them to GitHub Code Scanning with record-chain verification and CI gating.
How Refract uses McNemar's test on paired adversarial and benign verdicts to show whether a prompt or guardrail change really moved the 2×2 matrix.
How Refract detects AI silent breaches, canary leaks that a guardrail misses, using synthetic high-entropy canaries, benign controls, and SARIF 2.1.0 CI gating.