How garak scans IBM watsonx models through its WatsonX generator
If your organization has standardized on IBM watsonx, the question is usually not whether to test its models but who should test them. An independent vulnerability scan needs a tool that sits outside the platform team's own build, and garak fits that role. garak includes a WatsonXGenerator that interfaces with IBM watsonx models and systems, so the scan can send the same probe library used for other models to a watsonx-hosted model and record how it responds. garak is a command-line tool installed from PyPI, and the PyPI package requires Python 3.11 or newer. The scan runs from a host you control, in your own environment, so prompts, responses and reports stay with your team rather than passing through a third-party scanning service.
The generator covers the model call. It sends probe prompts to the watsonx endpoint, receives completions and passes them to garak's detectors, which decide whether an attempt produced undesirable output. It does not decide what your deployment is allowed to do. Guardrails, system prompts, retrieval pipelines, tool permissions and any application layer that sits in front of the model are outside the generator's view unless you scan the application itself through another generator. Before the first run, confirm the authentication method, the credential variables, the project or space identifier and the endpoint region against the generator source, since these settings depend on how your watsonx instance is provisioned and on the generator version you install. Ask your IBM contact which model identifiers your tenancy exposes, because a model name that works in the watsonx console may not match the string the generator expects.
Plan the scan around what the generator reports back. garak writes a JSONL report of every attempt and its evaluation, along with a garak.log file that continues across runs, and both belong in your evidence set. Confirm with your security and compliance leads where those files will be stored, who can read prompts that contain sensitive test content, and how long they are retained. Also agree in advance on which watsonx model versions and settings the scan covers, so that a later model change triggers a rescan rather than an unexplained shift in results. A scan that documents the endpoint, generator settings and garak version used is far easier to defend in a review than one that records only a pass or fail summary.
What you need before the first watsonx scan
A garak scan of a watsonx model depends on four things lining up: a Python environment that can run garak, a watsonx project with the target model deployed, credentials and an endpoint the generator can use, and a network path from the scan host. Written authorization sits alongside them so the scan is approved before any traffic reaches the model.
Python 3.11 environment with garak
The PyPI package of garak requires Python 3.11 or newer, and the tool is developed on Linux and macOS. Install it into a dedicated virtual environment on the scan host so its dependencies do not collide with other tooling. Run garak from PyPI as the install source, then confirm the version you installed matches the release your report pipeline expects. Record the exact version in every scan's notes, because later scores can shift between releases.
garak on PyPIwatsonx project and deployed model
The generator needs a watsonx project that contains the model you intend to test, already deployed and reachable. Confirm with your IBM administrator which project, model identifier and deployment the scan should target, since a scan against a test deployment can produce different results from production. Check that the model is available in the region your account uses. Ask whether the project's model and usage settings match what your application runs in production.
Credentials and endpoint settings
The WatsonXGenerator authenticates with credentials tied to your watsonx account and connects to a regional service endpoint. Store API keys in environment variables or a secrets manager, never in a config file committed to source control. Confirm with IBM or your platform team which authentication method, key type and service URL apply to your account, because these values differ by account and region. Use a service identity with the least access needed to call the deployed model.
WatsonX generator sourceNetwork paths from the scan host
The scan host must reach the watsonx endpoint over HTTPS. In regulated environments this often means an approved egress rule, a proxy with a certificate policy, or a private connection set up by your network team. Test reachability from the exact host that will run the scan, not from a laptop, and confirm that outbound logging captures the traffic if your security team needs it. If the host cannot reach the endpoint at all, settle the path before scheduling any probe run.
Written scan authorization
Get written approval that names the model, the watsonx project, the scan window, the probe families in scope and the people allowed to run and receive results. Include who may stop a scan that causes load or cost. Probes such as jailbreak and data leakage tests send adversarial prompts that can trigger alerts, consume quota and generate outputs that must be handled as sensitive. The authorization should also state how the JSONL report and garak.log files are stored and who may read them.
Items to confirm with IBM or your team
Several values for this scan depend on your account rather than on general documentation: the model identifier, the project and region, the service endpoint, the authentication method, usage limits and any content filtering or rate limits applied to the deployment. Confirm each one in writing before the first run, and record the answers alongside the garak version. Checking these up front prevents a scan from appearing to fail when the deployment, not the model, is the cause.
Configuring the WatsonX generator for a scan
This sequence takes an operator from a clean garak install to a full probe run against a watsonx model. Each step ends with a check, so connectivity, credentials and report output are confirmed before the scan widens. The result is a repeatable configuration and a first set of reports the team can review.
Install garak in a Python environment
Install garak from PyPI with pip in a virtual environment running Python 3.11 or newer, on Linux or macOS, the platforms garak is developed on. Keep the environment with the scan host so the version stays fixed for later comparisons. Run
python -m garak --helpand confirm it prints the option list. The step is done when the help output appears without import errors and the installed version is written into the scan record.Confirm the watsonx generator loads
Confirm that garak registers the WatsonX generator before adding any credentials. Check the generator list garak reports, or read the generator module in the garak source, and verify that a watsonx entry is present. Then run the help for the watsonx target type. The step is done when the watsonx option appears in garak's output and no import error is raised when the generator is referenced.
Set watsonx credentials and model identifier
Set the watsonx credentials and the model identifier the way the generator source defines them. Open the watsonx generator module and note each environment variable or configuration key it reads, then set those values in the shell session or in a config file that is kept out of version control. Use a service credential limited to the access the scan needs. The step is done when a dry invocation resolves the intended model identifier and garak.log contains no secret values.
Run one small probe for connectivity
Run a single small probe to confirm the endpoint answers. Use a one-prompt probe such as test.Blank, after confirming its name in garak's probe list, with the watsonx target type and your model identifier. Leave the generation count at the default of 5 or lower it for this run. The step is done when garak reports a completed run, a JSONL report is written to the report directory, and the first attempt holds a model response rather than an authentication or endpoint error.
Review the first report entries and log
Read the first report entries and the log before going further. Open the JSONL report and check that each attempt holds the prompt, the generated output and the detector evaluation. Then search garak.log for warnings, retries and throttling messages. The step is done when the entries match the prompt sent, the output comes from the watsonx model you named, and any retry or throttling warnings are understood and resolved.
Widen to the planned probe set
Widen to the planned probe set one family at a time. Choose probe families from your scan specification, start with the family closest to your highest-risk use case, and run it with the same model identifier and settings. Review each family's report before adding the next, so a misconfiguration surfaces early. The step is done when every planned family has completed and its report sits alongside the connectivity run.
Save the configuration for repeat runs
Save the working configuration so later runs repeat the first one. Record the garak version, the watsonx model identifier, the probe list, the generation count, the report location and the exact command or config file, but keep credentials out of the record. Store it with the scan results. The step is done when a second operator can rerun the connectivity probe from the saved record and reach the same outcome.
How prompts, responses and detector results flow through a run
A garak run moves each probe's prompts through the generator, then through the detectors, and finally into the report. The default probewise harness takes each probe, sends its prompts to the WatsonXGenerator, which calls the watsonx model you name in the configuration, and passes every response back to the detectors recommended for that probe. Evaluators then turn detector output into a pass or fail judgment for each attempt. Your job before the first scan is to confirm the generator's connection settings, the watsonx model identifier and the project or space the calls are billed against, since those determine which model actually answers the prompts. Check these against the generator source linked from this page rather than assuming the defaults match your tenant.
Two defaults shape the numbers you will read. garak makes 5 generations per prompt, so a single probe can send several attempts at the same model for the same input, and a probe is marked FAIL with a failure rate as soon as any attempt produces undesirable output. A model that resists four attempts and fails one is still reported as failing that probe. Decide before the scan whether a single failing attempt is a finding you act on, and record that decision with the scan configuration so the next run is judged the same way. Changing the generation count changes the failure rate, so keep it fixed when you compare runs over time.
The JSONL report is the evidence artifact. Each run writes one record per attempt, including the prompt, the response returned by the watsonx model and the detector and evaluator results for that attempt, and the garak.log file records what happened during the run. Keep both files together with the model identifier, garak version and configuration used, because a reviewer who asks why a probe failed needs to trace it back to the exact response. Confirm with your security team where these files will be stored and how long they are retained, since they can contain sensitive prompts and model output.
Request flow from garak to a watsonx model
The scan starts on the scan host, where the command-line tool loads the default probewise harness, which runs each probe with its recommended detectors. The WatsonXGenerator is the hand-off point: it sends each prompt across the trust boundary to the watsonx endpoint and model, and returns the output to the detectors. Check that the generator's credentials and endpoint are the ones you intend to test, and that detector results and every attempt land in the JSONL report and garak.log on your host.
garak runs on your host, and only generator calls cross into IBM's hosted service.
Mapping watsonx model settings to garak configuration
This table maps each item a garak run needs from IBM watsonx to where it is set, and names who owns the value and where to confirm it. Check exact parameter and variable names in the WatsonXGenerator source before writing your configuration, because the source is the authority for them. The main takeaway is that the credential, project and region values come from your watsonx administrators, so request them before the first scan.
| watsonx item | garak setting or variable | Owner and where to confirm |
|---|---|---|
| Model identifier | Model name or ID the WatsonX generator sends with each request, set in the generator configuration | ML or AI platform team; confirm the exact parameter name in generators/watsonx.py and the model entry in watsonx |
| Project or space | Project or space identifier the generator needs to address the deployed model, if the generator requires one | watsonx project owner; confirm the identifier in the project settings of the watsonx console |
| Endpoint region | Service URL or region value that the generator uses to build request addresses, which must match where the model is hosted | Platform administrator; confirm the region on the watsonx service instance in IBM Cloud |
| Credential | API key or token read from an environment variable, kept out of config files and out of shared reports | Security or platform owner who issues service credentials; confirm the variable name in the generator source |
| Generation settings | Generations per prompt (5 by default in garak) and any token or sampling options the generator exposes | Scan owner; confirm supported options and model limits in the watsonx model documentation |
| Request interface | Whether the generator sends chat-style or text-style requests, chosen to match the deployed model | ML engineer; confirm the interface the deployed model accepts before choosing the probe set |
| Run record | Config file and environment values that shape each run, captured in the JSONL report and garak.log for repeat runs | Scan owner; review logs for secrets and remove credentials before sharing reports outside the team |
Protecting credentials, scan data and the test scope
A watsonx scan touches three sensitive things: the API credentials that reach your model, the outputs the model produces under attack, and the production systems that may be involved. The cards below cover how to protect each one and how to agree the boundaries of the test in writing before anyone sends a probe.
Keep watsonx credentials out of source control
The WatsonXGenerator authenticates to watsonx with keys that can call your models and incur usage. Pass them through environment variables or a secrets manager at run time, not through a YAML or config file committed to a repository. Confirm which variables the generator reads in the garak source, and check that scan configs, shell history and CI logs do not echo the values. Rotate any key that has appeared in a shared file or log.
WatsonX generator sourceUse a least-privilege service identity
Create a dedicated watsonx identity for garak rather than reusing a developer's personal key or an administrator's account. Grant it access only to the project or deployment under test, and only the inference permissions the scan needs. Ask your platform team to confirm how watsonx scopes keys and service IDs in your account, since the exact role names depend on your configuration. Name the identity so usage in billing and audit logs traces back to the scan.
Restrict who can read the JSONL reports
Each run writes a JSONL report containing every prompt sent and every model output, including outputs that contain leaked data or harmful content. Treat these files as sensitive data. Store them in a access-controlled location, limit read access to the security and model owners who need it, and avoid attaching raw reports to tickets or chat threads. Decide whether reports from probes that elicit personal or confidential data need redaction before wider sharing.
Set a retention rule for garak.log
garak writes a garak.log debugging file that continues across runs, so it accumulates request details and errors over time. Decide how long it is kept, who can read it, and when it is rotated or deleted. Align the retention period with your data handling policy and with any record-keeping obligations that apply to the model's evaluation evidence. Check that the log does not capture credentials when debug output is enabled.
Obtain written approval before testing production
Scans send adversarial prompts that can trigger unusual responses, consume paid capacity and, on a live deployment, reach real users or downstream tools. Before pointing garak at a production model, get written approval from the model owner and the service owner that names the target, the time window, the probe families and the request rate. For illustrative purposes, a test deployment with a separate key and a stated window is far easier to approve than an open-ended scan of the live endpoint.
Record the scope in a signed test plan
Write a short test plan that lists the watsonx model identifiers, the projects or spaces in scope, the garak version, the probes and detectors selected, and the people accountable for the results. Keep it with the reports so a later reader can see what was tested and under what authority. Ask your legal or procurement team whether watsonx service terms or your own agreements limit automated testing of the platform, and resolve that question before the first run.
Common failures when scanning watsonx with garak
This table lists the failures teams most often hit when pointing garak's WatsonXGenerator at a watsonx model, with the likely cause and a first fix for each. Use it as a triage checklist before a scan, and confirm exact error text against the generator source and your own watsonx configuration.
| Failure | Likely cause | First fix |
|---|---|---|
| Generator not found or install fails | garak installed under Python older than 3.11, or the watsonx generator not loaded in the active environment | Confirm Python 3.11 or newer, reinstall garak from PyPI in a clean virtual environment, then list generators to confirm the watsonx entry is present |
| Authentication rejected | Missing or expired credentials, or the API key set for a different IBM Cloud account or region than the project | Check the environment variables the generator source reads, regenerate the key in IBM Cloud, and make sure it belongs to the account that owns the project |
| Wrong model or project identifier | Model ID typed from memory, a deprecated model name, or a project ID copied from another workspace | Copy the model ID and project ID from the watsonx project settings, then run one short test prompt before starting the full probe set |
| Network blocked to the watsonx endpoint | Egress firewall, proxy or private network rules that do not allow the regional watsonx API host | Test HTTPS reachability from the scanning host to the regional endpoint, then ask your network team to allow that host and any proxy settings garak needs |
| Slow or failed attempts from rate limiting | Default parallel attempts and 5 generations per prompt exceeding the account's request limits on the watsonx service | Lower parallelism and retry settings in the run configuration, and schedule long runs outside peak use of the shared project |
| Reports overwritten or misread across runs | Reusing the same output prefix, or comparing JSONL files from runs with different probes, generations or model IDs | Give each run a unique report prefix that includes the model ID and date, and record the garak version and configuration beside each report |
Questions teams ask before scanning watsonx with garak
Is garak free to use for scanning watsonx models?
Yes, garak is licensed under the Apache 2.0 license and the maintainers describe it as a free tool. Apache 2.0 permits your organization to use, modify and run the software internally, subject to its notice and attribution terms. Your legal team should read the license text and confirm how it applies to your internal use. Your costs come from the watsonx usage that each scan generates, the scan host and the people who run and review the work, not from a garak license fee. Check the garak user guide for current installation and configuration details.
What drives the effort and time for a watsonx scan?
The main drivers are the number of models in scope, the probe set you choose, the scan host and the access approvals you need before testing starts. Each model adds its own configuration and attempt volume. Garak makes 5 generations per prompt by default, so a broader probe set and more models mean more generations and more watsonx usage. Access approvals for the watsonx project, API credentials and network routes often take longer than the scan itself, so confirm them early with your platform and security owners.
What does your team need to provide for the scan?
You need a watsonx account with access to the target models, an API key or credential set with the minimum permissions needed for inference, the endpoint or region details for your watsonx instance, and a host with Python 3.11 or newer to run garak. You also need a named owner to approve the probe scope and to receive results. Ask your watsonx administrator to confirm the project, model IDs and quota limits, and ask your security team to confirm where scan logs and reports may be stored.
Can an internal team run garak against watsonx without outside help?
Yes, an internal team with Python experience and access to the watsonx environment can install garak with pip, configure the WatsonX generator and run probes. The harder parts are usually scope and interpretation: choosing probes that match the application's real exposure, keeping configurations repeatable, reading the JSONL report and deciding what counts as a finding. If your team lacks time or experience in those areas, a partner can plan and run the work, but the choice belongs to you.
How often should a watsonx model be rescanned with garak?
Rescan when something material changes: a new model version, a change to the system prompt or guardrails, a new tool or data source connected to the model, or an upgrade to garak itself. Scores can shift between garak releases, so keep the version fixed when comparing runs. Many teams also schedule a recurring scan on a cadence set by their risk owner. Ask your risk owner to set the trigger list and frequency, and document it in your change process.
Does a DeployOpen engagement include the watsonx scan?
DeployOpen runs security testing of AI systems and agents, and most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. A scoped engagement can cover planning the watsonx scan, configuring the WatsonX generator, running the agreed probes, and delivering findings and evidence. DeployOpen does not issue audit reports or certifications. Ongoing testing and retesting can be arranged as a retainer. A quote follows from the written scope, and DeployOpen does not publish a price list.
Will a garak scan tell us whether our watsonx deployment is compliant?
No, a garak scan produces test results, not a compliance determination. It shows which probes produced undesirable output against your configuration. Auditors and certification bodies decide whether controls meet a standard, and they will ask how the scan was scoped, how it was run and how findings were handled. Ask your compliance lead which evidence they need, and record the garak version, configuration and report for each run so the evidence can be reviewed later.
What a DeployOpen watsonx scan engagement delivers
A DeployOpen watsonx scan engagement starts with a written scope. Before any work begins, we agree which watsonx models and deployment endpoints are in scope, which garak probe families apply to each model's real exposure, how the target is reached from the scanning host, and what the agreed deliverables and timelines are. Scope, deliverables and timelines are confirmed in writing before work starts, so your security, compliance and AI platform owners know exactly what will be tested and what they will receive. Confirm early which watsonx credentials and project or space identifiers your team can provide, and whether the scan should cover the model directly or the application built on it.
Once the scope is agreed, DeployOpen configures garak's WatsonX generator against the agreed models, runs the agreed probes with the detectors and generation settings defined in the plan, and keeps the JSONL report and garak.log from every run. The engineers then review failures, separate true findings from detector noise, and write findings with remediation guidance that names the control to change, whether that is a system prompt, a guardrail, a model selection decision, or an application-side filter. Each finding carries the probe, the attempt that failed and the recommended fix, so your team can act on it without rerunning the work.
Retesting after fixes is part of the engagement, and recurring work can be arranged as a retainer. Retests rerun the affected probes against the changed configuration so you can show that a finding was closed, and scheduled rescans can repeat the agreed scan on a cadence you choose after a model, prompt or platform change. Ask for the retest scope, the rescan schedule and the form of the reports in the written proposal, and confirm with your watsonx administrators which change windows and access limits apply to repeated runs.
How DeployOpen scopes, runs and supports garak scans
DeployOpen runs garak scans against IBM watsonx models as a written, fixed-scope engagement inside the environment your organization controls. The work covers how the WatsonX generator is configured, which probes and detectors match your model's exposure, and how results are documented so your security and compliance teams can review them.
How we scope
- Agree in writing which watsonx models, deployments and access paths are in the scan.
- Confirm the watsonx credentials, project and region settings the WatsonX generator will use.
- Set probe families, generation counts and the report outputs before any scan starts.
How we build
- Install garak in your environment and configure the WatsonX generator against your endpoints.
- Run a baseline scan, then review the JSONL report and garak.log for errors and gaps.
- Test model behavior against the probes you agreed, then adjust settings and rerun to confirm.
How we hand over
- Deliver the scan configuration files, run commands and the report set in your repository.
- Document how each finding was produced, which probes ran and what failed, in plain terms.
- Train your team to rerun scans, read the reports and compare results across later runs.
How we support
- Offer ongoing support, scheduled rescans and garak upgrades as a retainer after handover.
- Retest after your model, prompt or access changes so comparisons stay meaningful over time.
- Ask any retainer provider to confirm response scope and terms in writing before signing.

