Deploying separate CoPyRIT instances for each team

Separate CoPyRIT instances keep each red team, product group or partner's data, secrets, identity and network apart. This page explains what deploy_instance.py creates, what Azure and Entra permissions it needs and what to plan before running it.

On this page

When separate CoPyRIT instances for each team are worth the overhead

PyRIT's deploy_instance.py creates a fully separate CoPyRIT for each team, so a red team, product group or partner gets its own environment rather than a seat on a shared one. Use this route when teams test systems with different data, different access rules or different confidentiality requirements, and when you need to show that one group's findings, prompts and credentials cannot reach another group. The isolation boundary covers each instance's own database, secrets, Entra app registration, Container Apps environment, virtual network and fixed egress IP. Those separate components are what make the boundary meaningful, and they are also what you pay for in setup and upkeep.

Each new instance is a separate deployment to build, identify and maintain, so the overhead grows with the number of instances. Before you commit, confirm that you hold the Azure permissions the deployment needs: Azure CLI 2.84 or later, Python 3.10 or later, Owner on the subscription (or Contributor plus User Access Administrator), and Application Administrator in Entra ID. Check whether your organization's policies allow those roles to be granted to the people who will run the deployment, because that is often the slowest step. Ask who will own each instance after handover, who rotates its secrets and who approves changes to its network settings.

A shared instance with Entra ID group-based access is usually enough when teams work on the same target systems, accept the same data handling rules and can share results under one administrative owner. Separate instances become worth the overhead when a partner must not see your findings, when a regulated business unit needs its own data store and audit trail, or when one team's test targets carry credentials that another team should never hold. Write down the specific separation requirement first, then test whether group membership and separate memory can meet it. If they cannot, plan for one instance per boundary, not one per person.

What is isolated per instance

The diagram starts at the shared Azure subscription and Entra tenant, the only layer that instances have in common. Each team instance is drawn as its own boundary, holding its own Entra app registration, Container Apps environment, virtual network with a fixed egress IP, secrets store and database. The key check is the dashed trust boundary between the two instances: no arrow crosses it, so a compromise or misconfiguration in one team's instance should not reach another's data or credentials. Confirm in the deployment output that every resource name and identity is distinct for each instance.

Each team instance has its own identity, network, secrets and database.

What each isolated instance gets

Each team instance is a full, separate stack rather than a tenant inside a shared app. The components below are what isolation separates, and each one carries its own operating cost that you should price before you commit to more than a few instances.

Dedicated database

Each instance gets its own database, so one team's conversations, attack results and scorer outputs never sit in another team's memory store. Isolation here limits the blast radius of a bad query, an accidental deletion or a data-retention request that applies to one team only. The cost is recurring: every database needs backups, patching and capacity review, and you multiply that work by the number of instances. Ask who owns restore testing for each one.

Separate secrets store

Model endpoints, API keys and other credentials are stored per instance, so a leaked secret for one partner's target does not expose the keys another team uses. Confirm which secrets each instance actually needs, since a shared key quietly undoes the separation. Rotation becomes a per-instance task, and every rotation must be tracked against all deployments that hold the credential.

Entra app registration

Each instance has its own Entra app registration, which gives the team a separate sign-in surface and separate access grants. Group membership decides who can reach the instance, so a partner's users never see another team's sessions. The overhead is administrative: every registration needs ownership, redirect URI upkeep and periodic review by someone with Application Administrator rights.

Container Apps environment

Each instance runs in its own Container Apps environment, which keeps compute, scaling and revisions for one team from affecting another. A failed upgrade or a heavy test run stays contained to that instance. The trade-off is cost and drift: separate environments are billed separately, and each one must receive the same CoPyRIT version and configuration changes as the rest.

Virtual network and fixed egress IP

Each instance has its own virtual network and a fixed egress IP address. Targets that allow-list source addresses can then recognize traffic from one team only, and network rules for one partner do not widen access for another. Ask the target owners to allow-list the egress address, and plan for the address to change if you redeploy the network.

Per-team URL and access path

The result is a distinct URL and sign-in path for each team, so a partner is directed to their own instance and not a shared front door. Access is checked at the instance boundary, which makes reviews simpler to explain to auditors. Keep a register of which URL belongs to which team, because a wrong bookmark or stale link is the most common way people reach the wrong environment.

Choosing between shared, group-isolated and fully separate instances

One CoPyRIT deployment serves every red team member, and Entra ID groups decide who can sign in and who can reach configuration routes. All teams share one database, one set of secrets, one app registration and one network path, so separation happens at the access layer rather than the infrastructure layer. This is the lowest operational load because you maintain a single Container Apps environment, a single Azure SQL database and a single set of Key Vault secrets.

  • Data separation: Conversations, attack results and scores from all groups sit in the same memory store, so any user with read access to the shared database can see other teams' work unless your own process limits it.
  • Identity separation: Users share one Entra app registration. Access depends entirely on group membership and the separate admin group, so group hygiene becomes a critical control.
  • Operational load: One upgrade, one backup policy and one set of rotation tasks cover everyone.
  • Ownership: Usually the central security or AI assurance team, which owns the group model and the audit trail.

Group gating is a separate configuration task. Confirm how group IDs map to access before relying on this option for anything sensitive, and see the Entra ID group access topic for the exact settings.

How to run deploy_instance.py for a new team instance

This sequence takes a platform owner from prerequisites to a verified, separate CoPyRIT instance for one team, with its own database, secrets, app registration, network and fixed egress IP. Each step ends with a check you can record before moving on.

  1. Confirm Azure CLI and Python versions

    The engineer who will run the deployment checks the local toolchain before touching any subscription. Run az version and confirm the azure-cli version is 2.84 or later, then run python --version and confirm Python is 3.10 or later. If either check fails, upgrade the tool and repeat the check. The step is done when both version outputs are saved in the deployment record.

  2. Confirm subscription and Entra ID roles

    The deployer confirms the Azure role on the target subscription. Owner works, and so does the pair of Contributor plus User Access Administrator. Ask the tenant administrator to confirm the deployer holds Application Administrator in Entra ID, because the deployment registers a new app. Run az role assignment list --assignee <your-user-id> --all and check the output for the required roles. The step is done when the role list is saved and the Entra role assignment is confirmed in writing by the administrator.

  3. Get the v1.1.0 infrastructure files

    Clone the PyRIT repository or pull the existing clone, then check out the v1.1.0 tag so the Bicep templates and scripts match the release the team has reviewed. Read the infra/DEPLOY_NEW_INSTANCE.md file at that tag before running anything, since it documents the parameters and expected inputs. Confirm with git describe --tags that the checkout reports v1.1.0. The step is done when the tag matches and the instructions file has been read by the deployer.

  4. Run deploy_instance.py with a unique name

    From the infra directory, run deploy_instance.py and supply an instance name that identifies the team, such as the group or program name. The name drives resource naming, so a clash or a vague label makes later audits harder. Keep the console output, which records each resource the script creates. The step is done when the script exits without error and the output names the instance you chose. If it fails partway, check the error before rerunning, because partial resources may remain.

  5. Verify the created Azure resources

    Confirm that the resource group holds the separate components this instance needs: the Container App and its environment, the virtual network, the NAT gateway with its public IP, the database, and the Key Vault. Also confirm the Entra app registration exists under the instance name. Use az resource list --resource-group <group-name> --output table and compare against the list in the setup guide. The step is done when every expected resource is present and none belongs to another team's instance.

  6. Record the egress IP and endpoint

    Note the fixed egress IP address from the NAT gateway public IP resource, and the endpoint URL of the Container App. Give the egress IP to any target owner who needs to allow-list traffic from this team's instance. Store both values in the team's deployment record next to the instance name. The step is done when the egress IP and endpoint are written down and the target owners confirm they have the egress address.

  7. Test sign-in and access boundaries

    Open the endpoint in a browser and sign in with an account from the team's allowed Entra group. Confirm the sign-in succeeds and the team's workspace loads. Then sign in with an account from a different team's group, or an account in no group, and confirm access is refused. The step is done when the allowed account gets in, the other account is refused, and both results are recorded before the instance is handed to the team.

Deployment choices for each instance and when each fits

This table compares the decisions you make before running deploy_instance.py for each team, partner or product group. Read each row as a question to settle first, then use the confirm column to check the exact prompts and resources in the script output. The main takeaway is that isolation is set per instance, so decide naming, placement and exposure before the first deployment.

ChoiceWhat it changesWhen it fitsWhat to confirm
Naming and instance countEach instance gets its own database, secrets, app registration, Container Apps environment, virtual network and fixed egress IP, so every added instance is a separate set of resources.One instance per red team, product group or partner that needs its own data and access boundary.The name prefixes and resource names the script generates, and whether names are reusable after teardown.
Subscription or resource group placementDetermines which Azure permissions, quotas, billing and policy assignments apply to each instance's resources.Separate subscriptions when a partner or business unit needs billing or policy separation; shared subscription when one central team operates all instances.Which resource groups the script creates or expects, and whether your Azure Policy assignments block any of them.
Network exposureSets whether the instance is reachable through public access paths or private paths, which changes who can reach the web app and how traffic leaves.Public access paths for teams on managed networks with Entra sign-in; private paths when the instance must stay off the internet.Which ingress and Private Link options the script enables by default, as described in the Container Apps topic, and the fixed egress IP it reports.
Database sharing versus separationA shared database mixes conversations and results across teams; a separate database keeps each team's memory and findings apart.Separate databases for partners or teams with different data handling rules or evidence retention; shared only when one team operates all instances.Whether the script creates one Azure SQL database per instance, and how backups and retention are set for each.
Own app registrationEach instance has its own Entra app registration, so sign-in, redirect URIs and group gating are managed per instance.Separate registration when each team has its own Entra admin group and must control access independently.Which Application Administrator role your account needs, and which redirect URIs the script registers.
Secrets handlingEach instance keeps its own secrets, so rotating or revoking one team's credentials does not affect others.Any multi-team setup where credential rotation or access revocation must stay independent.Where secrets are stored for each instance and who holds permission to read them.

The Azure and Entra permissions the deployment needs

Standing up a separate CoPyRIT instance touches both your Azure subscription and your Entra ID tenant, so two different administrative roles are involved. The cards below cover the roles, the tooling versions and who should hold each permission.

Subscription role for the deployment

The deployment creates resources such as the Container App, virtual network, NAT egress, Azure SQL and Key Vault, and it assigns roles along the way. Either Owner on the subscription, or Contributor plus User Access Administrator, is needed to do that. Check which option your subscription policy allows, because Contributor alone cannot grant the role assignments the deployment depends on.

Deployment guide

Entra Application Administrator

Each instance registers its own Entra app, so the person running the script needs Application Administrator in Entra ID. Without it, the app registration step fails after Azure resources may already exist. Confirm this role is granted in the tenant that owns the subscription, since a guest or cross-tenant account may hold the Azure role without the Entra role.

Azure CLI 2.84 or later

The deployment script relies on Azure CLI features introduced by version 2.84, so older installed versions are a common cause of early failures. Check with az version on the machine that runs the script, and pin that version in your runbook so the same deployment can be repeated later. Run it from a managed workstation or build agent rather than a personal laptop where possible.

Python 3.10 or later

The deploy_instance.py script requires Python 3.10 or later. Use an isolated virtual environment for the run so the script's dependencies do not collide with other tooling on the machine. Record the interpreter version alongside the CLI version in your change record, since both affect whether a re-run produces the same result.

Who should hold these roles

Separate the people who run the script from the people who use each instance. The operator needs the temporary elevated roles only for deployment, and these should be time-bound and removed afterward. Red team members, product group users and partners should get application access through Entra groups, not subscription or directory roles. Ask your security team to approve who holds each role and to review the assignments after each deployment.

Questions teams ask before deploying separate CoPyRIT instances

What does the effort for separate CoPyRIT instances depend on?

The effort depends mostly on how many instances you need, how much each one differs from the others, and how much of the surrounding environment already exists. Each isolated instance gets its own database, secrets, Entra app registration, Container Apps environment, virtual network and fixed egress IP, so every instance repeats those components. Work grows with the number of teams, with any difference in access groups or network paths, and with how many approvals your cloud and identity teams must give. Azure consumption for each instance recurs monthly, while the initial deployment and handover are one-time costs. Ask any partner to split the quote into one-time setup, per-instance work and recurring Azure spend, and to state which of those they pay for.

Who pays for Azure resources and consulting time?

Your organization pays Azure directly for the subscription resources each instance creates, because the deployment runs in your subscription. Consulting time is a separate cost paid to whoever plans and runs the deployment, whether that is your own engineers or an outside partner. Azure costs recur for as long as an instance runs, so unused instances are a common source of waste. Ask for a written scope that names the Azure resources in each instance, the people doing the work, and who keeps the cost reporting and tagging after handover.

How long does setting up an isolated instance take?

Duration depends on approvals and prerequisites more than on the deployment script itself. The Azure CLI, Python version and roles must be in place, and the network, identity and naming choices must be settled before the first run. The first instance usually takes longest because your teams learn the approval path and naming conventions, and later instances can reuse those decisions. Ask for a timeline that shows which steps wait on your network, identity or procurement teams, since those waits usually decide the schedule.

Can an internal team deploy and run these instances alone?

Yes, an internal platform or security engineering team can deploy and run them if it has the Azure and Entra skills and the right roles. The deployment process is documented in PyRIT's own infrastructure guide, which lists the Azure CLI version, Python version, subscription roles and Entra role needed. The harder ongoing work is operating several instances: patching, rotating secrets, reviewing access groups and watching cost. Teams with a small platform group often start with one instance and decide later whether to take on the rest. Confirm that someone owns each instance by name before you go live.

What does the work need from our side?

The work needs four things from your organization. The person running the deployment needs Owner on the subscription, or Contributor plus User Access Administrator, and the Application Administrator role in Entra ID. Your network team must approve the virtual network ranges and the fixed egress IP for each instance, and your security team should review the egress and exposure choices. You also need named owners for each instance who can approve access changes and respond to incidents. Confirm these roles and approvals in writing before the schedule is fixed, because the deployment cannot proceed without them.

How do we add a new team to an existing setup?

A new team gets a new instance, not a new group inside an existing one, because each instance has its own database, secrets and network. The steps repeat the original deployment: confirm the subscription roles, choose names and address ranges that do not clash with existing instances, run the deployment, and then set the Entra groups that control who can sign in. Your identity team should map the new team's access groups before the instance is opened to users. Ask for a short checklist that your owners can reuse, so each new team follows the same steps.

How do we retire an instance safely?

Retiring an instance means stopping new use first, then removing the resources it created, and keeping any records your policies require. Because each instance has its own database and secrets, you can delete its resources without affecting other teams, but you must first decide what happens to conversations and results stored in its database. Revoke the Entra app registration and group access, remove the stored secrets, and confirm that the egress IP and network ranges are no longer in use. Ask for a retirement checklist that names who approves deletion and who keeps any exported evidence.

Limits to confirm in your own environment

The deployment source sets out prerequisites and what each instance gets, but it does not settle how far the pattern stretches in your tenant, subscription and policy set. The cards below list the limits to confirm with Microsoft documentation or a test deployment before you commit to one instance per team.

Azure regional availability

Confirm that every service the instance needs, including Container Apps, Azure SQL, Key Vault and NAT gateway, is offered in the region you plan to use for each team. Region choice also sets data residency for each team's test prompts and results. Ask whether a team in another jurisdiction needs its own region, which changes the instance count and the networking design.

Subscription quota limits

Each instance creates its own Container Apps environment, virtual network and fixed egress IP, so quotas for those resources multiply with the team count. Check the current limits for Container Apps, public IP addresses and virtual networks in the subscription, and request increases before the first rollout. A quota failure partway through a batch deployment leaves some teams with half-built instances.

Deployment guide

Recurring cost per instance

Each instance carries its own Azure SQL database, NAT gateway with a fixed egress IP, virtual network and Container App, so idle instances still generate charges. Ask your Azure account team or use the pricing calculator to model the monthly cost of each tier at your team count. Decide early whether teams share a database server or sit on separate ones, because that choice changes both cost and blast radius.

Upgrades across many instances

The deployment guide covers creating an instance, not how to roll a new PyRIT or CoPyRIT release across several instances without breaking active campaigns. Define the order of upgrades, a test instance to upgrade first, and how each team is told about downtime. Confirm whether the infrastructure templates can be re-run against an existing instance without replacing the database or secrets.

PyRIT releases

Naming and governance policies

The script creates resources and an Entra app registration under names and tags it chooses. Check whether those names fit your resource naming standard, your tagging policy for cost allocation, and any Azure Policy that restricts regions, SKUs or public network access. A failed policy check often shows up only after the first deployment attempt, so run the script against a sandbox subscription that enforces the same policies.

Conditional access and tenant rules

Entra conditional access policies can block the app registration consent, the device-code sign-in used by CLI clients, or access from a team's network. Confirm with your identity team how new app registrations are approved, whether Application Administrator is granted to the deploying engineer, and which sign-in conditions apply to red team members. Test sign-in for one team end to end before you repeat the process for the rest.

How DeployOpen plans the isolation boundaries with your team

Before any Azure resource is created, DeployOpen works with your team to decide which groups get their own CoPyRIT instance and which can share one. The usual boundaries are a red team, a product group, or an external partner whose testers should never see another group's prompts, findings or stored conversations. For each boundary we record the Entra ID groups that will sign in, the people who administer the instance, the subscription or resource group it lives in, and the network path its users take. Every instance gets its own database, secrets, Entra app registration, Container Apps environment, virtual network and fixed egress IP, so these decisions map directly onto separate resources that must be named, tagged and owned from day one.

Scope and deliverables are agreed in writing before work starts. The written scope lists the instances to deploy, the Azure subscription and tenant that will hold them, who on your side holds Owner or the equivalent role, who holds Application Administrator in Entra ID, and what DeployOpen will hand over. The deployment runs inside your tenant with your accounts, so DeployOpen works under access you grant for the engagement, and you keep the ability to review, revoke and audit it. Confirm with your Azure and Entra administrators that the required Azure CLI version, Python version and role assignments are available before you sign the scope, because a missing permission is the most common reason a planned instance cannot be built as written.

Once each instance is running, DeployOpen documents it so your team can operate it without us. The record covers the owner and backup owner for each instance, the access list for user and admin groups, where secrets and database credentials are stored, how egress addresses are shared with systems that allow-list them, and the steps to rotate credentials. It also defines retirement: how an instance's data is exported or deleted, how its app registration and network resources are removed, and who signs off. Ask for this record as a named deliverable in the quote, and agree on how often ownership and access reviews will run, since a shared instance that outlives its team is a common source of stale access.

How DeployOpen scopes, delivers and supports this deployment

DeployOpen plans, builds, documents and supports self-hosted open-source platforms inside your own cloud accounts and networks. For separate CoPyRIT instances, we start from a written scope that names each team, instance and permission the deployment needs, then build and hand over each instance with its own isolated resources.

How we scope

  • Inventory the teams, product groups or partners that need an instance and the subscriptions each will use.
  • Confirm who holds Owner or Contributor plus User Access Administrator rights and Application Administrator in Entra ID.
  • Agree in writing which resources each instance gets, including database, secrets, app registration, network and egress IP.

How we build

  • Run the deployment script once per instance, keeping naming, parameters and resource groups consistent across all of them.
  • Verify that each instance has its own database, secrets, Entra app registration and virtual network with no shared access paths.
  • Confirm the fixed egress IP for each instance and record it for the target systems that need to allow-list it.

How we hand over

  • Deliver a per-instance record of resource names, owners, identities, group assignments and egress addresses.
  • Document the prerequisites, Azure CLI and Python versions, and the permission checks used before each deployment run.
  • Walk your platform and security teams through access review, secret rotation ownership and how to add or retire an instance.

How we support

  • Offer ongoing support, upgrades and continuous testing for your instances as a retainer after handover.
  • Plan PyRIT and CoPyRIT version upgrades per instance so each team can move on its own schedule.
  • Retest access boundaries and network exposure after changes to groups, subscriptions or egress configuration.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.