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.
Refract calls the Bedrock Converse API and SigV4-signs every request with the AWS keys in your environment, pure Python, no boto3, and secrets never enter scan evidence.
Refract reads AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, the optional AWS_SESSION_TOKEN and AWS_REGION (default us-east-1) from the environment. It does not read ~/.aws profiles, SSO caches or instance roles, so export temporary credentials first. A Bedrock API key in AWS_BEARER_TOKEN_BEDROCK also works and skips SigV4.
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=... # only for temporary SSO or role credentials
export AWS_REGION=us-east-1
# From an SSO or role profile instead:
eval "$(aws configure export-credentials --format env)"
Put the Bedrock model ID after bedrock: (short for bedrock_compat:).
refract scan --target bedrock:anthropic.claude-opus-5-5 --battery baseline --concurrency 4 --db ./runs.sqlite --sarif refract-bedrock.sarif
Refract records the prompts, responses and verdicts behind the 2×2 table. AWS keys and request signatures are never written to the record chain or SARIF output.
refract verify --db ./runs.sqlite
refract gate --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 export Refract findings as SARIF 2.1.0 and publish them to GitHub Code Scanning with record-chain verification and CI gating.
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.