When a fixed prompt script is the right multi-turn test
A team that already knows a conversational jailbreak against its model or application usually needs one answer after every change: does the fix still hold? Multi-prompt sending is PyRIT's attack for that job. It replays a fixed sequence of prompts against the objective target, in order, and records the full conversation for review. It uses only the objective target and needs no adversarial model, so the test is deterministic in its inputs and cheap to rerun after a model swap, a system prompt edit or a filter change. The same scripted turns can be replayed each time, which makes differences between runs attributable to the target rather than to the attacker.
The contrast with adaptive multi-turn attacks such as Crescendo is the decision point. Crescendo uses an adversarial model that reads each target reply and chooses the next turn, so it is suited to discovery: finding out whether a conversation can be steered toward an objective at all. A fixed script cannot adapt, so it will not find a new path. Use it for regression, where the path is already known and the question is whether the defence still blocks it. Keep the discovery work with the adaptive attacks, and convert every adaptive success into a scripted turn sequence once it is confirmed, so it can be replayed without that cost. Confirm with your own run whether a given script reproduces a prior success, because a target that samples responses may not behave identically each time.
PyRIT is an MIT-licensed framework from Microsoft, and its multi-turn attacks, including multi-prompt sending, are described in the PyRIT documentation for multi-turn attacks. Confirm the attack's current parameters and turn-handling behavior against the version you pin, since the framework has changed across releases. Your team owns the script library, the scorer that judges each final reply, and the decision about which failures block a release.
How PyRIT replays a scripted conversation step by step
A scripted sequence sends a fixed list of prompts to the target in order, keeps the conversation history, and stores every turn so a tester can check known conversational jailbreaks again later without an adversarial model.
Write the ordered prompt list
The tester writes the conversation as an ordered list of user turns, each turn written in advance and stored with the objective it tests. Keep the list in version control so every regression run replays the same sequence. The step is done when the list is reviewed by someone other than its author and each turn has a recorded purpose, such as setting context, building trust, or making the final request.
Configure the objective target
Point PyRIT at the system under test as the objective target, using the target classes supported in your PyRIT version, such as an Azure OpenAI deployment or a custom HTTP endpoint. Multi-prompt sending uses only this target, so no adversarial model needs to be provisioned or hosted. Confirm the exact class names and constructor parameters in the 1.1.0 documentation before you write the code. The step is done when a single test prompt returns a response through the target.
Send each turn with history preserved
The attack sends the first prompt, waits for the response, then sends the next prompt in the same conversation, so each turn is judged in the context of the earlier ones. Whether the target receives the full history or only the latest message depends on the target type, so check how the endpoint handles sessions before you trust a multi-turn result. The step is done when the run completes every turn in the list or stops at a recorded error.
Verify context carried across turns
Between steps, check that the target actually kept context. Ask a reference question in an early turn, then refer back to it in a later turn, and confirm the reply uses the earlier detail. If the target treats each turn as new, a scripted jailbreak that depends on earlier setup will not test what you intended, and the result will not reflect the deployed conversational behavior. The step is done when the context check passes or the endpoint is marked as stateless for this test.
Record each response in memory
PyRIT writes each prompt and response to its memory, which stores conversations and results in SQLite or Azure SQL. Confirm that every turn, including refusals and errors, appears as its own entry with the conversation identifier and the turn order. Missing or merged turns make the regression result hard to explain later, so check the stored conversation against the prompt list before moving on. The step is done when the stored conversation matches the script one turn at a time.
Score the conversation per turn or at the end
Choose whether the scorer judges the whole conversation once at the end or each response as it arrives. Scoring per turn shows which step changed the target's behavior, while end-of-conversation scoring reflects the final outcome. Scorers can be LLM-based, Azure AI Content Safety, or custom logic, so state the criterion you are testing for in writing. The step is done when each scored turn or the final result has a stored score and the criterion is recorded with it.
Compare results with the previous baseline
Compare the stored scores and responses with the last accepted run of the same script. A change in the final response, or in the turn where the target first complied, is the signal a regression test exists to catch. Keep the baseline and the new run under the same target version and settings, since a model or configuration change can explain a difference on its own. The step is done when the comparison is written up with the run identifiers and any changes that need follow-up.
Which configuration choices fit which regression goal
This table compares common ways to structure a scripted multi-prompt sending run, from single fixed scripts to per-category suites, and shows the maintenance and coverage cost of each. Read each row against the regression goal you are protecting, then confirm option names and parameters against the PyRIT 1.1.0 documentation before you build.
| Configuration choice | When it fits | What it trades off | Confirm before building |
|---|---|---|---|
| One fixed script for one known jailbreak | A single conversational jailbreak that was fixed and must stay fixed after a model or prompt change | Fast to write and review, but covers only one phrasing and one turn order | Exact turn sequence and expected refusal behavior |
| Several scripts grouped by harm category | Regression coverage across content harms, data leakage or psychosocial risks | More files to maintain and more reruns when a category changes, but failures point to a specific harm | Dataset and category labels used in the PyRIT datasets |
| Scripts scored with a fixed scorer | Repeatable pass or fail checks in CI where a human should not review each run | Scorer errors become false results, so scorer accuracy needs its own check | Which scorer type applies to your target output format |
| Scripts with no scorer, reviewed by hand | Early exploration, or when a transcript review is the only acceptable judgment | Does not scale to frequent runs and depends on reviewer consistency | Where transcripts are stored in PyRIT memory for review |
| Prompts stored in Python code | Small suites owned by the engineers who maintain the test harness | Changes need a code review and a release, and non-engineers find prompts harder to edit | How your team reviews changes to test code |
| Prompts stored in seed files | Larger suites that security and compliance staff edit and version separately | Needs a loader, schema checks and a naming convention to avoid drift | Seed file format and loading options in the 1.1.0 documentation |
| Fixed turn order with exact prompts | Reproducing a known conversational sequence step by step | Brittle when the target answers differently, so results may vary between runs | Whether the target keeps conversation state between sends |
Target types and memory choices for scripted runs
A direct model endpoint is the simplest environment for a scripted sequence. The turns reach the model through its API, so the only conversational state is what the client sends. Before you rely on results, confirm how the endpoint handles history: some APIs expect the full message list on every call, while others keep server-side state under a conversation or session identifier. The difference changes whether a turn-three failure reflects the model or a dropped context.
- Statefulness: Record whether each call carries the full history or references a stored thread, and keep that setting identical across reruns.
- Model and version pins: Use a fixed model name or snapshot so a regression is not caused by a silent provider update.
- Sampling settings: Fix temperature and other generation parameters, since they change whether a scripted jailbreak lands.
- System prompt: Version the system prompt alongside the script, because the same user turns behave differently under a different instruction set.
- Transcript storage: Write every request and response to SQLite or Azure SQL memory so a reviewer can replay the exact exchange.
Confirm which endpoint types and authentication methods your PyRIT version supports in the PyRIT documentation before building the target.
A custom HTTP or WebSocket application is the usual target when the model sits behind your own product logic, such as retrieval, a moderation layer or a session service. Here the script is only meaningful if your application treats each request the way a real user session would. A stateless POST endpoint and a WebSocket session that holds context server-side need different handling in the script, and mixing them up produces misleading passes.
- Session identifiers: Capture the session or conversation token from the first response and attach it to every later turn.
- Cookies and auth refresh: Confirm that tokens expire outside the test window, or handle refresh inside the script.
- Message framing: Match the JSON or socket message schema exactly, including fields the app adds on its own.
- Streaming responses: Decide whether the script waits for the complete reply or the first chunk, because partial output can be scored differently.
- Transcript storage: Persist the raw request and response bodies, not only the extracted text, so framing issues can be traced later.
Ask the application owner which layers sit between the user and the model, since a filter that runs only on the first turn will change what the sequence proves.
A web app driven through Playwright targets the interface a user actually sees. This is the right choice when the risk lives in the front end, such as client-side rendering, conversation history shown to the user, or interface-level filters. It is also the slowest and most brittle option, because the script depends on selectors, page load timing and the browser session staying alive across every turn.
- Selector stability: Use test-specific attributes where the application provides them, and avoid selectors tied to layout or styling.
- Wait conditions: Wait for the response to finish rendering, not for a fixed delay, so each turn is scored on a complete reply.
- Login state: Reuse an authenticated browser context so every run starts from the same account and permissions.
- Reset behavior: Start each run in a new conversation, and confirm the previous one does not leak context into the next.
- Screenshots and DOM capture: Store page state beside the text transcript when a finding depends on what was displayed.
Check with the PyRIT documentation which web app target options are available in your version, and confirm the browser dependencies your CI runners need.
PyRIT memory stores conversations and results in SQLite or Azure SQL. The choice mainly depends on where the team keeps its records and who must be able to query them. Whichever you pick, the transcript is the evidence: a scripted run is only reviewable if every turn, its target, its timestamp and its score can be pulled back out later. Decide the storage location before the first run so early results are not scattered across local files.
- SQLite for local work: A single file is simple to create and copy, which suits an individual tester or a short engagement.
- Azure SQL for shared records: A managed database supports multiple team members and retention controls set by the organization.
- Access and retention: Limit who can read transcripts, since they may contain sensitive test content, and define how long they are kept.
- Run labels: Tag each run with the script version, target version and date so reruns can be compared.
- Backups: Include the memory store in the same backup routine as your test assets.
Confirm the memory backends and their configuration keys in the PyRIT documentation before you commit to one for a regulated environment.
Why a passing script does not prove a model is safe
A passing multi-prompt sending run tells you that the target did not produce a flagged response to the exact sequences you wrote. It does not tell you that the model resists conversational jailbreaks in general. A scripted attack only probes the turn orders, phrasings and escalation paths someone thought to include, and a known jailbreak that was fixed in one wording can still succeed when the same intent arrives in a different order or with different framing. Treat the script as a regression floor: it catches what you already know, and the gap between that and the full space of attempts should be stated plainly in any report built on it.
Model output is nondeterministic, so a single pass or fail is weak evidence on its own. Run each scripted sequence several times, record every response in memory, and look at the spread of outcomes rather than the last result. The scorer adds a second source of error. PyRIT scorers decide success by using an LLM as a judge, an Azure AI Content Safety check or custom logic, and each has different blind spots. An LLM judge can misread a partial refusal, and a category classifier can miss harm expressed indirectly. Before you rely on a scorer's verdicts, check its accuracy against responses a human has labeled, including borderline cases, and confirm which scorer and version produced each recorded result.
The baseline is only valid for the configuration it was built on. A change to the system prompt, content filters, retrieval setup, tool access or the underlying model version can alter which scripted sequences still work, so a clean run before a change says little after it. Record the target configuration with each run, and rerun the full script whenever any of those elements change. Ask your team to confirm, for each target, which settings are fixed, which are managed by a provider that may update the model silently, and who approves a baseline reset after a change.
How a scripted run moves from prompt file to stored result
A scripted run starts with a prompt file that lists the user turns in order. The PyRIT multi-prompt sending attack sends each turn to the objective target inside the application boundary, then passes each response to a scorer. Every turn and score is written to PyRIT memory, which feeds the report. Check that the target keeps conversation state the way production does, and that the scorer judges the full conversation, not just the final reply.
Scripted turns cross the trust boundary to the target, and results are stored for reporting.
Security and operational risks of running scripted attacks against live systems
Scripted attacks send fixed prompts to a live endpoint, so the risks sit in the credentials that reach it, the transcripts it produces, the bill it runs up and the systems it touches. Each card names one risk and the control that keeps it manageable before the first replay.
Credentials in the PyRIT environment file
PyRIT reads target credentials from ~/.pyrit/.env, so a replay run on a shared workstation or CI runner exposes every key in that file to anyone with access to the account. Use a dedicated test key with the smallest scope the target allows, rotate it after the engagement, and keep the file out of version control. Confirm where your team stores secrets for shared runs before copying the file anywhere.
Transcripts containing harmful output
A multi-prompt replay stores every prompt and response in PyRIT memory, and a successful bypass leaves the harmful content in that record. Treat the memory database as sensitive data: restrict who can read it, decide how long transcripts are kept, and document who may export them. Confirm that your security and legal teams agree on the retention rule before the first run.
Cost and rate limits on paid endpoints
Each scripted prompt is a billable request to the target, and a sequence repeated across many prompt variants multiplies quickly. Set request limits and a spending ceiling with the provider before the run, and check how the target's rate limits will affect timing and retries. Ask the model owner for the expected per-request charge so the replay budget is calculated, not guessed.
Authorization for the target system
A scripted sequence aimed at a production chatbot can trigger alerts, violate provider terms or affect real customers. Run the replay only against systems your organization owns or has written permission to test, and name the environment in the test plan. Confirm with the system owner whether the endpoint is a staging copy with the same system prompt and filters as production.
Vulnerabilities in PyRIT itself
PyRIT is a tool that holds credentials and handles model traffic, so its own defects matter as much as the findings it produces. Report suspected vulnerabilities in PyRIT privately through the Microsoft Security Response Center under the project's security policy, not in a public issue. Pin the PyRIT version used for each test so results can be reproduced after an upgrade.
PyRIT on GitHubSetting up a multi-prompt sending regression test
This sequence takes a known conversational jailbreak, written as an ordered script of prompts, and replays it against a target through PyRIT's multi-prompt sending attack. The result is a repeatable regression check with a scored, stored transcript that shows whether the target still holds its defences across the same turns.
Install PyRIT on a supported Python version
Create a clean virtual environment on Python 3.10 or later but below 3.15, then install the package from PyPI with pip. The PyRIT documentation recommends Python 3.13, so pin that version if your platform team supports it. Confirm the install by importing the package in a Python shell and printing its version. Done means the import succeeds in the same environment your test runner will use.
Configure credentials and settings
Place target credentials in the ~/.pyrit/.env file and set run-wide options in ~/.pyrit/.pyrit_conf, keeping secrets out of the script itself. Use a test-only key with the lowest permissions the target allows. Check the setup by loading the environment and confirming the target credential variable resolves without printing its value. Done means the regression run can start without credentials being typed into code or committed to version control.
Define the objective target
Create the target object for the system under test, such as a hosted model endpoint, a custom HTTP or WebSocket application, or a web chat interface driven through Playwright. The objective target is the only model the attack talks to, because multi-prompt sending needs no adversarial model. Send one benign test prompt through it and confirm a response comes back in the expected format. Done means the target answers a harmless question and the response is stored.
Write the ordered prompt script
Write the known jailbreak as a numbered list of prompts in the order the original conversation used, and keep the wording exactly as recorded from the prior finding. Store the script in a versioned file so each regression run replays identical turns. Dry run the sequence first against a benign script of harmless prompts to confirm the turn order and that the target keeps conversational context between turns. Done means the benign dry run completes every turn in sequence.
Select or configure a scorer
Choose a scorer that decides whether the final response, or any turn, shows the unsafe behaviour the script targets. PyRIT scorers can use an LLM judge, Azure AI Content Safety, or custom logic, so pick the option your data handling rules allow. Run the scorer against a known refusal and a known compliant answer to confirm it separates the two. Done means the scorer returns different results for those two examples.
Run the multi-prompt sending attack
Execute the attack with the target, the ordered script and the scorer, and keep concurrency and retries at the values agreed for the test. Run it once per model or configuration version so results are comparable across releases. Watch the first run for target errors, rate-limit responses or truncated turns before treating any result as a finding. Done means the run ends with an attack result for every script turn.
Review stored transcripts
Query PyRIT memory to confirm each turn of the conversation was recorded in the expected order, with the prompt, the target response and the score attached. The memory store is SQLite by default or Azure SQL where configured. Export the transcript for the reviewer and record the scorer result beside the target version. Done means every turn appears in memory and the review record shows whether the defence held for this script.
Questions teams ask before scripting PyRIT multi-turn tests
Does PyRIT multi-prompt sending need an adversarial model?
No. According to the PyRIT documentation, Multi-Prompt Sending, Chunked Request and Barge-In attacks use only the objective target and need no adversarial model. The attack replays a sequence of prompts you define, so the conversation is fixed in advance rather than generated by another model. That keeps the run deterministic enough to compare across builds. You still need a target and a way to judge responses, because the attack sends the prompts but does not decide whether a jailbreak worked. Check the PyRIT multi-turn attack documentation for the exact parameters in the version you run.
What drives the effort of scripting PyRIT multi-turn tests?
Effort scales with four things. The first is the number of scripts, since each known jailbreak sequence needs its own prompt list, expected behavior and review. The second is target integration: a managed API is quicker to reach than a custom HTTP or WebSocket endpoint, or a web chat UI driven through a browser. The third is scorer setup, because a pass or fail decision needs a scorer you have chosen, configured and checked against known outcomes. The fourth is review workload, meaning how many transcripts a person must read after each run and how often the scripts change. Ask any partner to break its quote down along these four lines.
Can an in-house team script PyRIT multi-turn tests without a partner?
Often yes, if the team has Python skills, access to the target and someone who owns the test content. PyRIT installs with pip, and the PyPI package supports Python 3.10 up to but not including 3.15, with the documentation recommending Python 3.13. The harder parts are usually organizational: agreeing which jailbreak sequences matter, keeping scripts current as the model or system prompt changes, and deciding who reads the failures. Teams with a platform or security engineering group usually have the skills for the scripting itself. Outside help is worth considering when the target is hard to reach, when no one has time to maintain the scripts, or when the results must be defensible to an external reviewer.
What does the work need from our team?
Plan for three contributions. First, target access: a test endpoint or environment that behaves like production, with credentials handled through your own secret store and not hard-coded in scripts. Second, test data approval: someone accountable must sign off on the prompts, because multi-prompt scripts can contain harmful content and their storage, sharing and retention rules should be agreed first. Third, ownership of results: a named owner must decide what a failed script means, triage findings and track fixes. PyRIT stores conversations and results in SQLite or Azure SQL, so decide where that memory lives and who can read it before the first run.
How long does setting up scripted PyRIT multi-prompt tests take?
No duration figure is supplied for this work, so treat any number you hear with caution. Setup time depends on the factors above: how many scripts you need, how hard the target is to connect, how many scorers you configure, and how many people review results. Ask for a scoped estimate that lists the scripts, the target integration, the scorer configuration, the environment and the handover, with the time for each. A fixed scope agreed in writing before work starts makes the timeline easier to compare between an internal plan and an outside quote.
What does a partner cost compared with doing it internally?
Cost has two sides. Internal cost is mostly staff time for scripting, environment setup, maintenance and review, plus the compute and model fees for the target you test. Outside cost is the fee for the agreed scope, which should cover the scripts, integration, scorer setup, documentation and handover. Neither side is recurring by default, but maintenance is: scripts break when prompts, endpoints or policies change. Ask whether a quote covers one-time build work, an ongoing retainer for updates and retesting, or both, and what changes would be billed separately. DeployOpen does not publish a price list, and a quote follows from the written scope.
When is outside help worth considering for scripted PyRIT tests?
Consider a partner when the tests must produce evidence an independent reviewer will accept, when several AI systems need the same regression coverage, or when the target is hard to integrate. DeployOpen plans, implements and documents self-hosted platforms and runs security testing, including AI and agent security review, inside the client's own infrastructure. It prepares systems, controls and evidence for compliance assessments but does not issue audit reports or certifications. If the goal is only a small regression check on one endpoint that your team already runs, internal work may be enough. Compare both options against the same written scope.
What a scripted regression test costs and who pays for it
The largest cost of a scripted multi-prompt regression test is rarely the compute. It is the engineering time to turn a known conversational jailbreak into a fixed sequence of turns, wire that sequence to your target, and keep it current. Budget for four components: engineering time to write and maintain the prompt scripts, integration effort to connect PyRIT to the target (a custom HTTP or WebSocket endpoint, a chat UI driven through Playwright, or a hosted model API), usage charges for the target endpoint each time the scripts replay, and reviewer time to read scorer output and confirm whether a flagged turn is a real failure. Multi-prompt sending uses only the objective target, so no adversarial model is billed. Ask any partner to price these four lines separately so you can see which one dominates.
Split the cost into one-time setup and recurring re-runs. Setup covers writing the first script set, building the target adapter, choosing the scorer and agreeing the pass and fail criteria with your security owners. Recurring cost is the replay after every change to the system prompt, model version, retrieval source, filter or application code, plus the review of whatever the replay flags. Cost per run depends on how many conversations a script contains, how many turns each has, how many scripts you keep, and whether the target is stateful, since a stateful target may need a fresh session for each replay. Each of these drives both the endpoint bill and the review load, so trim the library to jailbreaks that remain relevant to your deployment.
DeployOpen does not publish a price list. A quote follows from a written scope that names the target, the number of scripts, the scorer approach, the integration work and the retest schedule. Ask for each cost line separately, with a clear statement of what is one-time and what recurs, and ask who holds the endpoint and model accounts that the replays will use. The PyRIT framework itself is open source under the MIT license, so the software carries no license fee. Confirm the license terms for any model or hosted service you connect, because those are separate agreements with separate charges.
How DeployOpen scopes and delivers PyRIT regression testing
DeployOpen treats a scripted PyRIT multi-prompt sending suite as a regression asset that your team keeps running after the engagement. We agree the conversation scripts, the target configuration and the pass criteria in writing, then build, document and hand over a suite your own engineers can run and extend.
How we scope
- Written scope lists which known conversational jailbreaks become scripted prompt sequences and which target endpoints they run against.
- Scope records the target type, whether it is stateful or stateless, and how conversation history is passed between turns.
- Scope states how each sequence is judged, including the scorer or human review step, and what counts as a regression.
How we build
- We write each scripted sequence as an ordered set of prompts with expected behavior notes, so a failed run points to a specific turn.
- We configure the objective target and PyRIT memory, storing conversations in SQLite or Azure SQL as the scope requires.
- We test the suite against a known-good and a known-weak target before handover, so the runs are shown to discriminate.
How we hand over
- You receive the scripts, configuration files, run instructions and a short guide to reading memory output for each sequence.
- Documentation explains which parts depend on your model version, so you know when a script needs review after an upgrade.
- A handover session walks your engineers through running the suite locally and in your pipeline, in your own infrastructure.
How we support
- Fixed-scope engagements have written deliverables and an agreed timeline, and changes go through a written scope update.
- Ongoing support, PyRIT upgrades and continuous testing of the regression suite are available as a retainer.
- Ask any provider to confirm who maintains scripts after a model change, and what happens when a new known jailbreak needs adding.

