Refract Gate in CI: Thresholds That Block Releases
How to gate AI releases with refract gate thresholds for silent breaches, false-positive rate, and MCC, plus a minimal GitHub Actions workflow.
The openai-compatible target lets Refract test the same guardrail path your application uses, including private gateways and self-hosted OpenAI-compatible servers.
Put the model name after openai_compat:. Refract calls https://api.openai.com/v1 unless --base-url (or OPENAI_BASE_URL) points at a gateway or self-hosted server.
openai_compat:gpt-6.2-astra
export OPENAI_API_KEY=...
# Self-hosted servers without auth: leave OPENAI_API_KEY unset.
refract scan --target openai_compat:gpt-6.2-astra --pack ./packs/prompt-injection-basic.jsonl --db ./runs.sqlite --sarif refract-openai-compatible.sarif
# The same pack through a private gateway:
refract scan --target openai_compat:gpt-6.2-astra --base-url https://llm-gateway.example/v1 --pack ./packs/prompt-injection-basic.jsonl --db ./runs.sqlite
The key is read from OPENAI_API_KEY (or --api-key), sent as a bearer token, and never written into the record chain, SARIF output, or matrix tables.
refract gate --scan scan-a1b2c3d4 --db ./runs.sqlite --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
How to gate AI releases with refract gate thresholds for silent breaches, false-positive rate, and MCC, plus a minimal GitHub Actions workflow.
How to run Refract scans against AWS Bedrock with SigV4 credential resolution, without logging or storing secrets in the record chain or SARIF output.
How to export Refract findings as SARIF 2.1.0 and publish them to GitHub Code Scanning with record-chain verification and CI gating.