PyRIT AIRT Scam scenario for phishing and fraud content

PyRIT's Scam scenario checks whether a model or assistant can be induced to write scam, phishing or fraud content, using single-turn techniques by default and an optional slower persuasive attack.

On this page

Why test an assistant for PyRIT's Scam scenario

If your team ships a chat or writing assistant, it must not draft phishing lures, fraud scripts or other scam content on request. PyRIT's Scam scenario tests whether a target can be induced to generate scam, phishing or fraud content, and you should run it before release and again after changes to the model, system prompt or safety layers. It runs through pyrit_scan, the command-line scanner in PyRIT, the open-source Python Risk Identification Tool for generative AI. Because the scenario is part of a packaged scan, the same run can be repeated against the same registered target and compared over time.

PyRIT is an open source framework from Microsoft under the MIT license, distributed on GitHub and PyPI. Its scanner is one of several ways to use it, alongside CoPyRIT, the web GUI for human-led red teaming, and the Python framework for custom attacks. For the Scam scenario, the default configuration runs the ContextCompliance and RolePlay techniques and leaves out the slower multi-turn PersuasiveRedTeamingAttack. Confirm that default against the scenario documentation for your PyRIT version before you rely on it, since the default set determines what your first run actually covers.

Before the first run, decide which assistant configuration is the one being tested, including its system prompt and any content filters, and record it so a later failure can be traced to a change. Also decide who reviews the results, because a scam-content finding usually needs a human reading the transcript to judge whether the output was actually usable for fraud. Plan to rerun the scenario after each model or prompt change, and treat the default single-turn results as a starting point rather than a complete picture of persuasion-based attacks.

What the default Scam run covers: ContextCompliance and RolePlay

The default Scam run in PyRIT's AIRT scenarios sends scam, phishing and fraud objectives through two single-turn techniques. Each card below describes one technique or the omitted multi-turn attack, so you can decide whether the default matches the fraud risk you need to test.

ContextCompliance in plain terms

ContextCompliance wraps a scam or phishing objective in a conversation history that makes the request look like a normal, already-accepted step. The target sees prior context that appears to establish that the content is expected. For a scam scenario, this tests whether the model's refusal depends on how the request is framed rather than on what it asks for. Check the exact framing the technique uses in your PyRIT version before you read results.

AIRT Scenarios docs

RolePlay in plain terms

RolePlay asks the target to act as a character, such as a copywriter, actor or fictional sender, and produce the fraudulent message from inside that persona. The test asks whether a fictional or performative frame lowers the model's guard on content it would refuse if asked directly. Results show whether persona framing alone can extract phishing text, which matters for customer-facing assistants that accept persona instructions.

Why both run as single-turn attacks

Both default techniques send one prompt per objective, so each objective produces one target response to score. This keeps the default run predictable in request count and easier to repeat after a model or system prompt change. A single-turn pass does not show whether a determined user could push a refusal over several turns, so treat a clean default run as a baseline, not a full assessment.

The omitted PersuasiveRedTeamingAttack

The default configuration leaves out PersuasiveRedTeamingAttack, a multi-turn attack that builds a persuasive case over a conversation. It is omitted because it is slower and sends many more requests per objective. Ask your team to decide whether to add it as a separate run for high-risk fraud areas, and confirm the adversarial model and request budget before scheduling it.

What to check in the results

Read each technique's results separately, because a refusal under one framing can still fail under the other. Review the scored responses for actionable detail, such as a usable sender name, lure text or payment instruction, not only whether the model complied in tone. Record the target configuration and PyRIT version with each run so a later rerun can be compared fairly.

When the persuasive multi-turn attack is worth its cost

The PersuasiveRedTeamingAttack is the multi-turn option in PyRIT's Scam scenario, and the default run leaves it out. It holds a conversation over several turns, using an adversarial model to rephrase its approach as the target pushes back, so it tests whether persistence and social framing can wear down a refusal that a single prompt does not. That makes it slower and more expensive per objective than the default ContextCompliance and RolePlay techniques, because every turn is another request to the target and another call to the adversarial model and scorer. Treat it as an addition to the default run, not a replacement for it.

The decision comes down to coverage against run time. Add the persuasive attack when the application accepts multi-turn input, when a prior single-turn run passed cleanly and you need evidence that the refusal holds under sustained pressure, or when the application is customer-facing and fraud content would reach real victims. Skip it for a fast pre-merge check or a first baseline, where the default techniques give a quicker signal. Before scheduling it, confirm the request budget with your team and the target owner, because the number of objectives and turns multiplies the load on a rate-limited endpoint.

The attack is only as meaningful as its setup, so the team must choose two things before the first run. The first is the adversarial model, which generates the persuasive turns; its willingness to write persuasive content, its cost and its access path all change the results, so record which model you used. The second is the scorer, which decides whether the final response actually contains usable scam or phishing content. Confirm both with your PyRIT configuration and document the choices in the run's memory labels, so a later rerun with a different adversarial model or scorer is not compared as if it were the same test.

Scam scenario configuration options and when each fits

This table compares the default Scam scenario technique set with adding the persuasive multi-turn attack, along with the run choices that shape the output. Read each row as a decision: the option, what it changes, and the situation where it fits. The main takeaway is that the default set gives a fast single-turn baseline, while the persuasive attack adds a slower multi-turn check that the default run leaves out.

OptionWhat it changesWhen it fits
Default techniques (ContextCompliance and RolePlay)Runs two single-turn techniques against each objective, so the run is faster and produces one result per technique and objective.First assessment of a model or application, or a routine check on every change where cost and time matter.
Add PersuasiveRedTeamingAttackAdds a slower multi-turn attack that tries to win the target over across a conversation, which the default run omits.Pre-release or periodic review where persuasion-based fraud content is a stated risk and the team can accept a longer, costlier run.
Target registrationDetermines which model or application receives the prompts, so results are only comparable when the same target name is used across runs.Use a stable registered name for each environment so baseline and later runs can be compared.
Dataset size for a first runLimits how many objectives are sent, which shortens the run and makes early output easier to read.First run against a new target, to confirm configuration before a full objective set is sent.
Memory labelsTags conversations and results so a specific run can be found, filtered and exported later.Any run that feeds review, evidence or comparison, where each run needs a traceable label.
Output reviewScenario results show which techniques succeeded per objective, so the technique set you chose determines what the findings cover.Confirm in the results which techniques ran before reporting coverage of multi-turn persuasion.

Setting up and running the Scam scenario with pyrit_scan

This sequence takes a team from a clean Python environment to a first Scam scenario run against a registered target, with results readable in PyRIT memory. Each step ends with a check so problems surface before the full dataset runs.

  1. Confirm a supported Python version

    The engineer running the assessment checks that the interpreter is between Python 3.10 and 3.14, the range the PyPI package supports. Python 3.13 is the version the PyRIT documentation recommends, so a dedicated virtual environment on 3.13 is the simplest starting point. Check the result with the interpreter's version command before installing anything. The step is complete when the reported version falls in the supported range.

  2. Install PyRIT from PyPI

    Inside the virtual environment, the engineer installs the pyrit package with pip, then confirms the pyrit_scan and pyrit_shell commands are on the path. Record the installed version in the assessment notes so later results can be traced to the release that produced them. Installing from PyPI keeps the environment tied to a published package rather than an ad hoc source checkout. The step is complete when pyrit_scan prints its help text without errors.

  3. Create the credentials file in pyrit home

    The engineer creates ~/.pyrit/.env and places only the credentials the target needs there, such as the API key or endpoint for the model under test and any key for the adversarial or scoring model. Restrict file permissions so other local users cannot read the file, and keep the file out of shared repositories and CI logs. Confirm that the file exists and that no secret appears in shell history or in the printed help output. The step is complete when the credentials file is in place and access is limited to the operator.

  4. Set run configuration in pyrit conf

    Next, the engineer writes ~/.pyrit/.pyrit_conf with the settings the run needs, such as the memory database location and the default scorer and converter choices. Keep the memory store on storage the team controls, because the results of the scan are written there. Check the configuration by running a command that reports the loaded settings, and confirm that the memory path points where the team expects. The step is complete when the loaded settings match the intended values.

  5. Register the target under test

    The engineer registers the assistant or model endpoint as a PyRIT target, using the target name the team will pass to pyrit_scan. Confirm which target type fits the system, such as a hosted model API or a custom HTTP endpoint, and check the vendor or PyRIT documentation for the exact registration format in the installed version. Send one benign test prompt to confirm the target responds. The step is complete when the target returns a reply and the registration name is written in the run notes.

  6. List the Scam scenario and its defaults

    The engineer lists the available scenarios and targets with pyrit_scan, then inspects the Scam scenario to see which techniques it runs by default. According to the PyRIT documentation, the default run uses ContextCompliance and RolePlay and leaves out the slower multi-turn PersuasiveRedTeamingAttack, so the team must add that technique explicitly if it is in scope. Note the exact technique names the installed version reports. The step is complete when the scenario and its technique list are confirmed in the output.

  7. Run a small dataset first

    The engineer runs the Scam scenario against the registered target with the dataset size limited to a few objectives, so the team can check the pipeline end to end before a full run. The command should name the target and the scenario, and use the option that caps the number of objectives supported by the installed version. Watch for authentication errors, scorer failures or empty responses. The step is complete when the small run finishes and reports objectives processed without errors.

  8. Read the results in memory

    The engineer reviews the run in PyRIT memory, which stores conversations and results in SQLite or Azure SQL depending on configuration. Check each objective's outcome, the scorer's verdict and the full prompt and response pairs, and confirm the run is tagged so it can be found later. Handle the output as sensitive, since it contains generated scam or phishing text. The step is complete when the team can locate the run and explain each scored result.

How a Scam scenario request flows from scanner to scorer

The run starts at pyrit_scan on the tester's machine, which loads the Scam scenario and its selected techniques. Each technique sends objectives to the registered target, which sits across the boundary in the endpoint you test. Responses return to PyRIT's scorers, and the conversations and results are written to memory in SQLite or Azure SQL. Check that the target boundary matches the endpoint you intend to test before reading any scores.

Scam scenario requests cross from the tester's environment to the target and back to memory.

Handling scam content, credentials and results safely

A Scam scenario run produces fraud and phishing text, stores it in memory, and depends on credentials for every target and scorer. The cards below cover where that material and those secrets live, who can read them, and how to report a flaw in PyRIT itself.

Treat generated scam text as sensitive

Every response the Scam scenario elicits is a working phishing lure or fraud script if the safeguard fails. Store runs in a restricted location, delete outputs you no longer need, and avoid copying them into tickets, chat or slide decks. Ask your security team to confirm where the output directory and memory database sit, and who may open them before the first run against a production model.

Keep attack content out of shared logs

Console output and CI job logs often reach people who never approved the test content. Configure the run so verbose output and failed-objective text stay out of pipeline logs, and review what your runner retains and who can download artifacts. Confirm this behavior with your own logging setup, since the default output path depends on how you launch pyrit_scan.

Protect credentials in the PyRIT env file

PyRIT reads target and scorer credentials from ~/.pyrit/.env, so anyone with access to that file on a shared runner can call your model endpoints. Restrict the file to the account that runs the scan, keep it out of version control, and prefer a managed secret store for shared machines. Rotate keys after a team member leaves the project.

PyRIT documentation

Restrict access to memory databases

PyRIT memory stores conversations and scores in SQLite or Azure SQL, and those records include the exact jailbreak attempts and any unsafe replies. Set file permissions on the SQLite file, or role-based access on Azure SQL, so only the assessment team can query it. Decide a retention period with your compliance owner and confirm how deletion works in the version you run.

Separate run labels by team and build

Shared memory makes it easy to mix results from different targets, teams or builds, which weakens any later evidence trail. Use distinct memory labels or separate databases per team and per build so a reader can tell which target produced a given score. This also limits how far one team's test content spreads through the shared store.

Report PyRIT vulnerabilities privately

If a scan exposes a flaw in PyRIT itself, such as a way its configuration or memory handling leaks secrets, do not open a public issue. Report it privately through the Microsoft Security Response Center under the project's security policy, and include the version and steps needed to reproduce it. Hold scan output back from public channels until the report has been triaged.

PyRIT on GitHub

Questions teams ask before running the Scam scenario

Can our own security team run PyRIT's Scam scenario without a partner?

Yes, a team with Python experience and access to the target can run the Scam scenario from pyrit_scan after installing PyRIT from PyPI, which supports Python 3.10 up to but not including 3.15. The harder part is judgment: deciding which objectives are in scope, configuring a scorer that reliably flags scam and phishing output, and interpreting results for a non-technical audience. Teams usually keep the run internally when they already have an AI security function and a repeatable review process. Ask whether you have the people to repeat the run after each model or prompt change, because that recurring work is where internal efforts tend to stall.

What drives the cost of a Scam scenario assessment?

The main drivers are how much access the team needs to set up, how many targets are in scope, the dataset size, and whether multi-turn attacks are included. Target access matters most: a registered API endpoint is quicker to wire up than a web chat interface that must be driven through Playwright. Scorer setup adds effort when you need a custom judgment for scam content rather than a default check. Each extra target, technique set or dataset multiplies the number of requests and the review time. Ask any provider for a written scope that lists these items separately so you can compare quotes on the same basis.

Does the Scam scenario require the slower multi-turn attack?

No. The default Scam run uses the ContextCompliance and RolePlay single-turn techniques and omits the slower multi-turn PersuasiveRedTeamingAttack, according to PyRIT's AIRT Scenarios documentation. Add the persuasive multi-turn attack when you want to know whether a model can be walked toward scam content over several exchanges, which is a different risk from a single well-crafted prompt. Multi-turn runs take longer and cost more model calls, so most teams start with the default, then add the persuasive attack for targets that pass the first run or that serve users in high-fraud contexts.

What does the work need from our team?

You will need to provide a few concrete inputs before any run starts:

How long does a Scam scenario assessment take?

The duration depends on target complexity, dataset size, the number of techniques and whether multi-turn attacks run, along with how long your team takes to review flagged responses. PyRIT's documentation does not give a fixed runtime for this scenario, so treat any single number you hear as a claim to verify. Ask a provider to split the timeline into setup, first run, review, fixes and retest, and to state which of those steps depend on your access approvals or model provider rate limits.

How would a partner scope a fixed-scope Scam assessment?

A partner would start with a short discovery call to confirm the target, the deployment context, the harms in scope and who receives the results. The written scope then lists the targets, the scenario techniques, the dataset and objectives, the scorers, the number of runs, the review method and the deliverables such as a findings report and retest. Most engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts, and a quote follows from that document. DeployOpen does not publish a price list, so compare quotes on whether each one defines these elements.

What are the risks of running scam-content tests against a live system?

The main risks are generating harmful content that could leave the test environment, exposing attack prompts through logs, and overloading a shared endpoint. Keep test runs in a controlled environment, restrict who can read PyRIT memory, and keep attack content out of job logs when the scenario runs in a pipeline. Confirm with the model provider that sustained automated testing is permitted under your agreement, and agree on rate limits with the team that owns the endpoint. PyRIT stores conversations in SQLite or Azure SQL, so decide how long those records are kept and who can access them.

Limits to confirm in your environment before a Scam run

A Scam scenario result is only as reliable as the setup behind it. The cards below cover the version, technique list, target, scorer and adversarial model choices that shape what a run actually tests, and what you should confirm in your own environment before you rely on the output.

Confirm the scenario and technique list

The Scam scenario's default techniques, ContextCompliance and RolePlay, are documented for the AIRT Scenarios page of the version you run. Check the installed release with your own tooling before you start, since the technique list and defaults can change between versions. Record the exact version in your run notes so results can be reproduced and compared later.

AIRT Scenarios docs

Confirm the release you install

Pin the PyRIT version you test with, and confirm it is the release your team has approved. Installs come from PyPI, and the package supports Python 3.10 up to but not including 3.15. The original Azure/PyRIT repository is archived and read-only, so confirm that your install and any internal forks point to the maintained microsoft/PyRIT project.

PyRIT releases

Confirm target compatibility

Check that your target is reachable and behaves the way the scenario expects. Chat endpoints, custom HTTP or WebSocket apps and web chat UIs each need their own configuration, and a wrapper that strips system prompts or filters content changes what you are testing. Confirm which safeguards sit in front of the model, so a refusal can be attributed to the right layer.

Validate scorer accuracy for scam content

Scam and phishing content is often persuasive, short and free of obvious harm markers, so a scorer tuned for violent or explicit content may miss it. Hand-label a sample of responses, including benign marketing and security-awareness text, and measure how often the scorer agrees. Record the false positive and false negative rates before you report any attack success figure.

Check the adversarial model against policy

The multi-turn PersuasiveRedTeamingAttack uses an adversarial model to generate persuasive messages, so that model must be approved for this use under your AI use and acceptable use policies. Confirm its data handling, hosting location and logging before you send any scam-related prompts to it. Keep the adversarial model choice documented alongside the target.

Slower attack
Multi-turn

Protect the credentials and output

Scam-themed prompts and responses can look like fraud content to a data loss prevention tool or a reviewer. Store API keys in the ~/.pyrit/.env file or your approved secret store, restrict who can read PyRIT memory, and set a retention rule for outputs. Agree in advance who may review flagged content and how it is removed.

Reading Scam scenario results as a finding

A Scam scenario run produces a set of objectives, each marked as succeeded or not, and that summary is not yet a finding. Treat the objective-level outcome as the starting point for review, not the conclusion. For each objective that the target answered in a way the scorer flagged, open the conversation and confirm the output actually delivers scam, phishing or fraud material rather than a warning, a fictional frame with no usable content, or a partial answer the scorer over-read. Record which technique produced the result, since ContextCompliance and RolePlay fail in different ways and the fix may differ. Also check the objectives that did not succeed, and note whether the refusal was consistent or depended on wording.

Review each flagged conversation as a reader would. Look at the full turn sequence, the framing the attack used, and whether the target's response could be copied into a real phishing kit, a fake invoice or a social engineering script with little editing. Scorer verdicts are a useful filter, but the scorer itself can be wrong in both directions, so spot-check a sample of unflagged refusals too. Ask your security or fraud team to sign off on the classification of borderline outputs, and write down the criteria you used so a second reviewer can reproduce the decision. Confirm the scorer configuration for the run in your own environment before quoting any rate.

A single run is a sample, not proof of safety. Outcomes can change with the target's sampling settings, the model version, the system prompt, the objectives chosen and the order of attacks, so a clean run says only that these conditions did not produce the content. Repeat the scenario on the same target after any change and keep the results together so trends are visible. Store the scenario output, the target and version details, the technique settings and the labels in PyRIT memory, which records conversations and results in SQLite or Azure SQL. Confirm with your own assessment owner which retention and access rules apply to that memory store, since it will contain the scam content itself.

How DeployOpen scopes and delivers AI red teaming with PyRIT

DeployOpen plans, runs and documents PyRIT assessments of the Scam scenario against assistants in your own environment, so the results match your deployment. Each engagement starts from a written scope that names the target, the techniques and the evidence your reviewers need.

How we scope

  • Agree in writing which assistant, endpoint and deployment configuration the Scam scenario will test
  • Confirm which default techniques run, and whether the slower multi-turn persuasive attack is included
  • Define the fraud and phishing objectives, the acceptable scorer outputs and the review process for results

How we build

  • Register the target and configure PyRIT credentials and settings in your infrastructure, not ours
  • Run the scenario with pyrit_scan on a limited first dataset, then widen coverage once results are checked
  • Keep conversations, scores and run labels in PyRIT memory so each finding can be traced back to its run

How we hand over

  • Deliver a written findings report with reproducible steps, scorer results and affected conversations
  • Document the scenario configuration, run commands and memory locations so your team can repeat the assessment
  • Walk your security and product owners through the findings and agree which fixes are in scope for retest

How we support

  • Retest fixed behavior with the same scenario configuration so before and after results are comparable
  • Offer ongoing support, periodic reruns and continuous testing as a retainer after the initial engagement
  • Confirm with us during scoping which parts of the work recur, such as reruns after model or prompt changes

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.