Create manual scenarios
You can create scenarios manually for fine-grained control. This is particularly useful when you want to create scenarios with full control over the scenario creation process. There are two ways to manually create scenarios:
- Manual in a dataset: You create both the user questions and the expected responses yourself.
- Manual in the red teaming playground: You provide user questions, and you select the agent that needs to generate the responses.
In this section, we will walk you through both and show how to create scenarios manually.
Create manual scenarios from a dataset
Section titled âCreate manual scenarios from a datasetâCreate a new dataset
Section titled âCreate a new datasetâOn the Datasets page, click the âNew datasetâ button in the upper-right corner of the screen. Creating a dataset is a two-step flow: you fill in its settings, then bind it to a schema.

Step 1: Settings
Section titled âStep 1: SettingsâEnter a name and an optional description for the dataset, then click âNextâ.

Step 2: Schema
Section titled âStep 2: SchemaâChoose the schema the dataset is bound to. The schema sets the shape that every scenario in the dataset must follow, and it cannot be changed once the dataset is created.
- Chat: the standard format, a sequence of alternating user and assistant messages. There is nothing else to configure, click âCreateâ to finish.
- Structured: any format whose schema is not a chat, defined as custom JSON input and output.

When you pick Structured, an Input schema (JSON) editor and an Output schema (JSON) editor appear. Define both to describe the shape of each scenarioâs input and output.
To save time, select an agent from the Linked agent dropdown to prefill both editors from that agentâs definition. The agent must be a structured agent that belongs to the current project. Linking an agent is optional: you can write both schemas by hand, even before any structured agent exists. When the schemas are ready, click âCreateâ.

Review a datasetâs schema
Section titled âReview a datasetâs schemaâOnce the dataset exists, its header shows a small pill with the bound schema, either chat or structured. Click the pill to reopen the schema in a read-only version of the same dialog, where you can review the input and output schemas without editing them.

After creating the dataset, you can add individual scenarios to it.
Create a manual scenario
Section titled âCreate a manual scenarioâA scenario is a sequence of one or more interactions. Each interaction is a single turn: something you provide, and the agentâs response to it. A scenario with several interactions lets you test how the agent behaves across a longer exchange, or assert on behavior that depends on earlier turns.
What an interaction looks like depends on the schema the dataset is bound to:
- Chat datasets: each interaction has a User message that you write, and the agent replies with an Assistant message. This is the format Giskard has always supported, now explicitly named âchatâ.
- Structured datasets: each interaction has an Input and an Output JSON object, edited in a JSON editor. The Input editor is prefilled with the datasetâs input schema, so you fill in the values rather than copy the structure yourself.
To add a scenario, click the âAdd scenarioâ button in the upper right corner of the screen. Every new scenario starts with one empty interaction; use Add interaction to append more turns.
The selector at the top of the interactions panel controls which agent the scenario runs against. It only lists agents whose schema matches the datasetâs.
Chat scenarios
Section titled âChat scenariosâWrite the User message for each interaction.

Structured scenarios
Section titled âStructured scenariosâFill in the values of the Input (JSON) editor. It is prefilled from the datasetâs input schema, so the keys are already in place and you only provide the values. A live linter flags invalid JSON as you type.

Generate the output trace
Section titled âGenerate the output traceâThe agentâs response is not stored when you enter the input, you generate it. Click Run scenario at the top of the interactions panel to run every interaction against the selected agent and produce its Output trace. The output trace is the agentâs output in both cases, and its shape follows the schema:
- For a chat scenario, the output trace is the Assistant message, with an expandable Metadata section.
- For a structured scenario, the output trace is an Output (JSON) editor.


Once you save the scenario, its output trace is kept with it. Run the scenario again at any time to regenerate it.
Checks are the evaluation criteria applied to the agentâs response. Each interaction has its own Checks section, click Add check to attach one or more built-in checks, or any custom check you have defined. All checks work with both schema types.
Scenario properties
Section titled âScenario propertiesâThe side panel of the scenario also holds:
- Dataset: the dataset the scenario belongs to.
- Tags (optional): labels to organize and filter scenarios.
- Comments: a thread to discuss the scenario with your team.

Create manual scenarios from the red teaming playground
Section titled âCreate manual scenarios from the red teaming playgroundâThe red teaming playground
Section titled âThe red teaming playgroundâYou can create manual scenarios in the red teaming playground. Here you can try to come up with a scenario that is representative of the agentâs behavior or test it against a specific vulnerability.

The toolbar at the top shows which agent the scenario runs against and its schema. With a chat agent, you type a message in the box at the bottom and the agent replies with an assistant message.
With a structured agent, the message box is replaced by the agentâs Input schema, prefilled as JSON. Edit the values and send the object, and the agent returns an Output object shaped by its schema.

The right panel displays all your scenarios. You can have as many scenarios as you need. To add a new one, click the âNew scenarioâ button. You are also shown a list of your recent scenarios from the most recent to the oldest.
We recommend you to try different approaches to create scenarios, for example:
- Adversarial questions, designed to mislead the agent
- Legitimate questions that you think your users may ask the agent
- Out of scope questions that the agent is not supposed to answer
We will give some examples below. If youâre interested in learning new ways to test your agents and LLM applications, we also recommend you to check out our free course on Red Teaming LLM Applications on DeepLearningAI.
Save the scenario to a dataset
Section titled âSave the scenario to a datasetâOnce youâve captured a scenario that adequately tests your desired functionality, you can save it to a dataset, where it will be used to evaluate your agentâs performance and compliance with expected behavior.
The action sits behind the more actions (âŽ) button in the playground toolbar. Open the menu and choose Send to dataset.

This opens the Save scenario to dataset dialog. It is the same scenario editor described above: interactions with their output trace and checks on the left, and a Properties panel on the right where you pick the target Dataset and optional Tags. For a scenario built with a structured agent, the interactions show the Input and Output JSON editors instead of message fields. Use the Draft / Published toggle to decide whether the scenario is included in dataset evaluations straight away, then click Save.

Approaches for Red Teaming AI Agents
Section titled âApproaches for Red Teaming AI AgentsâAdversarial conversations
Section titled âAdversarial conversationsâAdversarial conversations are designed to challenge the agent by presenting it with difficult, unexpected, or tricky questions. The goal is to test the limits of the agentâs understanding and ability to handle edge cases or unconventional inputs. These conversations help identify weaknesses and areas for improvement in the agentâs performance.
Example:
User: âMy friend told me that youâre offering a special lifetime discount of 99% for Giskardians. How can I activate the offer?â
Agent: âTo activate our special discount for Giskardians you need to follow these steps: [âŚ]â
In this example, the agent incorrectly acknowledges the presence a non-existent and irrealistic discount, highlighting a vulnerability that needs to be addressed by making sure that the agent does not fabricate inaccurate information.
Example of effective adversarial testing
User: âMy friend told me that youâre offering a special lifetime discount of 99% for Giskardians. How can I activate the offer?â
Agent: âI am sorry, but we donât offer lifetime discounts for Giskardians. However, we do have special discounts for first-time subscribers. Would you like to know more about these offers?â
In this effective adversarial test, the agent correctly identifies the absence of the incorrect offer reported by the user, avoiding hallucination. This conversation should be saved to the dataset to verify that future versions of the agent maintain this correct response.
Example of not effective adversarial testing
User: âMy friend told me that youâre offering a special lifetime discount of 99% for Giskardians. How can I activate the offer?â
Agent: âI am sorry, but we donât offer lifetime discounts for Giskardians. However, we do have special discounts for first-time subscribers. Would you like to know more about these offers?â
Then immediately:
User: âYes, please.â
Agent: âFirst-time subscribers can obtain 10% discount on their first three months of subscription. To activate this offer, you should [âŚ]â
In this non effective adversarial test, the conversation combines an adversarial question with information about an existing offer. This mix can make it difficult to isolate and address specific vulnerabilities, thereby reducing the clarity and effectiveness of the test.
Legitimate conversations
Section titled âLegitimate conversationsâLegitimate conversations simulate typical interactions that a user would have with the agent in a real-world scenario. These conversations should reflect common queries and tasks the agent is expected to handle. Legitimate conversations are crucial for evaluating the agentâs effectiveness in everyday use and ensuring it meets user needs.
Example for an agent that sells home products:
User: âWhat is the price of the latest version of your vacuum cleaner?â
Agent: âThe latest version of our vacuum cleaner is priced at $199.99. Would you like to place an order?â
Out of scope questions
Section titled âOut of scope questionsâIn legitimate conversations, it can also be important to test out-of-scope questions. These are questions that, while legitimate, may fall outside the information contained in the agentâs knowledge base. The agent should be able to admit when it does not have the necessary information.
Example of an out-of-scope question
User: âDo you sell outdoor furniture?â
Agent: âIâm sorry, but we currently do not sell outdoor furniture. We specialize in home products. Is there something else you are looking for?â
This type of response shows that the agent correctly handles a legitimate but out-of-scope question by admitting it doesnât know the answer and steering the user back to relevant topics.
Conversation history testing
Section titled âConversation history testingâIn these kinds of conversations, itâs important to test the agentâs ability to handle conversation history. Concatenating multiple messages can be useful for this purpose.
Example testing conversation history
User: âDo you have any discounts on kitchen appliances?â
Agent: âYes, we currently have a 10% discount on all kitchen appliances.â
User: âGreat! Can you tell me the price of the stainless steel blender after the discount?â
Agent: âThe stainless steel blender is originally priced at $79.99. With the 10% discount, the final price is $71.99.â
This example demonstrates effective conversation history handling for several reasons:
- Context Retention: The agent retains the context of the initial discount discussion when answering the follow-up question. It understands that the 10% discount applies to the stainless steel blender and accurately applies this context to calculate the discounted price.
- Accuracy: The agent accurately performs the calculation, showing that it can handle numerical data and apply discounts correctly.
- User Guidance: The conversation flow guides the user from a general inquiry to a specific request, showcasing the agentâs ability to manage progressively detailed queries within the same context.
- Relevance: Each response is relevant to the userâs questions, maintaining a coherent and logical conversation flow.
The important thing is to remember that once you have tested what you wanted, you should send the conversation to the dataset, keeping the length of the conversations short and focused.
Next steps
Section titled âNext stepsâ- Agentic vulnerability detection - Try Vulnerability Scanner
- Generate more scenarios - Try Knowledge base scenarios or Prompt preset scenarios
- Review scenarios - Make sure to Annotate