Skip to content

Workflow: a basic LLM pentest (garak + PyRIT + wordlists)

Goal: a first-pass assessment of an AI endpoint. Sweep it with garak and PyRIT (capturing everything through Crucible's proxy), enumerate its endpoints with wordlists, then use an agent over the MCP to triage the flood of prompts into findings, and export a report.

Isolation first. Run this against a mock / test target inside the container, never a real provider. garak and PyRIT fire real requests; pointing them at a live endpoint from the container touches credentials and tips off the target. That is a VM-grade workflow, not this one.

This is a manual workflow: you set up the tools and the proxy by hand; Crucible captures, correlates and reports.

Before you start (manual setup)

  1. Crucible running in its container, proxy on 127.0.0.1:8081.
  2. garak and PyRIT installed in the same container or host as Crucible.
  3. A project: open the Project tab and create one (+ New in the right rail). Findings save into the active project, so it has to exist first.
  4. Persist captures on: check Persist captures to disk on Proxy → Options so the sweep survives a restart and can be retested later.
  5. Crucible's root CA exported so the tools trust the intercepted TLS. On the Cert tab, Save .pem writes root_ca.pem to ~/.local/share/crucible/root_ca.pem on Linux (the CA always lives in the platform data directory; CRUCIBLE_DATA_DIR does not move it). Copy PEM puts it on the clipboard.

Steps

  1. Point garak at the proxy and run it. Set the proxy and CA variables, then run a probe against your mock model:

    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 <your-mock-model> \
      --probes <probe> --generations 1
    
    Every attempt lands in Proxy → History, guardrail-scanned and replayable. See garak + PyRIT integration for the full environment setup and generator notes.

  2. Run PyRIT the same way. Same proxy and SSL_CERT_FILE variables; point your PyRIT PromptTarget's base URL at the mock endpoint. The conversation is captured alongside the garak traffic.

  3. Enumerate endpoints with wordlists. Go to Target → Site Map, right-click the host, and choose Discover endpoints…. Pick a Default wordlist (from the promptlist corpus) or paste one into Custom wordlist (paste), then Run. Hits (2xx, 3xx, 401, 403, 405) land in the Site Map tree. Repeat with other lists to widen coverage; each run uses one list.

  4. Triage the flood with an agent over the MCP. garak and PyRIT generate hundreds of attempts, too many to read by hand. Start the MCP server (Options → MCP server → Start, or launch with CRUCIBLE_MCP=1), connect an agent, and have it:

  5. walk the capture with crucible.history.list and crucible.history.get,
  6. decide which attempts actually got past the guardrail, and
  7. record each real one with crucible.findings.add, passing the record's request_id and an explicit severity and owasp_tags. If the agent omits them, Crucible proposes them from the record's guardrail hits, and a defended or untagged request comes out as Info with no tags.

The findings tools work in the MCP server's default Read-only mode; the attack tools need Write mode. See Drive Crucible from an agent.

  1. Confirm and pin by hand where it matters. Replay anything you want to verify in Craft, and pin it from Proxy → History → right-click → Save as finding or Craft's Mark as finding. Check the severity and OWASP tags in the modal; they are a proposal, not a verdict.

  2. Export the report. On the Project tab, open the findings tile and click Export markdown for a quick paste-into-ticket summary, or open the reports tile → Configure & export… → Export HTML / Export PDF for a polished deliverable. PDF needs headless Chromium or Chrome on PATH; HTML doesn't.

Tips

  • Mock targets only, in the container. Real-provider capture is a separate, VM-grade workflow; see Run against an isolated VM.
  • Getting rate-limited on prompt sweeps you fire from Crucible? Barrage's Rate limit control sends N per second, minute or hour.
  • The MCP step takes the human out of triage, but keep a human on the confirm step: the agent proposes findings; you decide what ships in the report.
  • Retest later. Once the client ships a fix, Retest all findings on the Project tab (or crucible --retest <slug>) re-fires each finding and reports what still reproduces.
  • Start with a local model or synthetic traffic to calibrate before a real engagement.

Troubleshooting

Symptom Cause Fix
garak / PyRIT traffic never shows in History Proxy variables unset, or the tool doesn't trust the CA Export HTTP_PROXY/HTTPS_PROXY=http://127.0.0.1:8081 and point REQUESTS_CA_BUNDLE / SSL_CERT_FILE at the saved root_ca.pem
TLS handshake errors from garak / PyRIT The tool validates against the system trust store, not Crucible's CA Set REQUESTS_CA_BUNDLE (requests-based) and SSL_CERT_FILE (OpenSSL) to the CA PEM from the Cert tab
MCP server won't start The MCP server is Unix/macOS only; it is compiled out on Windows Run Crucible in its Linux/macOS container; start it from Options → MCP server or with CRUCIBLE_MCP=1
Agent's crucible.findings.add writes nothing No active project; findings save into the active one Create or open a project on the Project tab before the triage run
Agent-added findings are all Info with no tags The agent omitted severity and owasp_tags, and the records had no disclosure or unblocked-attack hit Have the agent pass both, or fix them with crucible.findings.update
Discover endpoints… returns no hits The host isn't in the Site Map yet, or nothing has been captured against it Drive one request through the proxy first so the host appears in Target → Site Map, then re-run
Target throttles the sweep (429s) Send rate above the target's limiter Lower --generations or PyRIT concurrency; for Crucible's own sweeps use Barrage's Rate limit
PDF export of the report fails No headless browser on PATH Install chromium or google-chrome; Export markdown and HTML need neither

See also: garak + PyRIT integration · MCP server · Barrage · Engagement report.