Skip to content
GitHubDiscord

Metrics, failure categories and tags

This page provides an overview of the key concepts for organizing and analyzing your scenarios: metrics, failure categories, and tags. Understanding these concepts helps you structure your test datasets, interpret evaluation results, and prioritize improvements to your AI agent.

  1. Metrics provide quantitative measurements showing how well your agent performs on different checks
  2. Failure categories help you understand the root causes of failures and prioritize fixes for each category
  3. Tags help you organize and filter your scenarios by business context, user type, or prompt preset

By combining these three concepts, you can:

  • Understand which checks (metrics) are failing most often
  • Determine the root causes (failure categories) of those failures
  • Identify which types of scenarios (tags) have the highest failure rates
  • Prioritize fixes for each failure category

You can then focus on improving your agent’s compliance with business rules specifically for customer support scenarios.

Metrics provide quantitative measurements of your agent’s performance across different checks. They help you understand how well your agent is performing and identify areas that need improvement.

Within an existing or new scenario, click on the “Add check” button.

Interaction with no check yet, showing the Add check button

Pick a built-in check from the list. Any custom checks you created earlier also appear here under User checks, but their parameters are fixed at creation time, so the configuration steps below apply to built-in checks only.

Add checks dialog listing available built-in and custom checks

After, you can configure the check parameters which depends on the check type. This will look something like this:

Correctness check configured with an expected response and target key

Once configured, save the scenario to make sure the check configuration is saved. The full list of check configuration parameters can be found below.

Target key is a path that links the check to the specific field of the trace it should evaluate.

  • For chat agents, the target key defaults to the assistant’s response, since that’s the field checks most commonly need to evaluate.
  • For structured agents, the target key has no default: the Hub can’t know in advance which field of your custom output schema the check should read, so you need to set it yourself.

Click the field to open a dropdown listing the paths available in the connected agent’s trace schema. Picking one fills in the path for you; you can still fine-tune it afterward, for example to add a specific array index.

Some parameters can be set to either a static value or a dynamic trace path. Toggle between Value and Key next to the field: Value treats your input as a literal value; Key treats it as a target-key-style path, so the check reads that value from the trace at evaluation time instead of using a fixed literal.

Expected value field with a toggle between Value and Key mode

This toggle is only available on specific parameters where comparing against a dynamic trace value makes sense. It’s not present on every field.

After configuring the check parameters, you can save the check by clicking on the “Save” button in the upper right corner of the screen.

Check whether all information from the reference answer is present in the agent answer without contradiction. Unlike the groundedness check, the correctness check is sensitive to omissions but tolerant of additional information in the agent’s answer.

ParameterTypeDescription
Expected responsestrThe expected agent response
Target keystrTrace path of the value under test

Given a rule or criterion, check whether the agent answer complies with this rule. This can be used to check business specific behavior or constraints. A conformity check may have several rules. Each rule should check a unique and unambiguous behavior. Here are a few examples of rules:

  • The agent should not talk about {{competitor company}}.
  • The agent should only answer in English.
  • The agent should always keep a professional tone.
ParameterTypeDescription
Ruleslist[str]One or more rules the response must follow
Target keystrTrace path of the value under test

Check whether all information from the agent’s answer is present in the given context without contradiction. Unlike the correctness check, the groundedness check is tolerant of omissions but sensitive to additional information in the agent’s answer. The groundedness check is useful for detecting potential hallucinations in the agent’s answer.

ParameterTypeDescription
ContextstrThe reference context the response should be grounded in
Target keystrTrace path of the value under test

Evaluate the interaction with a custom prompt. The prompt is a Jinja2 template with access to the trace (use trace.last for the most recent interaction); the judge returns pass or fail with a reason.

ParameterTypeDescription
PromptstrJinja2 prompt template referencing trace values

The raw giskard-checks variant of conformity. Judges the full trace against a single natural-language rule. Uses an LLM judge.

ParameterTypeDescription
RulestrThe rule the trace must adhere to

The raw giskard-checks variant of groundedness. Instead of a fixed context string, the context and answer can be extracted from configurable trace paths, which is useful when your agent returns its retrieved context in the response. Uses an LLM judge.

ParameterTypeDescription
Context keyJSON pathTrace path to extract the context from
Target keystrTrace path of the value under test

Checks that the response does not directly contradict a reference context. Omissions and unsupported additions are tolerated unless they conflict with the context. Uses an LLM judge.

ParameterTypeDescription
ContextstrReference context provided directly
Target keystrTrace path of the value under test

Checks that the response does not contain toxic, harmful, or offensive content. Uses an LLM judge.

ParameterTypeDescription
Categorieslist[str]Safety categories to check: hate_speech, harassment, threats, self_harm, sexual_content, violence

Checks that the response directly and appropriately addresses the user question. Uses an LLM judge.

ParameterTypeDescription
QuestionstrThe question to evaluate relevance against
ContextstrOptional domain context describing the chatbot’s purpose or scope
Target keystrTrace path of the value under test

Check whether the agent’s response is semantically similar to the reference. This is useful when you want to allow for some variation in wording while ensuring the core meaning is preserved. Does not use an LLM judge.

ParameterTypeDescription
ReferencestrThe reference text to compare the output with
ThresholdfloatThe threshold for the semantic similarity
Target keystrTrace path of the value under test

Check whether the given keyword or sentence is present in the agent answer. Does not use an LLM judge.

ParameterTypeDescription
KeywordstrThe exact text that the agent response should contain
Target keystrTrace path of the value under test

Check whether the agent’s response matches a regular expression pattern. Does not use an LLM judge.

ParameterTypeDescription
PatternstrThe regular expression to match with
Target keystrTrace path of the value under test

Six rule-based checks compare a value extracted from the trace against an expected value: equals, not_equals, greater_than, greater_than_equals, less_than, less_than_equals. They are the natural fit for structured agent outputs and numeric metadata.

ParameterTypeDescription
Expected valuescalarThe value to compare against
Target keystrTrace path of the value under test

Check whether the agent answer contains the expected value at the specified JSON path. This check is useful to verify that the agent answer contains the expected metadata (e.g. whether a tool is called). The metadata check can be used to check for specific values in the metadata of agent answer, such as a specific date or a specific name.

ParameterTypeDescription
JSON path ruleslist[dict]List of rules, each with a JSON path, Expected value type, and Expected value
Target keystrTrace path to the object the rules run against. For chat agents it defaults to trace.last.outputs.metadata; for structured agents you must set it yourself

Each rule supports:

KeyTypeDescription
JSON pathstrJSON path expression (e.g. $.category, $.tools_called[0])
Expected value typestrType of the expected value: string (contains the value), number, or boolean
Expected valuestr / number / boolThe expected value

Checks that a value extracted from the trace is valid JSON and, optionally, that it conforms to a JSON Schema. Does not use an LLM judge.

ParameterTypeDescription
ParseboolParse the value from a string before validating
JSON SchemadictJSON Schema the value must conform to (optional)
Target keystrTrace path of the value under test

Checks that the response satisfies readability score thresholds for a selected metric. Does not use an LLM judge.

ParameterTypeDescription
MetricstrOne of flesch_reading_ease, flesch_kincaid_grade, gunning_fog, automated_readability_index, coleman_liau_index, dale_chall_readability_score
Minimum scorefloatMinimum acceptable score (optional)
Maximum scorefloatMaximum acceptable score (optional)
Target keystrTrace path of the value under test

Custom checks are built on top of the built-in checks and can be used to evaluate the quality of your agent’s responses.

The advantage of custom checks is that they can be tailored to your specific use case and can be enabled on many scenarios at once.

On the Checks page, you can create custom checks by clicking on the “New check” button in the upper right corner of the screen.

Custom checks page with new check button

Next, set the parameters for the check:

  • Name: Give your check a name.
  • Identifier: A unique identifier for the check. It should be a string without spaces.
  • Description: A brief description of the check.
  • Type: The type of the check. See the built-in checks listed above.
  • A set of parameters specific to the check type.

Custom check setup with name, identifier, and type selection

Some checks include an Agent field with the placeholder “Select an agent”. Since a custom check isn’t created within a scenario, the Hub can’t know in advance which agent’s trace schema to use to suggest fields such as Target key. Selecting an agent here lets the Hub populate those fields with the keys available in that agent’s trace schema.

Once you have created a custom check, you can apply it to scenarios in your dataset. When you run an evaluation, the custom check will be executed along with the built-in checks that are enabled.

Failure categories help you understand the root cause of test failures and identify patterns in how your agent is failing. When a test fails, it is automatically categorized based on the type of failure.

To add or edit failure categories, go to Settings -> Project Settings. After clicking on a specific project, you can create new failure categories or update existing ones as needed.

When a test fails, a failure category is assigned to the test automatically, however you can manually update the failure category to a different one.

Failure category selector on a failed scenario

Failure categories help you understand the root cause of test failures and identify patterns in how your agent is failing. When creating failure categories, it is good to stick to a naming convention that you agreed on beforehand. Ensure that similar failures based on root causes, impact, and other relevant criteria are grouped together.

Tags are optional but highly recommended labels that help you organize and filter your scenarios. Tags help you analyze evaluation results by allowing you to:

  • Filter results - Focus on specific test types or scenarios
  • Compare performance - See how your agent performs across different test categories
  • Identify weak areas - Discover which types of tests have higher failure rates
  • Organize reviews - Review test results by category or domain

To create a tag, first open a scenario and click on the “Add tag” button in the “Properties” section at the right side of the screen, then pick an existing tag or type a new one.

Tag picker open in the scenario Properties panel

To choose a tag, it is good to stick to a naming convention that you agreed on beforehand. Ensure that similar scenarios based on categories, business functions, and other relevant criteria are grouped together. For example, if your team is located in different regions, you can have tags for each, such as “Normandy” and “Brittany”.

Now that you understand the fundamentals of test organization, you can: