Red teaming models served by Ollama before rollout
A team with a shared Ollama endpoint needs evidence that the model resists jailbreaks, prompt injection and harmful output before users or applications depend on it. The server hardening covered elsewhere does not answer that question. Ollama's local API at localhost:11434 requires no authentication, and that is a server property you can check. Whether the model refuses unsafe requests, follows instructions embedded in retrieved documents, or leaks system prompt content is a property of the model and its template, and only testing shows it. Treat the endpoint as the test target and the model's answers as the result you have to sign off on.
Red teaming here means sending adversarial prompts to the exact endpoint your users will call and scoring the responses. Open source tools fit this work. garak probes for prompt injection, jailbreaks, data leakage and toxic output, and its REST generator can reach any endpoint that returns plaintext or JSON, so you can point it at Ollama's API through a short YAML file. promptfoo provides automated red teaming that runs locally and talks directly to the model, and it references the OWASP LLM Top 10 for test categories. Confirm the exact generator configuration for your Ollama version against the garak user guide before you rely on it, and record the tool versions you used.
Plan a baseline run before the first rollout, then retest whenever the model changes. A change includes a new tag, a re-pulled model, a new Modelfile with a different system prompt or template, or a changed quantization, because each can shift refusal behavior. Keep the JSONL reports and the garak.log file from each run so you can compare failure rates across versions. Also decide in advance who reviews failures, which failures block rollout, and whether results are sufficient for your own risk assessment, since red teaming produces findings for your team rather than a certification.
How garak and promptfoo differ for Ollama testing
garak and promptfoo both send adversarial prompts to a model endpoint and score the responses, but they fit different workflows. The cards below cover licensing, interface, how each one reports results, and where the self-hosted options stop, so the team can pick the tool or the combination that matches its review process.
License and ownership
garak is licensed under Apache 2.0 and developed in the NVIDIA GitHub organization. promptfoo is licensed under the MIT license, and OpenAI acquired promptfoo, announced on 9 March 2026, with the founders stating it will remain open source. Check both licenses against your internal open-source policy, and record which company maintains the tool you rely on, since ownership affects future roadmap and support expectations.
garak READMECommand-line probing with garak
garak is a command-line tool installed from PyPI with pip, and the PyPI package requires Python 3.11 or newer. It ships probes for prompt injection, jailbreaks, data leakage, toxicity and hallucination, and it can reach an Ollama endpoint through its REST generator with a short YAML file. Plan a dedicated test host with a pinned Python version so scan results stay reproducible across retests.
garak user guidePipeline and CI use with promptfoo
promptfoo can be used as a CLI, as a library or in CI/CD pipelines, which makes it a natural fit when red team checks must run after every model pull or Modelfile change. It requires Node.js 22.22.0 or newer for the 0.124.1 npm release. Decide early whether the scan gates a deployment or only reports, because that choice determines how strictly the pipeline fails.
promptfoo introductionProbes, detectors and plugins
garak organizes its work into probes, detectors, evaluators, generators and harnesses, and the default probewise harness runs each probe with its recommended detectors. promptfoo's red team plugins cover a similar range of attack classes and map results to frameworks such as the OWASP LLM Top 10. Compare the attack coverage each tool offers against the risks your use case actually carries, and document which probes you ran.
Reports and evidence
Each garak run writes a JSONL report of every attempt and its evaluation, plus a garak.log file that continues across runs. promptfoo presents results through its evals and web UI. Keep the raw output from either tool with the model digest, Ollama version and Modelfile, because a reviewer will ask which exact model produced each result.
Self-hosted promptfoo limits
promptfoo's evals run on your machine and talk directly with the LLM, so the CLI needs no central server. The self-hosted app is an Express server deployable with Docker, Docker Compose or Kubernetes with Helm, but it stores data in a local SQLite database that cannot be shared across replicas, has no RBAC or built-in SSO, and is not recommended for production. Confirm whether a shared results dashboard needs the Enterprise or On-Premise tier, or whether a CLI-only workflow with your own storage is enough.
promptfoo self-hostingChoosing a scanner and test mode for each rollout stage
This table compares four ways to point an open-source scanner at an Ollama endpoint, from a one-off garak run to a shared promptfoo app for review. Read each row against the stage you are in: exploratory testing, a repeatable gate before release, or a shared place where a team reviews findings. The main takeaway is that the self-hosted promptfoo app is not a production-grade shared service without additional controls, so teams usually pair it with a gate run from CI.
| Option | When it fits | What it needs | Trade-offs |
|---|---|---|---|
| garak with the default probewise harness | First pass on a newly pulled or fine-tuned model to see which probe families produce undesirable output | Python 3.11 or newer, garak installed from PyPI, and a generator configured for the Ollama endpoint | Broad coverage with recommended detectors, but results are per-run files that someone must collect and interpret |
| garak REST generator pointed at Ollama | Testing the Ollama API as deployed, including any proxy or gateway in front of it, rather than the model alone | A short YAML file describing the endpoint and request and response shape, plus network access from the test host | Tests the real serving path, but the YAML must match the Ollama request format, so confirm it against your server version |
| promptfoo CLI red teaming in CI/CD | A repeatable gate that runs on every model change, quantization swap or Modelfile edit before the model reaches users | Node.js 22.22.0 or newer, a configuration file for the Ollama provider, and a CI runner that can reach the endpoint | Failures block a pipeline with consistent settings, but the runner needs credentials for any gateway in front of Ollama and probe volume should be checked against plan limits |
| Self-hosted promptfoo app for shared review | A small security or AI governance group that needs to browse findings together during an assessment | Docker, Docker Compose or Kubernetes with Helm, and a plan for who can reach the web UI | Uses a local SQLite database that cannot be shared across replicas, has no RBAC, horizontal scaling, built-in authentication or SSO, and is not recommended for production use. Put it behind your own access controls or use Enterprise features that include SSO and team access control |
Running a red team scan against the Ollama endpoint
This sequence takes a team from a confirmed Ollama endpoint to a recorded baseline of scan results for each model version under test, so later changes can be compared against a known starting point.
Confirm the endpoint and bind address
The platform engineer confirms where the Ollama API listens before any scanner connects. By default Ollama binds to 127.0.0.1 on port 11434, and the bind address can be changed with the OLLAMA_HOST environment variable. Run a simple request against the intended address from the machine that will run the scanner, and confirm that it returns a response. Record the exact URL, the server version and who owns the host. The step is complete when the scanner's host reaches the endpoint and the test traffic stays on the network path your security team has approved. The local API does not require authentication, so confirm that the endpoint is reachable only from the scanning host or a controlled network segment before testing begins.
Scope the models and versions under test
The security lead and model owner agree the list of models and their exact tags to test, along with the Ollama server version. Write down each model name, its tag and its intended use case, because results only apply to the artifact that was tested. Include any custom Modelfile or system prompt, since these change behavior. Ask the model owner to confirm which model versions are approved for the intended users. The step is complete when the scope is a written list that a reviewer can match against what is running on the server, using the model listing and version output from the host.
Install the scanner in a pinned environment
The engineer installs garak in an isolated Python environment running Python 3.11 or newer, using pip from PyPI. Alternatively, promptfoo can be installed on a system running Node.js 22.22.0 or newer. Pin the scanner version so the report can be reproduced later, and record the version of the tool and its Python or Node runtime. Garak is licensed under Apache 2.0 and promptfoo under MIT, so confirm that both licenses fit your internal policy. The step is complete when the tool's help or version command runs successfully from the scanning host and the version is written into the test record.
Write the generator or provider configuration
The engineer creates a configuration that points the scanner at the Ollama endpoint on port 11434. In garak, this is typically a REST generator described in a short YAML file that sets the URL, request body format and response parsing for Ollama's API. In promptfoo, it is a provider configuration that names the Ollama model and base URL. Keep the file in version control, and avoid placing any credentials in it, since the local API does not require an API key. Check the configuration by sending one test prompt through it and confirming that the response is parsed into text the scanner can evaluate. The step is complete when a single test prompt returns a readable model reply.
Run the baseline scan
The engineer runs the scanner against one model version using the agreed probe set, leaving default settings unless the team has a documented reason to change them. Garak's default harness runs each probe with its recommended detectors, and by default makes 5 generations per prompt, marking a probe as FAIL when any attempt produces undesirable output. Start with a small, named set of probes that covers jailbreaks, prompt injection and data leakage, then widen the scope in later runs. The step is complete when the run finishes without errors and produces an output directory for the model version. Confirm that the run covered the probes listed in the scope document.
Review the JSONL report and garak.log
The security tester opens the JSONL report, which lists every attempt and its evaluation, and sorts the failures by probe. Read a sample of failed attempts in full to confirm that the detector flagged real undesirable output rather than a false positive, and note any probes where the detector itself is questionable. Open garak.log to check for errors, timeouts or skipped probes, since these can make a pass look better than it is. The step is complete when each failure has been checked by a person and every error in the log has been resolved or written down as a known gap.
Record results for each model version
The security lead records the results in a register that links each model name, tag, Ollama server version, scanner version, probe set and failure rate to the stored JSONL report and log. Include the decision made for each finding, such as accepting a risk, adding a system prompt control or blocking the model from rollout. Store the report files in a location with access controls and a retention period that matches your policy. The step is complete when a reviewer can find the baseline for any model version and reproduce the run from the recorded settings. Retesting is required after any model change, so this record becomes the reference for later comparisons.
How the scanner, the Ollama endpoint and the report fit together
The run starts with an operator launching garak or promptfoo from a test host. Prompts cross a trust boundary, either a private network or a reverse proxy, before reaching the Ollama API on port 11434. Responses then pass to detectors or evaluators, which write results to a JSONL report and a garak.log file. Check that the boundary enforces authentication, and retest after every model change.
Scanner traffic reaches Ollama through a trust boundary, and findings loop back to retesting.
Security risks while testing a shared Ollama server
Red teaming a shared Ollama server puts three things in one place: harmful prompts, a model endpoint with no built-in authentication, and logs full of model output. Each card below names one risk that follows from that combination, with the check to run before the first scan.
Harmful prompts reach shared infrastructure
A scanner sends jailbreak and toxicity probes at the endpoint by design, so every other user of the same Ollama server shares its queue, loaded models and GPU memory. Confirm which users, services and dashboards depend on that server, and whether a test window or a dedicated test instance is agreed before scans start. Check the concurrency settings so probe volume cannot starve production traffic.
- Default queued requests
- 512
Unauthenticated API during scans
The local Ollama API does not require authentication, so a test run that reaches the server from another host exposes the model to anyone else on that network path. Confirm the bind address and firewall rules before the scanner is pointed at the endpoint, and keep the scanner on the same host or a private interface. Treat any proxy in front of the server as part of the test boundary.
- Default API port
- 11434
Test logs holding sensitive output
Scanner reports record every attempt and its evaluation, and debugging logs persist across runs, so model outputs that include leaked data or harmful text end up stored in plain files. Decide where reports live, who can read them, how long they are kept and how they are deleted. Confirm that report folders are excluded from shared backups and general file sync.
Local promptfoo data and self-hosted limits
A promptfoo run on your machine keeps evaluation data local, but a self-hosted promptfoo app stores results in a local SQLite database that cannot be shared across replicas and has no built-in authentication or SSO. Do not expose that app to a team and expect access control, and confirm who can open the web UI and where its database file sits. Check the vendor's current self-hosting guidance before choosing a shared deployment.
promptfoo self-hosting docsScanner credentials outside config files
Scanner configs for hosted providers or authenticated gateways often hold API keys, and a YAML file for a REST generator can end up in version control or a shared repository. Keep keys in environment variables or a secrets manager, restrict file permissions on the scanner home directory, and rotate any key that appeared in a config or log. Confirm that report and log files do not echo the header values sent to the endpoint.
Retesting after model changes
A new model tag, quantization or version of Ollama can change behavior that an earlier scan approved, so results from one model are not evidence for another. Record the model name and digest alongside each report, and rerun the same probes after every model or runtime update. Confirm the release notes for the Ollama version in use before assuming old results still hold.
Ollama GitHub releasesQuestions teams ask before red teaming Ollama models
Do garak and promptfoo cost money to use?
Neither tool requires a license fee to run its core testing. garak is a free tool under the Apache 2.0 license, and promptfoo is licensed under the MIT license. The promptfoo Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Paid promptfoo Enterprise adds team sharing, SSO, custom roles, continuous monitoring and priority support with SLAs, and it is priced on request. Your real costs are the people who plan and run the tests, the compute for the scans, and any time spent fixing what the tests find. Ask any partner for a quote that separates these items.
How long does a red team scan against an Ollama endpoint take?
Duration depends mostly on the number of probes you select and how many generations each prompt receives. garak makes 5 generations per prompt by default, so a broad probe set multiplies quickly. Other drivers include the model size and hardware, the Ollama concurrency settings such as OLLAMA_NUM_PARALLEL, and whether the detectors call a separate judge model, which adds its own inference time. A narrow run against one model can finish in a short session, while a full sweep across several models and attack categories takes much longer. Confirm the probe list and generation count in your test plan before you agree a timeline.
What does the team need to provide for a red team engagement?
The team needs a reachable test endpoint that matches production, meaning the same Ollama version, model tag, system prompt, context settings and any gateway or proxy in front of it. You also need a named owner who can answer questions about intended use, the data the model may see and the actions it may take. A test account or API key with the same access level as real users is useful, along with written rules of engagement that cover when testing may run and who is notified. Access to logs helps confirm what the model received. Agree on the severity definitions before testing so findings can be ranked consistently.
Can our own team run garak and promptfoo without a partner?
Yes, many teams can run both tools in-house, because garak is a command-line tool installed from PyPI with Python 3.11 or newer, and promptfoo runs from npm with Node.js 22.22.0 or newer. The harder work is test design, interpreting results and deciding what counts as a failure for your use case. garak marks a probe as FAIL when any attempt produces undesirable output, so teams need to review detector output rather than trust the summary alone. Consider a partner if your team lacks time, security testing experience or the evidence format your assessors expect. Confirm which tasks you want to keep in-house before scoping any external work.
How often should we retest Ollama models after changes?
Retest whenever the model, its weights, its Modelfile, its system prompt or the serving stack changes. Ollama ships frequent releases, including v0.40.5 on 14 October 2026 and a pre-release v0.40.6 on 16 October 2026, so pin the version you tested and retest before upgrading. Changes to garak or promptfoo can also alter probe sets and detectors, so record the tool version in each report. Many teams also run a smaller regression set on a schedule. Set the cadence in your change management policy and confirm it with your risk owner.
Do the scanners send our prompts or model outputs to a third party?
It depends on the configuration. Ollama states that when it runs locally it does not see your prompts or data, and promptfoo's documentation states that evals run on your machine and talk directly with the LLM. Detectors, judge models or hosted generators can send data elsewhere, so check every provider in your configuration. Setting OLLAMA_NO_CLOUD=1 keeps the Ollama server from using cloud features. Record the endpoints each scan contacts so you can show reviewers where test data went.
Which frameworks do these red team tests map to?
promptfoo's red teaming documentation references the OWASP LLM Top 10, the NIST AI Risk Management Framework and the EU AI Act as frameworks that support systematic testing before deployment. garak covers probe categories such as prompt injection, data leakage, jailbreaks and toxicity. Mapping results to these frameworks helps compliance teams, but a red team report is evidence for your assessment, not an audit or certification. Ask your assessor which framework and control references they expect in the report.
Limits to confirm before you rely on scanner results
A clean scanner run tells you that known probe patterns did not succeed against one model, one version and one configuration. The cards below cover the gaps between that result and a rollout decision, so the team can state exactly what was tested and what remains open.
Known probe patterns only
Scanners such as garak and promptfoo send prompts drawn from libraries of attack patterns that their authors have already catalogued. A jailbreak or injection that falls outside those patterns will not appear in the report, even though it may succeed against your application. Treat a passing run as evidence about the listed patterns, and document the attack families you did not test, such as multi-turn social engineering or attacks through your own retrieval sources.
Detector accuracy varies
Each probe is judged by one or more detectors that decide whether a response is undesirable. Detectors can miss harmful output and can flag safe refusals as failures, and their accuracy differs by category and by model. Sample the JSONL report by hand for each failing and passing category, and record how many judgments you overrode, so the team knows how much to trust the failure rate.
garak coverage depends on version
The probes, detectors and default settings in garak change between releases, so two runs on different versions are not directly comparable. Pin the exact garak version in your test record, and read the release notes for the version you run. The current release at the time of writing is v0.17.1, but confirm the version in your own environment before you cite results.
garak releasespromptfoo Community tier limits
The free promptfoo Community edition includes red teaming with a monthly allowance of 10k probes, and community support only. Plan the probe count for each model and each retest before the run starts, since a large matrix across several models can use the allowance quickly. Confirm current limits on the pricing page before you schedule recurring tests, because they can change.
promptfoo pricingOllama version changes behavior
A model's responses can change when the Ollama runtime changes, even if the weights stay the same. Ollama ships frequent releases, including v0.40.5 released on 14 October 2026 and the pre-release v0.40.6 published on 16 October 2026. Record the Ollama version alongside the model digest for every test, and rerun the suite when either one changes, including after a pre-release is adopted.
Ollama releasesConfirm the supported model list
Before relying on results, confirm which models, quantizations and versions run in each environment, because the set that is approved for production may differ from the set that was scanned. Compare the exact model tag and digest on each serving host against the tested record. Ask the team to confirm which models are in scope, and to block any model that was not tested from reaching users.
When to retest after a model or version change
Treat every change to the served model as a new system under test. A model pull, a Modelfile edit, a quantization change or an Ollama upgrade can alter refusal behavior, system prompt handling and output formatting, so a passing report from the previous configuration tells you little about the current one. Make the rerun a gate in your change process: no model tag or Ollama binary reaches a shared OLLAMA_HOST endpoint until the same garak and promptfoo suites have run against the exact artifact that will serve users. Pin the tag and record the model digest, because a tag such as latest can point to different weights over time. Confirm the Ollama version in use with your own environment before each run, since release notes for Ollama and garak both change frequently and the baseline must match what is deployed.
Compare runs by holding the probe set, generation count and detectors constant, then diffing the results. garak writes a JSONL report of every attempt and its evaluation for each run, and a continuing garak.log, so store reports in a dated folder keyed by model digest, Ollama version and garak version. Compare per-probe failure rates rather than a single headline number, and read the individual prompts behind any new failure before deciding whether it is a regression or a detector false positive. promptfoo results can be saved and diffed the same way, and its self-hosted app stores data in a local SQLite database that cannot be shared across replicas, so export results to your own evidence store if several reviewers need them. Keep the scanner version in the record too, because a change in a detector can look like a change in the model.
Evidence for internal review should show what was tested, when, against which artifact, with which settings, and what was decided. A short register per model version works well: the digest, Modelfile hash, Ollama and scanner versions, the reports, the accepted risks with owners and the retest result after each fix. Describe these records as internal test evidence. They support your security and compliance teams but do not amount to an audit report, attestation or certification, and any framework mapping you cite, such as the OWASP LLM Top 10 or the NIST AI Risk Management Framework, should be stated as a mapping you made. Ask your assessor which format they expect before you standardize the register.
How DeployOpen scopes and delivers red team testing for Ollama
DeployOpen plans and runs red team testing of models served by Ollama as a fixed-scope engagement, agreed in writing before work starts. The work covers the Ollama endpoint, the models you approve, and the controls around them, with findings, fixes and a retest delivered as documented evidence.
How we scope
- Confirm which Ollama servers, model tags and endpoints are in scope, and whether the test reaches them directly or through a gateway.
- Agree the threat areas to test, such as jailbreaks, prompt injection and harmful output, and which use cases the model supports.
- Record the scope, deliverables and timeline in writing, and agree which model versions must be retested after changes.
How we build
- Set up garak and promptfoo in a test environment that you control, pointed at your Ollama endpoint through a documented configuration.
- Configure probes, detectors and attack suites for your use case, and keep the run settings and versions recorded for repeatability.
- Run the tests against the agreed model versions, then review failures manually to separate true weaknesses from detector noise.
How we hand over
- Deliver a findings report that maps each issue to the affected model, endpoint, reproduction steps and a suggested fix.
- Provide the raw garak JSONL reports and promptfoo outputs so your security and compliance teams can review every attempt.
- Walk your engineers through the retest procedure so future model pulls and Ollama upgrades can be checked in your own pipeline.
How we support
- Retest the agreed issues after fixes are applied and confirm which findings are closed, open or accepted as residual risk.
- Offer ongoing support and continuous testing as a retainer for teams that change models or Ollama releases frequently.
- Ask for a written quote based on the agreed scope, since DeployOpen does not publish a price list.

