Skip to content

Running Crucible in an isolated VM

Crucible is a MITM proxy for LLM traffic. Point it at a real provider endpoint and it sees your API keys, prompts, tool calls, and attack payloads in the clear, and it faithfully forwards them, so the traffic hits the provider (real cost, real upstream audit logs, a possible tip-off to the target). Do real-provider capture only from a dedicated, isolated VM, never your daily-driver host. Against a local model (Ollama) or synthetic fixtures (shipped in the container image only), a normal host is fine.

Why a VM

  • Key + payload exposure. The proxy handles live credentials and attack payloads. A compromised host leaks the whole engagement.
  • CA trust blast radius. To intercept HTTPS you install the Crucible root CA into a client's trust store. Scope that trust to a throwaway VM, not your OS keychain or daily browser.
  • Upstream side effects. Captured traffic really reaches the provider. Isolate the machine (and use provider-side test keys and quota you're willing to burn).
  • Clean teardown. Snapshot before an engagement, revert after, no residue.

VM sizing

Minimum Comfortable
vCPU 2 4
RAM 4 GB 8 GB (16 GB if running a local model)
Disk 10 GB 40 GB (captures + models grow)
OS Debian 12 / Ubuntu 22.04+ same

Give it NAT networking (outbound only) and no shared folders with the host. Snapshot the clean install so you can revert per engagement.

Install & run

Install the .deb as described in Install. From a Crucible source checkout, scripts/install-vm.sh does the same and also pulls the runtime dependencies (GTK libraries, libnss3-tools, sqlite3, firefox-esr) and pre-creates the data dir:

sudo ./scripts/install-vm.sh path/to/crucible_X.Y.Z-1_amd64.deb   # or no argument: newest ./dist/*.deb
crucible                                                          # launch the workbench
  • The proxy binds 127.0.0.1:8081. It's loopback, so the client must run inside the same VM (or tunnel to it).
  • Trust the CA. Export the PEM from the Cert tab (Copy PEM or Save .pem; the tab also shows the SHA-256 fingerprint and per-runtime trust recipes), or from Proxy → Options → Certificate (Copy certificate (PEM)). On Linux the PEM lives at ~/.local/share/crucible/root_ca.pem.
  • Trust it in the client that will carry the traffic. Most AI red-team traffic is SDK / agent / MCP, not browser, so prefer the env-var route the Cert tab prints:
Client Trust the CA via
curl --cacert <root_ca.pem> (per invocation)
Python (httpx, openai, anthropic, stdlib ssl) export SSL_CERT_FILE=<root_ca.pem>
Python requests specifically export REQUESTS_CA_BUNDLE=<root_ca.pem>
Node (axios/fetch, openai, anthropic SDKs) export NODE_EXTRA_CA_CERTS=<root_ca.pem>
Go / Rust (reqwest ≥ 0.12) export SSL_CERT_FILE=<root_ca.pem>
Agent CLIs / MCP-over-stdio export SSL_CERT_FILE=<root_ca.pem>; for an MCP stdio server, prefix the spawn with it
Browser (Firefox) Settings → Privacy & Security → Certificates → Import

Then set that client's HTTPS proxy to http://127.0.0.1:8081. - Prefer synthetic or local traffic first. Proxy → Options → Persistence → Inject synthetic traffic populates History from fixture files with no network at all. The .deb ships no fixtures, so in the VM the button only works once CRUCIBLE_FIXTURES_DIR points at a fixtures directory (for example crates/app/fixtures/synthetic copied from a source checkout); the container image has them built in. A local model (Ollama) is the other way to learn the UI before you spend a real request.

Driving garak / PyRIT through the proxy

The supported way to get garak or PyRIT results into Crucible is proxy capture, not a file import. Run the tool with its HTTP client pointed at the proxy and its TLS trust pointed at the CA, so every probe lands in History:

export HTTPS_PROXY=http://127.0.0.1:8081
export HTTP_PROXY=http://127.0.0.1:8081
export REQUESTS_CA_BUNDLE=<root_ca.pem>   # garak/PyRIT use requests/httpx
export SSL_CERT_FILE=<root_ca.pem>
# …then run garak / PyRIT against your authorised target as usual

Their traffic then shows up in Proxy → History like any other client, ready to scope, inspect, and turn into findings. There is no result-file import in the UI; capture is the path. See Run a basic LLM pentest.

The hard safety rules

  • Never point the proxy at a real provider host from a shared or daily machine. Real-provider capture is a VM-grade workflow, not a container-grade one.
  • Never capture live traffic with the CA trust installed anywhere but the VM's throwaway client.
  • Use synthetic fixtures or a local model (Ollama) for everything you can; escalate to real-endpoint capture only inside the isolated VM.

Data & teardown

Engagement data lives under the data dir, resolved as $CRUCIBLE_DATA_DIR → the platform user-data dir (~/.local/share/crucible on Linux) → /tmp/crucible. That holds projects/ (each project's project.json and captures.sqlite), exports/, payloads/, intruder-runs/, audit/, crucible.log, scope.json and guardrail_rules.json. The root CA (root_ca.pem, root_ca.cer, root_ca.key) always sits in the platform user-data dir, even when CRUCIBLE_DATA_DIR is set. To wipe: revert the VM snapshot, or rm -rf ~/.local/share/crucible (and your CRUCIBLE_DATA_DIR, if you set one).

Troubleshooting

Symptom Cause Fix
Client can't reach 127.0.0.1:8081 Proxy is loopback-only; the client is on the host, not in the VM Run the client inside the VM, or tunnel; the proxy never binds a routable address.
TLS errors / cert warnings from the client CA not trusted by that client's store Trust root_ca.pem via the right env var (table above) or Firefox import; SDKs ignore the OS keychain, so set SSL_CERT_FILE/REQUESTS_CA_BUNDLE/NODE_EXTRA_CA_CERTS.
garak/PyRIT run completes but History is empty Proxy env vars not exported into the tool's process, or its host is out of scope Export HTTP(S)_PROXY + the CA var in the same shell; add the target to Target → Scope.
Looking for a garak/PyRIT import button There isn't one; the flow is proxy capture Route the tool through the proxy (above); there is no result-file import in the UI.
Real requests cost money / alert the target The proxy forwards captured traffic to the real provider Confirm authorisation and test-key quota before capturing; prefer synthetic/local until then.

See also: Install · Cert · Proxy · Basic LLM pentest