Refract Guides · Connect a target

GCP Vertex AI Targets in Refract

Refract reaches Google's frontier Gemini models two ways: the built-in gemini target with a Gemini API key, or Vertex AI's OpenAI-compatible endpoint with a short-lived gcloud token. Neither credential enters scan evidence.

Target string

There is no separate vertexai: target. Use gemini: for the Gemini API, or openai_compat: with the Vertex AI OpenAI-compatible URL.

gemini:gemini-4-carbon
openai_compat:google/<model-id> --base-url https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/endpoints/openapi

Configure credentials

# Gemini API
export GEMINI_API_KEY=...
# Vertex AI: a short-lived access token from your gcloud login or service account
export OPENAI_API_KEY="$(gcloud auth print-access-token)"

Run a scan

refract scan --target gemini:gemini-4-carbon --pack ./packs/finance-canaries.jsonl --db ./runs.sqlite --sarif refract-gemini.sarif
refract scan --target openai_compat:google/<model-id> --base-url https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/endpoints/openapi --pack ./packs/finance-canaries.jsonl --db ./runs.sqlite --sarif refract-vertex.sarif

Keep secrets out of evidence

Refract sends the API key (x-goog-api-key) or access token (bearer header) on each request and never copies either into run evidence.

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.