Refract Guides · Practical AI safety testing patterns

AWS Bedrock SigV4 Targets in Refract

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.

Configure credentials

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)"

Run a Bedrock scan

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

Keep secrets out of evidence

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.

Verify and gate

refract verify --db ./runs.sqlite
refract gate --db ./runs.sqlite --max-fn 0 --max-fp-rate 0.05 --min-mcc 0.70
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.