Running PyRIT in air-gapped networks with local models
A security or AI team that must red team generative AI systems inside a network with no internet access can point PyRIT at local models and stage its packages in advance. The core framework is built from targets, converters, scorers, attacks, memory and datasets, and the targets can reach a self-hosted model endpoint on your own network. The parts that depend on outside services by default are the ones to plan for first. Some PyRIT datasets are stored locally in the package, while others are fetched remotely from sources such as Hugging Face, so a dataset that works on a connected laptop may fail silently or error inside an enclave. Scorers that call Azure AI Content Safety or a hosted LLM judge also need an endpoint you can reach from inside the boundary.
Teams usually need this setup for three reasons: the test data itself is regulated or sensitive, the system under test sits in an isolated enclave, or the organization restricts which vendor services may receive prompts and responses. In each case, the first decision is the scorer and objective model. Confirm which built-in datasets ship inside the installed package and which must be fetched, then decide whether you will supply your own seed prompts instead. Also confirm with your own environment whether the model you select for scoring is trusted for that data classification, because a local scorer changes the quality and cost of every verdict.
Keep memory local too. PyRIT's persistent SQLite memory stores interactions on disk without an external database, which suits a single isolated workstation or a controlled server. Check where that database file lives, who can read it, and how it is backed up, since the conversation records are often the evidence you will later hand to reviewers. For installation, pre-stage the PyPI package and its dependencies on a transfer medium that your organization's verification process has approved, and record checksums so you can show that what crossed the boundary is what was tested. Confirm the Python version your image supports against the range PyRIT's package metadata declares before you build the transfer bundle.
Which PyRIT components need outside access
PyRIT is built from several parts, and each one either stays inside your network or reaches out to a service. Map every component to local or remote before the design is approved, because an unmapped dependency is the most common reason an isolated deployment fails its first run. The cards below cover the parts that matter most for isolation.
Targets and their endpoints
Targets are the systems PyRIT sends attack prompts to. In an isolated network, a target pointing at a hosted API will fail, so each target must resolve to a model or application inside the boundary. Confirm the address, certificate chain and authentication path for every target, including any that reach an internal web app through Playwright. A target that calls a public endpoint is a blocked dependency until it is rerouted.
Converters that call models
Most converters run locally, such as encoding and obfuscation, but converters that rewrite or translate prompts often call a language model. If that model is hosted outside the boundary, the converter quietly reaches out during an attack run. List each converter in use and mark whether it calls a model, and point any model-backed converter at a local endpoint before the first test.
Scorers and their judges
Scorers decide whether an attack worked. LLM-based scorers, Azure AI Content Safety scorers and custom logic each have different dependencies. A scorer that depends on a cloud classifier will return errors or no verdicts in a sealed network, which can make results look clean when they are not. Confirm that every scorer used in a scenario has a local judge model or an offline method, and test one known-bad response end to end.
Attacks and multi-turn strategies
Attacks coordinate targets, converters and scorers across turns, so a multi-turn strategy inherits every dependency of its parts. Crescendo, TAP and Skeleton Key each rely on an adversarial model to generate prompts, and that model must also run locally. Choose the adversarial model deliberately, because its quality shapes the attack, and record which model served each run for later review.
Datasets stored locally or fetched remotely
Some PyRIT datasets ship inside the package, while others are fetched at load time from sources such as Hugging Face. A dataset that loads remotely will fail or silently return nothing on a disconnected host. Inventory every dataset your test plan names, check the loading documentation for its source, and stage the remote ones on approved media before the network is sealed.
Loading datasets docsMemory on local SQLite
PyRIT's persistent memory stores conversations and results on disk in SQLite, so it needs no external database server. That keeps the memory store inside your boundary, but the database file then holds the full record of prompts and responses, including sensitive content. Decide where the file lives, who can read it, how it is backed up and when it is deleted, and confirm the path is on storage your data classification allows.
Memory docsLocal model and dataset options and when each fits
This table compares the local and remote options for the objective, adversarial and scorer roles, plus bundled and remote datasets. Read each row against your air-gap rules and your hardware, then confirm with your target and scorer documentation which models they support.
| Option | What it provides | Trade-off | When it fits |
|---|---|---|---|
| Ollama runtime | Local REST API on port 11434 with OpenAI compatibility; binds to 127.0.0.1 by default and sends no prompts out when run locally | Local API has no authentication by default, so restrict host binding and network access; model quality depends on hardware | Isolated hosts where one PyRIT workstation or server calls a model on the same machine |
| OpenAI-compatible local server (vLLM) | Serves models behind an OpenAI-style API on infrastructure you control; offers an offline docs option for air-gapped use | Needs accelerator capacity sized for concurrent attack and scoring calls; confirm the server version you run | Shared model service for a team that needs throughput beyond a single workstation |
| Open WebUI backend | Web interface that connects to Ollama or OpenAI-compatible APIs and can run entirely offline | Adds a second service to secure with identity and access control; useful mainly if humans need the interface | Teams that want a human-facing front end alongside a locally hosted model |
| Bundled datasets | Prompt datasets stored locally in the PyRIT package, so no fetch is needed at run time | Coverage is limited to what ships in the package version you stage | Air-gapped runs that must not reach external dataset sources |
| Remote datasets (for example Hugging Face) | Fetched at run time from external sources, giving access to datasets not bundled locally | Fails inside an isolated network unless you pre-download and stage the files | Connected staging environments where data is pulled once and then moved across the boundary |
| Local model capacity | Sets how many objective, adversarial and scorer calls run in parallel without timeouts | Smaller models are cheaper to run but may judge or rewrite prompts less reliably | Plan hardware against your concurrency and retry settings, and test scorer accuracy before a full run |
| Target and scorer compatibility | Determines which local models your target and scorers accept as inputs and outputs | Not every local model works with every scorer; confirm supported models with each vendor or project | Confirm with your target and scorer documentation before you commit to a model |
Staging PyRIT for an isolated network
This sequence moves PyRIT, its Python dependencies, datasets, a local model runtime and model weights into a network with no outbound internet access. It ends with a verified test scan that completes with no outbound traffic, so the team can show how the setup was built and checked.
Inventory every dependency on a staging machine
On a connected staging machine, the platform or security engineer lists everything the isolated network will need: the PyRIT package and its Python dependencies, the Python interpreter, any built-in datasets fetched remotely (such as those hosted on Hugging Face), the Ollama runtime, the model weights, and the configuration files under ~/.pyrit/. Record each item with its version and source. Confirm which datasets are bundled in the package and which are fetched remotely by reviewing the PyRIT loading-datasets documentation for your release. The step is done when the inventory is a written list that the security team has reviewed.
Verify package integrity before transfer
The engineer checks the integrity and provenance of each artifact on the staging machine before it crosses the boundary. Record cryptographic hashes for every file, confirm that packages come from the expected index, and keep the hash manifest with the transfer media. Where your supply chain procurement process requires it, have a second person repeat the checks. Your compliance owner should confirm which control in your program covers software integrity verification for carried packages. The step is done when every file in the transfer set matches the recorded manifest.
Mirror Python packages for the supported range
The engineer builds a local package mirror or wheelhouse for PyRIT and its dependencies. The PyPI package supports Python 3.10 up to but not including 3.15, and the PyRIT documentation recommends Python 3.13, so the mirror should include wheels for the interpreter version the isolated hosts will run. Use a single interpreter version across the test hosts where possible. Install from the mirror on a clean host with the network disabled to confirm nothing reaches out to the internet. The step is done when pip installs PyRIT from the local mirror and the import check succeeds.
Stage datasets and model weights
The engineer copies the remotely fetched datasets and the Ollama model weights to transfer media, then places them on the isolated network in directories the PyRIT host can read. Keep datasets and weights on a controlled disk with restricted write access. Review each model's license terms before it enters the network, since the license governs how your team may use it. Confirm the dataset and model hashes against the manifest on the isolated side. The step is done when every dataset and model loads from local paths with no remote fetch attempted.
Install Ollama with local-only settings
The platform engineer installs the Ollama runtime from a verified package and sets the OLLAMA_MODELS variable to the directory holding the staged weights. Set OLLAMA_NO_CLOUD=1 in the environment or the server configuration file so cloud features stay off. Ollama binds to 127.0.0.1 on port 11434 by default, so keep that bind address unless a proxy is required, and document any change. Local API calls do not require authentication, so restrict access to the host itself. The step is done when the service starts, lists the staged models, and returns a response to a local prompt.
Point PyRIT at the local endpoint
The engineer configures PyRIT's credentials in ~/.pyrit/.env and its settings in ~/.pyrit/.pyrit_conf so that the objective, adversarial and scorer roles all point to the local Ollama endpoint at localhost:11434. Remove or leave blank any settings for remote providers so that no cloud target is ever selected by accident. Store the configuration files outside source control. The step is done when a single-prompt test through the local endpoint returns a response and the configuration contains no remote provider endpoints.
Set SQLite memory on a controlled disk
The engineer sets PyRIT's memory to the persistent SQLite store, which keeps conversations and results on disk without an external database. Place the database file on a disk with defined permissions, backup policy and retention rules, and confirm that the directory is not shared with unrelated workloads. Plan how the database will be backed up within the isolated network, since no external service will hold a copy. The step is done when a test interaction is written to the SQLite file and can be read back from the controlled location.
Run a test scan with no outbound traffic
Before any red teaming begins, the engineer runs a small test scan with the host's outbound network blocked at the firewall and at the operating system level. Capture egress with a monitoring tool and attempt a deliberate connection to an external address, which must fail. The fail-closed check passes only if the connection attempt is refused and the scan completes against the local endpoint. Save the test output, the egress logs and the firewall rules as evidence for the security review. The step is done when the scan completes and the egress log shows no connections leaving the network.
How the pre-staging and transfer workflow runs
The workflow has two sides of a boundary. On the connected staging host, the team gathers everything the isolated network will need: the PyRIT package and its dependencies, the dataset files, the local model weights for the objective, adversarial and scorer roles, and any runtime installers. Each item is recorded in a manifest with its version and a checksum, and the staging host is the only place where packages are downloaded from public indexes or model hubs. Nothing is installed on the isolated host until this manifest is complete, because the isolated side cannot be used to discover what is missing.
The isolated host is where the bundle is verified, installed and run. Before anything is installed, the receiving team recomputes the checksums and compares them with the manifest, then installs Python packages from a local wheel directory or private index rather than the public one. The organization's transfer controls decide how the bundle crosses the boundary, including who approves the transfer, what media or diode path is used and how the transfer is logged. NERC CIP-013-2 frames the verification of software integrity and authenticity for vendor software and patches, and that same discipline applies to every PyRIT package and model file carried across the boundary. Confirm the controls with your own security and compliance teams, since the standard itself does not prescribe a specific tool.
The governing rule is that no model, dataset or package is pulled from the internet at runtime. Test the rule before the first scan: block outbound connections from the PyRIT host, run a session with network egress disabled, and confirm that the configuration points only at local endpoints such as a local Ollama server on localhost:11434. Any failed fetch during a test is a finding to resolve in the bundle, not a reason to open a temporary route. Keep the manifest with the bundle so that a later upgrade starts from the same staging process.
Security and compliance considerations for isolated PyRIT
An isolated PyRIT host still holds sensitive test prompts, model responses and credentials, so it needs the same controls as any other system in scope. The cards below cover what crosses the boundary, how people reach the host, how the memory file is protected and retired, how cloud credentials are handled, and where to report vulnerabilities in PyRIT itself.
Verify every package crossing the boundary
Every wheel, container image and model file carried into the network should have its source and integrity checked before it is installed. Utilities subject to NERC CIP-013-2 must have supply chain procurement processes that address verification of software integrity and authenticity, and the same discipline applies to PyRIT and its dependencies. Record the hash, the source and the approver for each transfer, and confirm the exact PyRIT version you intend to run is the one you tested.
- Current PyRIT release
- v1.1.0
Control remote access into the host
Access to an isolated PyRIT host should pass through a single controlled entry point, not ad hoc remote desktop or direct shell sessions from office networks. NERC CIP-005-7 illustrates the pattern for high and medium impact systems: an intermediate system with encryption and multi-factor authentication, plus a way to detect and disable active vendor sessions. Confirm who can open a session, log every session, and test that a vendor session can be cut off quickly.
CIP-005-7 textProtect the SQLite memory file
PyRIT's persistent SQLite memory holds every prompt, response and score from your red teaming runs, which can include sensitive content harm examples. Restrict file permissions on the database to the service account, encrypt the disk or volume where it lives, and exclude it from unmanaged backups. Set a retention rule that deletes or archives old runs on a schedule your compliance team has approved, and document it.
Handle credentials for Entra ID and Key Vault
Entra ID and Key Vault access in an isolated network depends on reachable endpoints, which may be private, or on a fully local setup that uses no cloud identity at all. Keep client secrets and tokens out of .env files in shared folders, scope the identity to the minimum roles needed, and rotate any secret that was ever written to plaintext. Confirm with your identity team which endpoints the host can reach and how token refresh works without internet access.
Report PyRIT vulnerabilities privately
If you find a vulnerability in PyRIT itself, report it privately through the Microsoft Security Response Center under the project's security policy rather than opening a public issue. Include the PyRIT version, the configuration involved and reproduction steps, and do not paste live prompts or memory exports into the report. Track whether your isolated deployment is affected by checking the release notes for the version you run.
PyRIT releasesQuestions buyers ask about air-gapped PyRIT
Does PyRIT work fully offline once it is installed?
PyRIT can run without internet access for the parts that matter in an air-gapped network, but only if you plan for each dependency. PyRIT stores its conversations and results in a persistent SQLite memory on disk, so no external database is needed. Some built-in datasets ship inside the package, while others are fetched remotely from sources such as Hugging Face, so those must be staged in advance or replaced with local files. Every target, adversarial model and scorer must also be reachable on your internal network. Confirm each of these against your own build, because a single remote call left in a dataset loader or a scorer can break an isolated run.
What must our team supply before the work starts?
Three groups of people need to act before a partner or internal team can build anything. Network owners must confirm the isolated segment, the allowed traffic paths between PyRIT, the model hosts and the target applications, and how files cross the boundary. Model hosts must provide the local objective, adversarial and scorer models, and confirm where they run and who can administer them. Test approvals must be signed off by the people who own the systems under test, the risk owner and, where relevant, the security team that will act on findings. Ask any proposal to list these inputs and the person who owns each one.
What drives the cost and effort of an air-gapped PyRIT setup?
Effort grows with the number of moving parts, not with PyRIT alone. The main drivers are the number of local models you host, the number of datasets you must stage or replace, the number of environments (for example development, test and a shared red team host), and how deep verification goes. Verification depth includes proving that no network call escapes, checking every package and model file before it crosses the boundary, and documenting the result for reviewers. Your control framework also matters: NERC CIP-013-2 addresses verifying software integrity and authenticity for vendor software and patches, which is why transfer checks are a recurring part of the work. Ask for a quote that prices each model, dataset, environment and verification step separately, and states which parts recur with each update.
Can our team set up air-gapped PyRIT without outside help?
A capable platform or security engineering team can do it, provided it has Python experience, access to the isolated network and a way to host local models. PyRIT installs with pip, and the PyPI package supports Python 3.10 up to but not including 3.15, with Python 3.13 recommended in the documentation. The harder work is staging: collecting wheels, model files and dataset content on the connected side, moving them through your transfer process, and proving the result works offline. Teams without that experience often spend their effort on transfer and verification rather than on PyRIT itself. Be honest about your team's capacity and whether anyone will own the setup after handover.
How long does an air-gapped PyRIT engagement take?
Duration depends on scope and on how quickly the approvals and network changes happen, so no single timeline applies. A small scope with one local model, one environment and bundled datasets is far shorter than a scope with several models, staged remote datasets, multiple environments and formal verification evidence. Most of the elapsed time often sits outside the build, in firewall change requests, model hosting approvals and transfer reviews. Ask a proposal to show the phases, the dependencies on your network and approval teams, and the milestones that need your sign-off. Because engagements are fixed-scope and agreed in writing before work starts, the timeline should follow from that written scope.
What changes when PyRIT or Ollama releases an update?
Each update means repeating the staging and verification steps for every changed component, so plan for recurring work. PyRIT v1.1.0 was released on 4 September 2026, and Ollama v0.40.5 was released on 14 October 2026, with v0.40.6 published as a pre-release on 16 October 2026. Check release notes for breaking changes in PyRIT, and for changes to model storage paths, concurrency defaults and cloud settings in Ollama. The Ollama FAQ describes controlling concurrency with OLLAMA_NUM_PARALLEL and disabling cloud features with OLLAMA_NO_CLOUD=1, so confirm those settings still behave as expected after each upgrade. Request a quote that states who repeats the transfer and verification work per update and how often.
Does local Ollama need an API key in an isolated network?
The local Ollama API on localhost:11434 does not require authentication, so a key is not needed for local inference. Ollama binds to 127.0.0.1 by default, and the OLLAMA_HOST variable changes that bind address if other hosts must reach it. Exposing it beyond the host should go through a proxy that enforces authentication, and the Ollama FAQ describes proxy setups such as Nginx. Direct cloud inference at ollama.com requires a Bearer token, which an isolated network should never need, so disable cloud features with OLLAMA_NO_CLOUD=1 and verify that no outbound calls occur.
What a quote for this work should include
A quote for an air-gapped PyRIT deployment should price the staging design first, because every later cost depends on how packages, datasets and model files cross the boundary. The quote should name the staging host or media process, the mirror of the PyPI packages PyRIT needs, the dataset handling for any built-in sets that are fetched remotely from sources such as Hugging Face, and the local model hosting for the objective, adversarial and scorer roles. Model hosting is often the largest line, since it covers hardware sizing, the runtime (for example Ollama or vLLM), storage for model weights and the work of choosing which models your scoring accuracy requires. Ask the provider to show which of these items are included and which assume hardware you already own.
Security verification of the transfer path is a separate component and should appear as its own line. It covers checking each package and model file for integrity and authenticity before it enters the isolated network, recording those checks as evidence, and documenting the controls that support your procurement and supply chain obligations. Testing of the deployed setup, including confirmation that PyRIT makes no outbound calls and that the local SQLite memory persists correctly, and the documentation your reviewers will read, such as the configuration baseline and the transfer procedure, should also be listed with their deliverables. Ask whether testing is included in the fixed scope or sold as a separate phase.
Separate one-time setup from recurring work in every quote. One-time work includes the staging design, the initial mirror, the first verification run, the model selection and the reviewer documentation. Recurring work includes staged updates of PyRIT and its dependencies, re-verification of each transferred package and model file, and periodic review of the local models as your testing needs change. Ask for the recurring effort per update cycle, what triggers a new cycle and whether a retainer covers it. DeployOpen does not publish prices, and a quote follows from a written scope that sets out these components, deliverables and timelines before work starts.
How PyRIT, local models and staged packages fit inside the boundary
The flow starts on a connected staging host outside the boundary, where packages and models are downloaded and checked. Those artifacts cross through a verified transfer path into the isolated network, where PyRIT calls a local Ollama runtime bound to 127.0.0.1:11434 and the target system. PyRIT writes conversations to SQLite memory on disk and reads local dataset files. Nothing inside the boundary initiates an outbound connection, so the check to make is that no step depends on a remote dataset, model pull or cloud endpoint.
Staged artifacts cross a verified boundary; PyRIT and its components run with no outbound path.
Confirming the design before you build
Before any install, settle three questions in writing: which components must stay inside the isolated network, whether the target and scorers can run on local models, and who approves each transfer across the boundary. Start with the PyRIT target, since that is the system under test. Confirm whether the target is a self-hosted model, a custom HTTP or WebSocket application, or a web app driven through Playwright, because each one needs a reachable endpoint inside the enclave. Then list every scorer. An LLM-based scorer needs a local judge model, and an Azure AI Content Safety scorer needs a cloud service that an air-gapped network cannot reach, so that scorer must be replaced or removed from the design.
Next, map the data. PyRIT memory defaults to a SQLite file on disk, which keeps interactions local without an external database, but the file holds attack prompts and model responses, so decide where it lives, who can read it and how it is backed up. Confirm which datasets your scenarios need, and check which ones are bundled in the package and which are fetched remotely from sources such as Hugging Face. Remote datasets must be exported and staged before the network is isolated. Also confirm the Python version your team will standardize on, since the PyPI package supports Python 3.10 up to but not including 3.15, with Python 3.13 recommended in the documentation.
Finally, name the approvers. Someone outside the testing team should sign off on each package, model weight and dataset carried across the boundary, and the record should show how integrity and authenticity were checked, which NERC CIP-013-2 describes for vendor software and patches if your environment falls under it. Ask who owns the local model runtime, who can change the staging process and how retesting happens after an upgrade. Once those answers exist, take them to the scope conversation with DeployOpen so deliverables, responsibilities and timelines are agreed in writing before work starts.
How DeployOpen scopes and delivers air-gapped PyRIT
DeployOpen plans air-gapped PyRIT as a fixed-scope engagement that starts from your network boundary, your approved local models and the datasets your team needs. The work covers package staging, local model endpoints, persistent memory and the evidence your security team reviews before the first test run.
How we scope
- Map which PyRIT targets, objective models, adversarial models and scorers must run without internet access.
- Confirm which datasets ship inside the package and which must be staged from an approved internal source.
- Agree the written scope, deliverables and timeline with your security and platform owners before work starts.
How we build
- Stage Python packages and wheels for the PyRIT version you approve, verified against your package intake process.
- Configure local model endpoints, environment files and persistent SQLite memory inside the isolated network.
- Test that PyRIT runs end to end with no outbound connections, then document any remaining network dependency.
How we hand over
- Deliver the configuration, staging procedure and network diagram in documents your engineers can follow.
- Provide a runbook for upgrading PyRIT and refreshing packages through the same controlled import path.
- Walk your team through the test results and the memory records they will rely on for review.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover.
- Retest the isolated setup after each approved PyRIT or local model change to confirm nothing reaches outside.
- Confirm support terms, response expectations and coverage in the written scope before you sign.

