Refract Guides · Connect a target

Azure OpenAI Entra ID Targets in Refract

Azure OpenAI's v1 API speaks the OpenAI protocol, so Refract's openai_compat target can test your deployment with an API key or a short-lived Entra ID token, and neither ever enters Refract evidence.

Target string

Put your deployment name after openai_compat: and the resource's v1 endpoint in --base-url.

openai_compat:<deployment-name> --base-url https://<resource>.openai.azure.com/openai/v1

Configure credentials

# API key, sent as a bearer token:
export OPENAI_API_KEY="$AZURE_OPENAI_API_KEY"
# Or a short-lived Entra ID token instead of a key:
export OPENAI_API_KEY="$(az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken -o tsv)"

Run a scan

refract scan --target openai_compat:<deployment-name> --base-url https://<resource>.openai.azure.com/openai/v1 --pack ./packs/pii-phi-canaries.jsonl --db ./runs.sqlite --sarif refract-azure.sarif

Keep secrets out of evidence

Refract sends the key or token as a bearer header on each request and never stores it in the record chain or SARIF report.

Verify and gate

refract gate --scan scan-a1b2c3d4 --db ./runs.sqlite --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
Related

AWS Bedrock SigV4 Targets in Refract

How to run Refract scans against AWS Bedrock with SigV4 credential resolution, without logging or storing secrets in the record chain or SARIF output.

Related

Silent Breach Detection with Refract

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.