Can a self-hosted PyRIT replace the Foundry red teaming agent for our team?
Yes, for most of the attack families, provided you treat the move as a mapping, scoring and evidence exercise rather than a data import. Microsoft's AI Red Teaming Agent in Foundry uses PyRIT's red teaming capabilities together with Foundry Risk and Safety Evaluations, and its attack strategies, including Base64, ROT13, Leetspeak, Flip, Tense, Crescendo and Multi turn, come from PyRIT. That shared base means a self-hosted PyRIT can run the same family of techniques. What it does not give you is the managed risk categories, evaluation pipeline or report format, so each category your team reports on has to be matched to a PyRIT scenario, dataset and scorer that you can explain to an auditor.
The main reason teams look at self-hosting is coverage. Microsoft lists cloud red teaming in Foundry as available in East US 2, France Central, Sweden Central, Switzerland West and US North Central, and agentic risk categories run only in cloud runs against Foundry agents. The Foundry agent also does not support non-Foundry agents or non-Azure tools. If your assistant runs on another cloud, on-premises, or calls tools outside Azure, a self-hosted PyRIT setup with custom HTTP or WebSocket targets is the path to testing it. Confirm the current region and agent list against the Microsoft Learn page before you commit, since the managed service may change.
On effort, the answer depends on how many targets, risk categories and evidence obligations your team carries, not on how much data you have to move. A single chat endpoint with two risk categories is a small job. Many targets, agentic tools and a requirement to keep reproducible memory records for review is a larger one. Ask any partner for a written scope that lists each target, each category, the scorer used for each one, and the evidence each reviewer expects, because those items drive the work and the recurring cost of re-running tests after each model or prompt change.
Which Foundry red teaming capabilities map to PyRIT
This table compares each capability in the Foundry AI Red Teaming Agent with its closest PyRIT equivalent and notes what changes when you run it yourself. Rows marked for confirmation need the exact category or strategy list checked against current Foundry and PyRIT documentation before you assume a match. Use it as a checklist when scoping which evidence you can reproduce in your own environment.
| Foundry capability | PyRIT equivalent | Migration notes |
|---|---|---|
| Attack strategies (Base64, ROT13, Leetspeak, Flip, Tense, Crescendo, Multi turn) | Converters for encoding and transformation, plus multi-turn attacks such as Crescendo | Strategies come from PyRIT, so the core set is available. Confirm exact names and parameters against the PyRIT scenario documentation for your version. |
| Foundry AI Red Teaming Agent run | PyRIT RedTeamAgent scenario run through pyrit_scan | Same underlying engine, but you own the target registration, dataset choice and run configuration. Confirm the scenario's default strategy set before comparing results. |
| Foundry Risk and Safety Evaluations | PyRIT scorers using LLM judges, Azure AI Content Safety or custom logic | Scoring is not identical to the managed evaluators. Confirm which harm categories and thresholds each scorer produces, and record your scorer choice as evidence. |
| Agentic risk categories | Custom scenarios and targets for your own agents and tools | Foundry limits agentic categories to cloud runs against Foundry agents. PyRIT can target custom HTTP or WebSocket endpoints, but agentic coverage must be designed and confirmed by your team. |
| Cloud run regions | Your own infrastructure and chosen model endpoints | Foundry lists specific regions for cloud runs. With PyRIT, region is a deployment decision you control, so confirm data residency for both the target and any adversarial or scoring model. |
| Foundry-managed reporting | PyRIT memory in SQLite or Azure SQL, with exported results | You build the reporting view and retention rules. Memory records are yours to keep, back up and protect, and must be planned before the first run. |
What the managed service provides that you must rebuild
When you move from the Foundry AI Red Teaming Agent to self-hosted PyRIT, Microsoft stops operating the runtime for you. The managed service runs the cloud red teaming job in a supported Azure region, combines PyRIT's attack strategies with Foundry Risk and Safety Evaluations, and presents results in Foundry's evaluation views. The regional run is also the only place the agentic risk categories apply, and those apply only to cloud runs against Foundry agents. Check the Microsoft Learn page on the AI Red Teaming Agent for the current region list and category coverage before you assume any of these capabilities carry over to your own environment. Your team should also confirm whether the agentic categories you care about can be expressed as a PyRIT scenario against your own targets, because the managed service does not support non-Foundry agents or non-Azure tools.
In exchange, your team takes on the operational work the managed service hid. You host PyRIT in an environment you control, choose and size the memory store (SQLite or Azure SQL), and manage credentials through ~/.pyrit/.env and settings through ~/.pyrit/.pyrit_conf. Someone must also schedule runs, rotate the secrets they depend on, and keep the installed PyRIT version pinned to one you have tested. The documented scanner path is pyrit_scan, so the runs you schedule will call that command against registered targets. PyRIT does not produce a finished assessment report for you, so you will write the report template, map findings to your risk taxonomy, and decide who triages each result.
The most important decision left to your team is how results are reviewed and retained. Before the first production run, define who reviews flagged conversations, how long raw prompts and model responses are kept in memory, where that data sits, and who may read it. Those retention choices affect privacy and evidence obligations, so involve your security, legal and compliance owners early. Confirm these points with your own environment and governance requirements rather than assuming the managed service's retention settings will match yours. Do not treat PyRIT as a drop-in replacement with feature parity: the documentation supports the scanner, memory and scorer capabilities described here, but any hosted dashboard or integrated evaluation view you relied on must be planned as a separate piece of work.
Which documented paths move configuration and results
The documented PyRIT paths cover how a Foundry-aligned scenario runs, where configuration and results live, and which targets replace the managed agent's scope. No supplied source documents a conversion of Foundry runs into PyRIT memory, so treat migration of past results as an open question to settle with Microsoft or your Foundry admin.
Foundry-aligned scenario documentation
The PyRIT Foundry scenarios page explains how a scenario that mirrors the managed agent's risk categories and attack strategies is run locally. Use it to map each Foundry risk category and strategy you rely on to a PyRIT scenario or technique, and record any gap. Confirm against the page version you pin, because the managed agent and the open-source scenario can differ in dataset defaults and scoring.
Foundry scenarios docspyrit_scan for registered targets
The pyrit_scan command runs a named scenario against a target you have registered in your own environment. This replaces the managed service's run setup, so your team owns target registration, dataset choice and run invocation. Check that each target your Foundry runs covered is reachable from the scanning host before you commit to a migration plan.
Memory in SQLite or Azure SQL
PyRIT stores conversations and results in SQLite or Azure SQL, and that store becomes your evidence base after migration. Decide which backend fits your retention and access controls before the first run, and ask who can read and export it. Do not assume that results from the managed service appear in this store.
Configuration in .env and .pyrit_conf
Credentials are read from ~/.pyrit/.env and settings from ~/.pyrit/.pyrit_conf. Keep secrets out of shared configuration files and decide how these files are provisioned on each runner. Confirm the file locations and key names against the documentation for the release you pin, since configuration changes between versions.
Targets beyond the Foundry agent
PyRIT targets include OpenAI, Azure, Anthropic, Google and Hugging Face models, custom HTTP or WebSocket endpoints, and web apps driven through Playwright. This widens the target scope beyond what the Foundry agent supports, which excludes non-Foundry agents and non-Azure tools. Inventory the systems you need to test and confirm which target type each one requires.
Version pinning on the releases page
The PyRIT releases page lists each version and its changes, so you can pin the exact release your assessments were designed around. Pin the version in your pipeline and record it with each run so results stay comparable over time. Review release notes before each upgrade, because breaking changes affect scenario and configuration behavior.
PyRIT releasesHow the parts fit after the move
The diagram starts with the Foundry path, where a cloud run in your Foundry project goes through the AI Red Teaming Agent, Risk and Safety Evaluations and hosted results. The self-hosted path starts with pyrit_scan inside your own network, which reads credentials from ~/.pyrit/.env and calls a registered target. Converters, attacks and scorers run inside that boundary and write to SQLite or Azure SQL memory. The security team reviews an exported report, so check where the memory store lives and who can read it.
Foundry hosted run compared with a self-hosted PyRIT scan inside your trust boundary.
How to move in five phases with a parallel run before cutover
The sequence moves assessments from the Foundry agent to self-hosted PyRIT without a gap in evidence, and it ends with a documented decision to retire the managed runs. Each phase produces an artifact that a named owner signs off before the next phase starts.
Inventory current Foundry runs and categories
The AI platform lead and the compliance owner list every Foundry red teaming run in use, including the target agent or model, the risk categories tested, the attack strategies enabled, the cloud region, and the schedule or pipeline that triggers each run. Note which runs use agentic risk categories, because those apply only to cloud runs against Foundry agents. Mark any run that feeds an audit, customer questionnaire or regulator request. The inventory is complete when the security lead has signed off a table that maps each Foundry category and strategy to a PyRIT scenario, technique or scorer, with gaps flagged for follow-up.
Confirm the target can be registered
The platform engineer registers one representative target in PyRIT, typically a custom HTTP or WebSocket endpoint, or a web application driven through Playwright if the system under test is a chat UI without a clean API. Confirm that the endpoint accepts the same prompts and returns responses PyRIT can score, and that credentials load from the environment file rather than from source code. Note that the Foundry agent does not support non-Foundry agents or non-Azure tools, so this step tests whether the target you need can be reached at all. The pilot is ready when a small dataset run completes end to end and the output is saved to memory.
Run a pilot on one target with a small dataset
The red team lead runs a first PyRIT scenario against the registered target with a limited dataset, chosen so the run finishes quickly and covers the highest-priority risk categories from the inventory. The lead checks that the techniques, scorers and objectives match the categories mapped in the first phase, and records any category that has no PyRIT equivalent. The output is a pilot report listing scenario settings, dataset size, scores, errors and the memory location of every conversation, reviewed and accepted by the security lead before the parallel run begins.
Run both systems against the same target
The red team lead runs the Foundry agent and PyRIT against the same target version, in the same window where possible, using the mapped categories and comparable attack strategies. The team keeps both sets of results and records the target version, model settings and any configuration change, so differences can be traced. The security team then compares findings category by category: which failures appear in both systems, which appear in only one, and where scorers disagree. The period length is set by the team's evidence obligations, not by a figure in this page, so the compliance owner should confirm it in writing before the parallel run starts. The artifact is a side-by-side comparison with a decision on every disagreement.
Cut over scheduled assessments and CI use
The platform engineer moves scheduled assessments and any pipeline steps from the Foundry agent to PyRIT, using the pyrit_scan command for the agreed scenarios and storing configuration in the team's secrets store. The change is approved by the security lead and the owner of each pipeline. Confirm that memory labels identify each run and that attack content stays out of job logs. Cutover is complete when two consecutive scheduled runs finish on PyRIT, produce the agreed report format, and the compliance owner confirms that the evidence fields they need are present.
Decommission Foundry runs after evidence sign-off
The compliance owner confirms in writing that the evidence requirements for each Foundry-run category are met by PyRIT outputs, including retained records for any audit or customer review that refers to earlier Foundry results. Only after that sign-off does the platform team disable the Foundry runs and remove their schedules and access grants. The retention of historical Foundry reports is agreed with the compliance owner and recorded in the migration file. Decommissioning is complete when the owner has signed the final decision record and the disabled runs appear in the change log.
What drives the effort and cost of the move
This table compares the scope decisions that change how much work the move takes and what a quote should cover. Read each row against your own inventory of targets, categories and evidence needs, then ask the partner to price the written scope rather than a generic migration. The main takeaway is that target count, agentic coverage and evidence requirements usually move effort more than the choice of PyRIT itself.
| Driver | What increases effort | What to ask for in a quote |
|---|---|---|
| Number and type of targets | Many Foundry agents, or non-Foundry agents and non-Azure tools that need custom PyRIT targets over HTTP, WebSocket or Playwright | A list of named targets with type, hosting location and the PyRIT target class or connector planned for each |
| Risk categories and attack strategies in scope | Matching every Foundry category and strategy, then adding custom datasets, converters and scenarios for gaps | A mapping table from each Foundry category and strategy to the PyRIT scenario, dataset or technique that covers it |
| Agentic risk categories and target location | Agentic categories only run in cloud runs against Foundry agents, so self-hosted agents need a separate test design | Confirmation of which agentic categories are in scope and where each target runs, plus the test approach for any non-Foundry agent |
| Scorer design | Azure AI Content Safety, LLM judges and custom logic each need configuration, calibration and accuracy checks against sample responses | The named scorers, their service dependencies, and the method for checking scorer accuracy before results are relied on |
| Memory storage and retention | Azure SQL needs provisioning, access control and retention rules; SQLite needs file protection, backup and a documented location | The chosen memory backend, retention period and deletion process, written against your records policy |
| Secrets and Python environment | Targets that need separate credentials, Key Vault integration, and a mixed Python 3.10 to 3.14 fleet under the PyPI support range | The secrets store to be used, the Python version pinned for the team, and the environment build method for CI runners |
| Evidence and reporting requirements | Auditors or internal risk teams asking for traceable memory records, sign-off workflows and a defined report format | A sample evidence pack, the reviewers named, and the fields each finding must carry before the work starts |
| Parallel run length | Running the Foundry service and PyRIT side by side for an extended period means two result sets to reconcile and compare | The parallel run period, comparison criteria, and who signs off the switch-over decision |
What usually goes wrong when teams leave the managed agent
Most failures in this migration come from assuming the managed agent and PyRIT behave the same way, or from running both in parallel without controls. The cards below cover the mistakes that make results hard to compare, lose history or expose credentials and attack content.
Assuming category lists match
Teams often copy the Foundry risk categories and attack strategies into a PyRIT plan and assume each maps to a scenario of the same name. Map each category to a PyRIT scenario, technique and dataset against the current PyRIT documentation for the version you run, and record any gaps. Confirm the Foundry strategy names, such as Base64, ROT13 and Crescendo, against the PyRIT release you pin before signing off the mapping.
Foundry scenarios docsTurning off Foundry before export
Once Foundry runs stop, their results and conversation records may be hard to retrieve. Before you disable the managed agent, confirm in writing how you will export run results, scores and attack conversations, and test that the export opens and can be read. Keep the exported set with the PyRIT memory records you create during the parallel period so the history stays in one place.
Scorers that disagree
If PyRIT scores responses with a different judge than the one Foundry used, the two runs can disagree on the same output and the trend line breaks. Run both systems against a shared set of sample responses, compare the verdicts, and document the scorer and threshold for each category. Treat results as comparable only after the agreement is measured and accepted by the people who own the findings.
Attack content in CI logs
Pipeline logs are often readable by a wide group and retained for a long time. Adversarial prompts and harmful model outputs printed to a build log can spread beyond the security team. Keep attack content out of job output, write results to a restricted store, and check that the pipeline does not echo prompt files or verbose debug output before you enable the scan on shared runners.
Credentials in history or repos
Teams moving quickly often pass model keys on the command line or paste them into a shell, which stores them in history, and sometimes commit the .env file to a repository. Store credentials in your managed secrets service and load them at run time, keep ~/.pyrit/.env out of version control, and confirm that the target keys are scoped to the test environment and rotated after the pilot.
Version drift between runners
A pilot laptop on one PyRIT release and a production runner on another can produce scores and scenario results that cannot be compared. Pin the PyRIT version and Python interpreter in the same lock file for every environment, record the version in each run's labels, and review the release notes before upgrading any runner. Check that a run on each environment returns the same results against a fixed test target.
Questions teams ask before moving off the Foundry red teaming agent
How much does moving off the Foundry red teaming agent cost?
The cost depends on the written scope, not on a list price, because DeployOpen does not publish one. The main drivers are how many target systems and agents are in scope, which risk categories and attack strategies the parallel run must match, how much memory and scoring setup is needed, and whether CI integration is included. Ask for a quote that separates one-time work (environment build, scenario mapping, parallel run and handover) from recurring work such as retesting or a retainer, and that names the Azure, model and compute usage you will pay for directly. Your own cloud and model API charges continue regardless of who does the setup.
How long does a move from the Foundry agent to self-hosted PyRIT take?
The timeline is set by the number of targets, the number of risk categories you need to reproduce, how quickly your team grants access, and how long the parallel run must last before you trust the new results. Scope and scheduling are agreed in writing before work starts, so ask for a timeline that lists each phase and the client dependencies that could delay it. Expect the parallel run to take longer than the build itself if your reviewers need time to compare outputs across both systems.
What does the work need from our team?
Plan for four inputs before the engagement starts:
- Azure access to the subscription, resource group and model deployments PyRIT will call, with a service identity that follows your least privilege rules.
- Access to each target, including test endpoints, agent APIs and any web chat front end.
- A named reviewer who reads results, signs off on scoring decisions and owns findings after handover.
- A decision on memory storage: SQLite or Azure SQL, where it lives, how long records are kept and who can read them.
Can our team move off the Foundry agent without a partner?
Yes, if your engineers are comfortable with Python packages, environment configuration, Azure identity and reviewing AI output. PyRIT is an open-source framework you install with pip, and its documentation covers the Foundry scenarios. A partner adds value where the work is wide rather than deep: mapping each managed risk category and attack strategy to a PyRIT equivalent, building repeatable CI runs, running the parallel comparison and documenting the evidence your compliance team will ask for. Ask any partner to show which parts of the work they will hand over to you.
Can existing Foundry red teaming results be carried over to PyRIT?
Whether results can be carried over depends on what your Foundry runs exported and whether those records map to PyRIT's memory schema. Export the results you need for evidence first, then compare the fields with PyRIT's memory and scoring outputs. Do not assume a direct import. Confirm the export format, the risk categories and the scorer identifiers with Microsoft and in your own environment, and keep the original Foundry records as they are so auditors can still follow the history.
Can PyRIT test agents that are not built on Foundry or Azure tools?
Microsoft's documentation states that the Foundry agent does not support non-Foundry agents or non-Azure tools, so this is the main reason teams add PyRIT. PyRIT supports custom HTTP and WebSocket endpoints and web app targets driven through Playwright, so agents hosted elsewhere can be reached if you can expose a suitable interface. Confirm the exact connection method for each agent, including authentication, tool calls and session handling, during scoping.
What happens to scoring consistency during the parallel run?
During the parallel run, the same prompts go to the same target through both systems, and reviewers compare how each scores the responses. Scores will not match exactly because the Foundry agent uses Risk and Safety Evaluations while PyRIT uses its own scorers, which may be LLM judges, Azure AI Content Safety or custom logic. Plan a calibration step where reviewers label a sample of responses by hand, record disagreements, and decide which scorer becomes the reference for each category before you retire the managed service.
How DeployOpen scopes and delivers a PyRIT migration
DeployOpen plans the move from the Foundry AI Red Teaming Agent to self-hosted PyRIT as a written, fixed-scope engagement. We map the risk categories and attack strategies you rely on to PyRIT components, build the scenario and scoring setup inside your own environment, and hand over documented runs your team can repeat. Ongoing support and retesting are available as a retainer.
How we scope
- We inventory the Foundry red teaming runs, risk categories and attack strategies your team uses today.
- We record which targets sit outside the managed service, such as non-Foundry agents or non-Azure tools, and plan how each is reached.
- The written scope names deliverables, environments and timelines before any build work starts.
How we build
- We install and configure PyRIT in your infrastructure, with credentials and settings held in your secret handling process.
- We map each in-scope attack strategy and risk category to a PyRIT technique or scenario and document any gaps.
- We set up scoring and memory storage, then test the scenarios against your targets before they are used for assessments.
How we hand over
- You receive the configuration, scenario definitions, run procedures and a record of what the managed service did that PyRIT does not.
- Your team runs a supervised pilot so the operators can repeat the scans and read the results on their own.
- We deliver findings from the migration test runs with fixes and a retest where the written scope includes one.
How we support
- Ongoing support covers PyRIT upgrades, configuration changes and new targets, available as a retainer.
- Continuous testing can be scheduled against your targets so results stay comparable over time.
- Before you commit, ask us to confirm which Foundry capabilities your environment still needs and which have no PyRIT equivalent.

