Skip to content

Route garak and PyRIT through Crucible

Crucible captures, scores, and stores the traffic from external AI red-team tools. Point garak or PyRIT at Crucible's proxy and every prompt and response it fires is parsed, guardrail-scanned, written to Proxy → History, and replayable in Craft, with no changes to the tool. From there you triage the run in the UI or hand it to an agent over the MCP server.

Isolation rule. Do this against mock / test targets inside the container only. garak and PyRIT fire real requests; routing a tool at a real provider is a VM-grade workflow, not this one. See Run against an isolated VM.

The mechanism is standard proxy environment variables plus CA trust. Both tools honour HTTP_PROXY/HTTPS_PROXY; the only wrinkle is making the tool trust the CA Crucible uses to terminate TLS, so the intercepted HTTPS handshake succeeds.

What you need

  • Crucible running, proxy on 127.0.0.1:8081.
  • Crucible's root CA as a PEM file. On the Cert tab, Save .pem writes it to ~/.local/share/crucible/root_ca.pem on Linux (~/Library/Application Support/ai.crucible.crucible/root_ca.pem on macOS). The CA always lives in the platform data directory, even when CRUCIBLE_DATA_DIR points projects elsewhere. Copy PEM puts the same text on the clipboard.
  • garak and/or PyRIT installed in the same container or host as Crucible, so 127.0.0.1:8081 is reachable.
  • An active project with Persist captures to disk on (Proxy → Options) if you want the run to survive a restart or be retested later.

garak (NVIDIA)

garak's OpenAI/REST generators read the standard proxy variables. Set the CA for whichever HTTP stack the generator uses: requests reads REQUESTS_CA_BUNDLE, openai/httpx read SSL_CERT_FILE. Setting both covers either:

export HTTP_PROXY=http://127.0.0.1:8081
export HTTPS_PROXY=http://127.0.0.1:8081
export REQUESTS_CA_BUNDLE="$HOME/.local/share/crucible/root_ca.pem"
export SSL_CERT_FILE="$HOME/.local/share/crucible/root_ca.pem"

python -m garak --model_type openai --model_name <mock-model> \
  --probes <probe> --generations 1

Point --model_name (and the generator's base URL, if it takes one) at your mock endpoint. Each attempt garak sends lands in History, guardrail-scanned; right-click one to send it to Craft for replay, or Save as finding to keep it.

PyRIT (Microsoft)

PyRIT targets built on httpx/requests pick up the same variables:

export HTTP_PROXY=http://127.0.0.1:8081
export HTTPS_PROXY=http://127.0.0.1:8081
export SSL_CERT_FILE="$HOME/.local/share/crucible/root_ca.pem"
# then run your orchestrator script

Point the PyRIT PromptTarget's base URL at your mock endpoint. Crucible captures the whole conversation as it runs.

Triage the run

A single garak probe or PyRIT orchestrator can fire hundreds of attempts, more than you want to read by hand. Two ways to work through them:

  • In the UI: use the History filter. host:<mock-host> narrows to the run; add -has:hits to see the attempts no guardrail detector fired on (no refusal, no block, no disclosure), which are the candidate bypasses, or has:hits to read the ones that tripped something. The Guard column shows one marker per detection (up to five, then +N). Open a row to see which detector fired: a refusal means the model held, a disclosure (system prompt, secret, tool schema) is a finding. See Key concepts → Judge.
  • With an agent: start the MCP server and let the agent walk the capture with crucible.history.list / crucible.history.get, decide which attempts got past the guardrail, and record each with crucible.findings.add. Have it pass severity and owasp_tags; otherwise Crucible proposes them from the record's guardrail hits, and anything without a disclosure or unblocked-attack hit is saved as Info with no tags. This is the basic pentest workflow.

Importing a finished run (not in the UI)

The source tree has a parser for garak's garak.<uuid>.report.jsonl and PyRIT's JSON memory export, intended to turn a completed run into normalised attempts without the proxy in the loop. The app does not use it: there is no import button or command. Use the proxy-capture flow above.

Troubleshooting

Symptom Cause Fix
Nothing from the tool appears in History Proxy variables unset, or the run targets a host outside scope Export HTTP_PROXY/HTTPS_PROXY=http://127.0.0.1:8081; check the host is in Target → Scope
SSLError / CERTIFICATE_VERIFY_FAILED from the tool The tool validates against the system trust store, not Crucible's CA Point REQUESTS_CA_BUNDLE (requests) and SSL_CERT_FILE (openai/httpx/OpenSSL) at the saved root_ca.pem
No root_ca.pem under $CRUCIBLE_DATA_DIR The CA is stored in the platform data directory, not the configured data directory Use ~/.local/share/crucible/root_ca.pem (Linux), or Save .pem on the Cert tab and use the path in its tooltip
Connection refused on 127.0.0.1:8081 The tool runs outside Crucible's container or host Run the tool in the same container or host, or route to the proxy's reachable address
Attempts captured but bodies look empty Streaming responses still in flight, or a provider shape Crucible doesn't parse Let the run finish; check the provider is one Crucible parses (see providers)
Real API cost or rate-limit errors The tool reached a real provider, not a mock Stop. Real-provider capture is VM-grade; point the tool at a mock endpoint

See also: Isolated VM setup · Basic pentest workflow · MCP server · Cert tab.