Skip to content
GitHub Discord

API Reference

For help updating existing code, see the migration guide.


Client classes for interacting with the Giskard Hub API. Two flavours are available with an identical API surface. Pick the one that matches your runtime.

from giskard_hub import HubClient
hub = HubClient()
projects = hub.projects.list()

Synchronous client. All resource operations are available as attributes.

Constructor
from giskard_hub import HubClient
hub = HubClient(
api_key="gsk_...", # or set GISKARD_HUB_API_KEY env var
base_url="https://hub.example.com", # or set GISKARD_HUB_BASE_URL env var
)
api_key str | None Default: env GISKARD_HUB_API_KEY

Your Hub API key.

base_url str | httpx.URL | None Default: env GISKARD_HUB_BASE_URL

Base URL of your Hub instance.

tenant_host str | None Default: env GISKARD_HUB_TENANT_HOST

Hub tenant hostname. When set, the SDK attaches it as X-Forwarded-Host on every request. Only needed when base_url’s host isn’t the tenant host (e.g. internal Docker networking).

auto_add_api_suffix bool Default: True

Automatically append /_api to base_url.

timeout float | httpx.Timeout | None Default: 60.0

Default request timeout in seconds. Pass an httpx.Timeout for fine-grained control over connect, read, and write timeouts.

max_retries int Default: 2

Number of automatic retries. The SDK retries connection errors, timeouts, and responses with status 408, 409, 429, or 5xx.

default_headers dict[str, str] | None Default: None

Headers added to every request.

default_query dict[str, object] | None Default: None

Query parameters added to every request.

http_client httpx.Client | None Default: None

Custom httpx.Client instance for proxies, custom transports, or mutual TLS.

Async counterpart with an identical API surface — every method is a coroutine. Accepts the same constructor arguments as HubClient, except http_client takes an httpx.AsyncClient instead of an httpx.Client.

Constructor
from giskard_hub import AsyncHubClient
hub = AsyncHubClient(
api_key="gsk_...", # or set GISKARD_HUB_API_KEY env var
base_url="https://hub.example.com", # or set GISKARD_HUB_BASE_URL env var
)
api_key str | None Default: env GISKARD_HUB_API_KEY

Your Hub API key.

base_url str | httpx.URL | None Default: env GISKARD_HUB_BASE_URL

Base URL of your Hub instance.

tenant_host str | None Default: env GISKARD_HUB_TENANT_HOST

Hub tenant hostname. When set, the SDK attaches it as X-Forwarded-Host on every request. Only needed when base_url’s host isn’t the tenant host (e.g. internal Docker networking).

auto_add_api_suffix bool Default: True

Automatically append /_api to base_url.

timeout float | httpx.Timeout | None Default: 60.0

Default request timeout in seconds. Pass an httpx.Timeout for fine-grained control over connect, read, and write timeouts.

max_retries int Default: 2

Number of automatic retries. The SDK retries connection errors, timeouts, and responses with status 408, 409, 429, or 5xx.

default_headers dict[str, str] | None Default: None

Headers added to every request.

default_query dict[str, object] | None Default: None

Query parameters added to every request.

http_client httpx.AsyncClient | None Default: None

Custom httpx.AsyncClient instance for proxies, custom transports, or mutual TLS.


Resource groups exposed by the client for managing Hub entities.

Register, test, and invoke agents. An agent represents your agentic application, such as LLM-based chatbots or classification services. In `hub.agents`, an agent is always a remote HTTP endpoint. To evaluate a local Python callable, use `hub.helpers.evaluate()`.

from giskard_hub.types import (
Agent,
AgentOutput,
ChatMessage,
GenerateCompletionOutput,
)

Create a new agent with configuration for external API communication.

name str Required

Display name of the agent.

url str Required

HTTP endpoint the Hub calls during evaluations and scans.

project_id str Required

Project this agent belongs to.

supported_languages list[str] Required

Language codes the agent supports (e.g. ["en", "fr"]).

headers dict[str, str]

HTTP headers sent with every request to the agent (e.g. auth tokens), as a {name: value} dict.

description str | None

Human-readable description.

input_schema dict[str, Any] | None

JSON Schema describing the agent’s expected input. Defaults to the conversational (chat) schema when omitted.

output_schema dict[str, Any] | None

JSON Schema describing the agent’s expected output. Defaults to the conversational (chat) schema when omitted.

auto_bindings list[ForwardBindingParam | AggregateBindingParam] | None

Automatic input/output bindings. Chat agents get a default aggregate binding that rebuilds conversation history; pass [] for single-turn agents.

Example
agent = hub.agents.create(
project_id=project.id,
name="Support Bot v2",
url="https://my-app.example.com/api/chat",
supported_languages=["en"],
headers={"Authorization": "Bearer <token>"},
description="GPT-4o chatbot with RAG",
)

Retrieve an agent by its ID.

agent_id str Required

ID of the agent to retrieve.

Update an existing agent’s configuration. Only the provided fields are modified.

agent_id str Required

ID of the agent to update.

name str | None
Updated display name.
url str | None
Updated endpoint URL.
description str | None
Updated description.
headers dict[str, str] | None
Updated HTTP headers.
supported_languages list[str] | None
Updated language codes.
input_schema dict[str, Any] | None
Updated input JSON Schema.
output_schema dict[str, Any] | None
Updated output JSON Schema.
auto_bindings list[ForwardBindingParam | AggregateBindingParam] | None
Updated bindings.

List all agents, optionally filtered by project.

project_id str | None
Project ID to filter by.

Delete an agent by its ID.

agent_id str Required
ID of the agent to delete.

Delete multiple agents at once.

agent_ids list[str] Required
IDs of agents to delete.

Call a registered agent with a structured input and get the response.

agent_id str Required

ID of the agent to call.

input dict[str, Any] Required

Structured input matching the agent’s input schema. For chat agents: {"messages": [{"role": "user", "content": "..."}]}.

chat_id str | None

ID of a playground chat to use as conversation context. The Hub uses the earlier exchanges of the chat as interactions and ignores any interactions you pass. The chat must belong to the same agent.

interactions Iterable[tuple[dict, dict]] | None

Prior (input, output) pairs to use as conversation context. The Hub ignores them when you set chat_id.

Example
output = hub.agents.generate_completion(
agent.id,
input={"messages": [{"role": "user", "content": "What is your return policy?"}]},
)
print(output.output["response"]["content"])
print(output.output.get("metadata"))

Test connectivity to an agent endpoint without persisting the agent. Returns the raw response of the connection test.

url str Required
HTTP endpoint URL to test.
project_id str Required
Project ID.
headers dict[str, str] | list[HeaderParam]
HTTP headers to include in the test request, as a {name: value} dict or a list of HeaderParam.
agent_id str | None
ID of an existing agent. When you omit input_schema, the Hub builds the test payload from the input schema of this agent. The test still calls url.
input_schema dict[str, Any] | None
Input schema used to build the test payload.

Auto-generate a description for an agent by observing its behaviour. Returns the generated description.

agent_id str Required
ID of the agent.

Define and manage reusable check criteria for evaluating agent responses. Checks are project-scoped and can be referenced by identifier in any scenario.

from giskard_hub.types import Check, CheckResult

Create a custom check in the specified project. Provide either params or spec, not both.

identifier str Required

Unique identifier to reference this check in scenarios. Must start with custom_ (e.g. custom_my_check).

name str Required

Display name.

project_id str Required

Project this check belongs to.

Check configuration with a type discriminator (see check type params below).

spec dict[str, object]

Raw check spec with a kind discriminator (e.g. {"kind": "hub_correctness", "reference": "..."}).

description str | None

Human-readable description.

Example
check = hub.checks.create(
project_id=project.id,
identifier="custom_tone_professional",
name="Professional tone",
params={"type": "hub_conformity", "rule": "Use formal language."},
)
check_id str Required

ID of the check to retrieve.

Update an existing check. Only the provided fields are modified.

check_id str Required
ID of the check to update.
identifier str | None
Updated identifier. It must start with custom_.
name str | None
Updated name.
params CheckTypeParam | None
Updated check params.
spec dict[str, object] | None
Updated raw check spec with a kind. You cannot use it together with params.
description str | None
Updated description.
project_id str Required

Project ID to list checks for.

filter_builtin bool

Whether to filter out built-in checks from the results. Default True.

check_id str Required

ID of the check to delete.

check_ids list[str] Required

IDs of checks to delete.

The Hub accepts these params dictionaries when creating a custom check (main params shown). You can also pass a raw spec with kind instead of type. See the built-in checks guide for all parameters and defaults.

Type params shape Evaluation method
Correctness {"type": "hub_correctness", "reference": str} LLM judge
Conformity {"type": "hub_conformity", "rule": str} LLM judge
Groundedness {"type": "hub_groundedness", "context": str | list[str]} or {"type": "hub_groundedness", "context_key": str} LLM judge
LLM judge {"type": "llm_judge", "prompt": str} LLM judge
Contradiction {"type": "contradiction", "context": str | list[str]} LLM judge
Toxicity {"type": "toxicity", "categories": list[str]} LLM judge
Answer relevance {"type": "answer_relevance"} LLM judge
Semantic similarity {"type": "semantic_similarity", "reference_text": str, "threshold": float} Embedding
String matching {"type": "string_matching", "keyword": str, "case_sensitive": bool} Rule-based
Regex matching {"type": "regex_matching", "pattern": str} Rule-based
Comparisons {"type": "equals" | "not_equals" | "greater_than" | "greater_than_equals" | "less_than" | "less_than_equals", "expected_value": Any} Rule-based
Metadata {"type": "hub_metadata", "json_path_rules": list[JsonPathRule]} Rule-based
JSON valid {"type": "json_valid", "expected_schema": dict} Rule-based
Readability {"type": "readability", "metric": str, "min_score": float, "max_score": float} Rule-based

Each JsonPathRule: {"json_path": str, "expected_value": str | number | bool, "expected_value_type": "string" | "number" | "boolean"}

Conformity and Groundedness use target_key, which defaults to trace.last.outputs.response.content. Groundedness uses context_key (default trace.last.outputs.metadata) when context is omitted. Set answer to check a fixed value instead of reading target_key.

hub_correctness uses text_key, and hub_metadata uses metadata_key. Other checks with a configurable target use target_key.


Create datasets, import scenarios, and auto-generate test suites from prompt presets or knowledge bases.

from giskard_hub.types import CreditEstimate, Dataset, Scenario, TaskProgress

Create a new empty dataset in the specified project.

name str Required
Display name.
project_id str Required
Project this dataset belongs to.
description str | None
Human-readable description.
input_schema dict[str, Any] | None
JSON Schema for scenario inputs. Defaults to the chat input schema.
output_schema dict[str, Any] | None
JSON Schema for scenario outputs. Defaults to the chat output schema.

Import scenarios from a file or list of dicts into a dataset.

project_id str Required
Project ID.
data FileTypes | list[dict[str, Any]] | str Required

File path (str or Path), file-like object, or list of dicts. Each record should have an interactions list ({"input", "output", "checks"}).

dataset_id str | None
Dataset to import into. If omitted, a new dataset is created.
name str | None
Name for the new dataset. Required when dataset_id is omitted.

Generate a dataset of scenarios from a prompt preset. The dataset’s state is "running" until generation completes. Use hub.helpers.wait_for_completion() to wait.

project_id str Required
Project ID.
agent_id str Required
Agent to generate scenarios for.
prompt_preset_id str Required
Prompt preset template to use.
n_examples int
Number of scenarios to generate.
dataset_id str | None
Append to an existing dataset.
dataset_name str | None
Name for the new dataset. Required when dataset_id is omitted.

Generate scenarios grounded in knowledge base documents. Async — use hub.helpers.wait_for_completion().

agent_id str Required
Agent to generate scenarios for.
knowledge_base_id str Required
Knowledge base to source documents from.
project_id str Required
Project ID.
dataset_name str
Name for the new dataset.
description str | None
Dataset description.
n_examples int
Number of scenarios to generate.
topic_ids list[str]
Filter to specific KB topics.
target_path str | None
JSONPath of the output field that the generated checks evaluate. It must select a single value.

Estimate the credit cost of a preset-based dataset generation.

num_examples int Required
Number of scenarios to generate.

Estimate the credit cost of a document-based dataset generation.

n_examples int Required
Total number of scenarios to generate.
dataset_id str Required

ID of the dataset to retrieve.

dataset_id str Required

ID of the dataset to update.

name str | None

Updated name.

description str | None

Updated description.

status TaskProgress | None

Async operation status.

input_schema dict[str, Any] | None

Updated JSON Schema for scenario inputs. Pass None to reset it to the chat input schema.

output_schema dict[str, Any] | None

Updated JSON Schema for scenario outputs. Pass None to reset it to the chat output schema.

project_id str | None

Project ID to filter by.

Delete a dataset by its ID.

dataset_id str Required
Dataset ID.

Delete multiple datasets at once.

dataset_ids list[str] Required
IDs of datasets to delete.

List all tags used across scenarios in a dataset.

dataset_id str Required
Dataset ID.

List all scenarios in a dataset.

dataset_id str Required
Dataset ID.

Search scenarios with filters, sorting, and pagination. Pass include_metadata=True to receive tuple[list[Scenario], APIPaginatedMetadata].

dataset_id str Required
Dataset ID.
query str | None
Free-text search query.
order_by list[ScenarioOrderByParam] | None
Sorting criteria.
filters ScenarioFiltersParam | None
Filter criteria.
limit int | None
Maximum results per page.
offset int | None
Results offset for pagination.
include_metadata bool Default: False
Include pagination metadata in the return value.

Run agents against datasets, inspect per-scenario results, and manage the evaluation lifecycle. Sub-resource: hub.evaluations.results.

from giskard_hub.types import CheckResult, CreditEstimate, Evaluation, Metric

Create and launch a new evaluation of an agent on a dataset.

project_id str Required

Project ID.

agent_id str Required

Agent to evaluate.

dataset_id str | None

Dataset to evaluate against. Provide exactly one of dataset_id or old_evaluation_id.

old_evaluation_id str | None

Previous evaluation whose scenarios are reused.

name str

Evaluation run name. Auto-generated when omitted.

tags list[str] | None

Restrict to scenarios with these tags. Only used with dataset_id.

run_count int

Run each scenario N times (for consistency testing).

scheduled_evaluation_id str | None

Link to a scheduled evaluation.

Example
evaluation = hub.evaluations.create(
project_id=project.id,
agent_id=agent.id,
dataset_id=dataset.id,
name="v2.1 regression run",
)
evaluation = hub.helpers.wait_for_completion(evaluation)
hub.helpers.print_metrics(evaluation)

Create a local evaluation for running agent inference in your own process.

agent_info MinimalAgentParam Required

Agent info as {"name": str, "description": str | None}. Only name is required.

dataset_id str Required
Dataset to evaluate against.
name str | None
Evaluation name.
tags list[str] | None
Filter scenarios by tags.

Upload a giskard.checks SuiteResult (from Giskard OSS) as a local Hub evaluation.

project_id str Required
Project to attach the uploaded evaluation to.
payload dict[str, Any] Required
JSON payload produced by SuiteResult.to_hub_format().
agent_id str | None
Hub agent to associate with the uploaded evaluation.
name str | None
Name for the evaluation. Auto-generated when omitted.
auto_classify_failures bool | None
Run the failure-category classifier on each failed scenario synchronously. Defaults to false.

Evaluate a single (input, output) pair against checks without creating a full evaluation.

project_id str Required
Project ID the checks belong to.
input_data dict[str, Any] Required
Structured input (for chat agents: {"messages": [...]}).
agent_output AgentOutputParam | dict | str Required
Agent’s output to evaluate. A bare string is wrapped as an assistant response.
checks Iterable[CheckConfigParam] Required
Checks to apply. Each entry needs an identifier or a check_id. Checks with enabled=False are skipped.
metadata dict[str, Any]
Interaction metadata to attach to the built trace, if known.
agent_description str
Deprecated and ignored, because the Hub no longer uses this field. Passing it emits a DeprecationWarning.

Rerun all errored results without triggering a full re-evaluation.

evaluation_id str Required
Evaluation ID.

Estimate the credit cost of an evaluation before you create it.

project_id str Required
Project the evaluation would run in.
dataset_id str | None
Dataset to draw scenarios from. Provide this or old_evaluation_id, not both.
old_evaluation_id str | None
Previous evaluation whose scenarios would be reused.
tags list[str] | None
Restrict to scenarios with these tags. Only used with dataset_id.
run_count int
Number of times each scenario would be run.

Estimate the credit cost of running checks with .run_single().

project_id str Required
Project the checks belong to.
checks Iterable[CheckConfigParam] Required
Checks to price, in the same shape as the checks argument of .run_single().
agent_id str | None
Agent the checks would run against, when known.

Estimate the credit cost of .rerun_errored_results().

evaluation_id str Required
Evaluation whose errored results would be rerun.

Retrieve an evaluation by its ID.

evaluation_id str Required
Evaluation ID.

Update an evaluation’s name.

evaluation_id str Required
Evaluation ID.
name str Required
New name for the evaluation.

List all evaluations for a project.

project_id str Required
Project ID.

Delete an evaluation by its ID.

evaluation_id str Required
Evaluation ID.

Delete multiple evaluations at once.

evaluation_ids list[str] Required
IDs of evaluations to delete.

Inspect, filter, update, and rerun individual evaluation results.

from giskard_hub.types import CreditEstimate, FailureCategory, ScenarioEvaluation
result_id str Required

Result ID.

evaluation_id str Required

Evaluation ID.

include list[Literal["scenario"]] | None

Embed related resources.

Update the failure category of an evaluation result.

result_id str Required
Result ID.
evaluation_id str Required
Evaluation ID.
failure_category FailureCategoryParam | None
Failure classification to assign.
evaluation_id str Required

Evaluation ID.

include list[Literal["scenario"]] | None

Embed related resources.

Search and filter results. Pass include_metadata=True for pagination metadata.

evaluation_id str Required
Evaluation ID.
query str | None
Free-text search query.
filters ResultFiltersParam | None
Filter criteria.
order_by list[ResultOrderByParam] | None
Sorting criteria.
limit int | None
Maximum results.
offset int | None
Results offset.
include list[Literal["scenario"]] | None
Embed related resources.
include_metadata bool Default: False
Include pagination metadata.

Rerun a single result.

result_id str Required

Result ID.

evaluation_id str Required

Evaluation ID.

Estimate the credit cost of .rerun_scenario().

result_id str Required

Result whose scenario would be rerun.

evaluation_id str Required

Evaluation the result belongs to.

Submit locally-generated agent output for evaluation and scoring.

result_id str Required
Result ID.
evaluation_id str Required
Evaluation ID.
agent_output AgentOutputParam | None
Agent output to submit.
error str | None
Error message if the agent call failed.

Show or hide a result from the default view.

result_id str Required
Result ID.
evaluation_id str Required
Evaluation ID.
hidden bool Required
Whether the result should be hidden.
set_scenario_draft bool | None
Also set the linked scenario to draft status.

High-level convenience methods for the most common SDK workflows: waiting for async operations, running evaluations, and printing metrics.

from giskard_hub.types import Evaluation, Scan, ChatMessage, AgentOutput

Poll an entity until it leaves its running state. Returns the refreshed entity.

entity TStateful Required

One of Evaluation, Scan, Dataset, KnowledgeBase, ScanProbe, or ScenarioEvaluation. Other types raise TypeError.

poll_interval float Default: 5.0

Seconds between polling requests.

max_retries int Default: 360

Maximum polling attempts. Default: 30 minutes at 5-second intervals.

running_states Collection[str] Default: {"running"}

States considered as “still processing”.

error_states Collection[str] Default: {"error"}

Terminal error states.

raise_on_error bool Default: True

Raise ValueError if entity enters an error state.

Run an evaluation for a given agent over a dataset. Handles both remote and local agents.

agent str | Agent | Callable Required

Agent ID, Agent object, or a Python callable for local evaluation. Callable signature: (messages: list[ChatMessage]) -> str | ChatMessage | AgentOutput.

dataset str | Dataset Required

Dataset ID or Dataset object.

project str | Project | None

Required when agent is remote (str or Agent). Not required for local callables.

name str | None
Evaluation run name.
tags list[str] | None
Filter scenarios by tags.
evaluation = hub.helpers.evaluate(
agent=my_agent, dataset=my_dataset,
project=my_project, name="Remote eval",
)

Print a formatted metrics table to the console for an evaluation or scan.

entity Evaluation | Scan Required

The evaluation or scan to print metrics for.


Create, search, and manage indexed document collections for grounded evaluations, document-based test generation, and knowledge-grounded vulnerability scans.

from giskard_hub.types import (
KnowledgeBase,
KnowledgeBaseDocumentRow,
KnowledgeBaseDocumentDetail,
)

Create a knowledge base and upload documents. Indexing happens asynchronously after creation — use hub.helpers.wait_for_completion().

name str Required

Display name.

project_id str Required

Project this KB belongs to.

data FileTypes | list[dict[str, Any]] | str Required

Documents as a list of dicts, a file path string, or a pathlib.Path (JSON/JSONL format).

description str | None

Human-readable description.

document_column str

Column name for document text. Server defaults to "text" if omitted.

topic_column str

Column name for topic label. Server defaults to "topic" if omitted.

Example
kb = hub.knowledge_bases.create(
project_id=project.id,
name="Product Docs",
data=[
{"text": "30-day return policy.", "topic": "Returns"},
{"text": "Free shipping over $50.", "topic": "Shipping"},
],
)
kb = hub.helpers.wait_for_completion(kb)

Search documents in a knowledge base with filters, sorting, and pagination.

knowledge_base_id str Required
Knowledge base ID.
query str | None
Text to find in the document content (case-insensitive substring match).
Filter criteria.
order_by list[KnowledgeBaseDocumentOrderByParam] | None
Sorting criteria.
limit int | None
Maximum results.
offset int | None
Results offset.
include_metadata bool Default: False
Include pagination metadata. If true, returns a tuple of (results, metadata).

Retrieve a specific document with its full content.

knowledge_base_id str Required
Knowledge base ID.
document_id str Required
Document ID.

Retrieve a knowledge base by its ID, including its topics.

knowledge_base_id str Required
Knowledge base ID.

Update a knowledge base’s metadata.

knowledge_base_id str Required
Knowledge base ID.
name str | None
Updated name.
description str | None
Updated description.
project_id str | None
Project ID to move the knowledge base to.
status TaskProgress | None
Async operation status.

List all knowledge bases, optionally filtered by project.

project_id str | None
Project ID to filter by.

Delete a knowledge base by its ID.

knowledge_base_id str Required
Knowledge base ID.

Delete multiple knowledge bases at once.

knowledge_base_ids list[str] Required
IDs of knowledge bases to delete.

Top-level workspace that groups all related resources: agents, datasets, evaluations, scans, and more. Sub-resource: hub.projects.prompt_presets.

from giskard_hub.types import Project
name str Required

Project name.

description str | None

Project description.

project_id str Required

Project ID.

name str | None

Updated name.

description str | None

Updated description.

failure_categories Iterable[FailureCategoryParam] | None

Project-level failure classifications.

Retrieve a project by its ID.

project_id str Required
Project ID.

List all projects accessible to the current user.

Delete a project by its ID.

project_id str Required
Project ID.

Delete multiple projects at once.

project_ids list[str] Required
IDs of projects to delete.

Reusable persona and behaviour templates for preset-based dataset generation.

from giskard_hub.types import PromptPreset, PromptPresetPreview
project_id str Required

Project ID.

name str Required

Prompt preset name.

description str Required

Prompt preset description.

rules list[str]

Rules the generated conversations should follow.

Generate a preview conversation for a prompt preset without persisting it.

project_id str Required
Project ID.
description str Required
Prompt preset description.
agent_id str Required
Agent to generate the preview for.
rules list[str]
Prompt preset rules.

Retrieve a prompt preset by its ID within a project.

prompt_preset_id str Required
Prompt preset ID.
project_id str Required
Project ID.

Update an existing prompt preset’s definition.

prompt_preset_id str Required
Prompt preset ID.
project_id str Required
Project ID.
name str | None
Updated name.
description str | None
Updated description.
rules list[str] | None
Updated rules.

List all prompt presets for a project.

project_id str Required
Project ID.

Delete a prompt preset from a project.

prompt_preset_id str Required
Prompt preset ID.
project_id str Required
Project ID.

Launch automated vulnerability scans covering the OWASP LLM Top 10 and additional threat categories. Sub-resources: hub.scans.probes, hub.scans.attempts.

from giskard_hub.types import (
CreditEstimate,
Scan,
ScanAvailableProbe,
ScanCategory,
ScanProbe,
ScanProbeAttempt,
Severity,
ReviewStatus,
)

Launch a new vulnerability scan of an agent.

project_id str Required

Project ID.

agent_id str Required

Agent to scan.

knowledge_base_id str | None

Anchor probes to KB documents for domain-specific attacks.

probe_ids list[str] | None

List of specific probe IDs to run in the scan. Get the IDs from .list_available_probes().

tags list[str] | None

Limit scan to specific threat categories (e.g. ["gsk:threat-type='prompt-injection'"]).

Example
scan = hub.scans.create(
project_id=project.id,
agent_id=agent.id,
tags=["gsk:threat-type='prompt-injection'"],
)
scan = hub.helpers.wait_for_completion(scan)
print(f"Grade: {scan.grade}")
hub.helpers.print_metrics(scan)

Estimate the credit cost of a scan before you create it.

knowledge_base_id str | None
Knowledge base the scan would use.
probe_ids list[str] | None
Probe IDs that the scan would include.
tags list[str] | None
Tags that would restrict the scan.

List all available scan categories and their OWASP mappings.

List every probe that you can use in a scan. Use the IDs with .create(probe_ids=[...]).

List all probe results for a scan.

scan_id str Required
Scan ID.

Retrieve a scan result by its ID, with optional related resource inclusion.

scan_id str Required
Scan ID.
include list[Literal["agent", "knowledge_base"]] | None
Embed related objects.

List all scan results, optionally filtered by project.

project_id str | None
Project ID to filter by.
include list[Literal["agent", "knowledge_base"]] | None
Embed related objects.

Delete a scan result by its ID.

scan_id str Required
Scan ID.

Delete multiple scan results at once.

scan_ids list[str] Required
IDs of scans to delete.
probe_id str Required

Probe ID.

List all adversarial attempts for a specific probe.

probe_id str Required
Probe ID.

Update a probe attempt’s review status, severity, or success flag.

probe_attempt_id str Required
Probe attempt ID.
review_status ReviewStatus | None
Review status: "pending", "ignored", "acknowledged", "corrected".
severity Severity | None
Severity: SAFE (0), MINOR (10), MAJOR (20), CRITICAL (30).
successful bool | None
Whether the attack was successful.

Launch Autonomous Agent Audits, follow their progress, and read their findings.

from giskard_hub.types import (
CreditEstimate,
RedTeamAudit,
RedTeamAuditContent,
RedTeamAuditLogs,
)

Launch a new audit of an agent. The audit runs in the Hub. See Autonomous Agent Audit.

project_id str Required

Project to run the audit in.

target_agent_id str Required

Agent to audit. The agent must belong to the project.

name str | None

Name of the audit. When omitted, the server uses Audit for <agent name> on <date>.

mode "regular" | "light"

Audit effort. "light" is the Light audit and "regular" is the Full audit. Defaults to "regular" on the server.

input_evaluation_ids list[str]

Evaluations of the same project to use as leads for the attacker agents.

scan_types list[Literal["vulnerability", "garak", "deepteam", "lidar"]] | None

Scan suites to run during the audit. When omitted, the server runs its default suites if no input_evaluation_ids are given, and no suite otherwise.

Example
audit = hub.red_team_audits.create(
project_id=project.id,
target_agent_id=agent.id,
name="Customer support agent audit",
mode="light",
)
print(audit.id, audit.status)

Import the results of an audit that ran outside the Hub.

project_id str Required
Project to import the audit into.
target_agent_id str Required
Audited agent. The agent must belong to the project.
content FileTypes Required
JSON file with the audit report content.
name str | None
Name of the audit.
report FileTypes
PDF file with the audit report.
risk_model FileTypes
JSON file with the risk model of the audit.

Retrieve an audit by its ID. Read status and progress to follow a running audit.

audit_id str Required
Audit ID.

Retrieve the findings, remediations, and trust level of an audit. The content is available only when RedTeamAudit.has_audit_content is True. Otherwise, the call raises NotFoundError.

audit_id str Required
Audit ID.

Retrieve a page of the execution logs of an audit.

audit_id str Required
Audit ID.
after int
Return only the log chunks with a sequence number greater than this value. To get the next page, pass the next_cursor of the previous page. Defaults to 0 on the server.
limit int
Maximum number of log chunks to return, from 1 to 1000. Defaults to 500 on the server.

List audits, optionally filtered by project.

project_id str | None
Project ID to filter by.

Delete an audit by its ID. A running audit is canceled first.

audit_id str Required
Audit ID.

Estimate the credit cost of an audit before you launch it.

mode "regular" | "light"
Audit effort to price. Defaults to "regular" on the server.

Set up recurring evaluation runs on a daily, weekly, or monthly cadence for continuous quality monitoring.

from giskard_hub.types import ScheduledEvaluation, FrequencyOption
project_id str Required

Project ID.

agent_id str Required

Agent to evaluate.

dataset_id str Required

Dataset to evaluate against.

frequency FrequencyOption Required

"daily", "weekly", or "monthly".

name str Required

Name of the scheduled evaluation.

time str Required

Time of day in HH:MM format (UTC).

day_of_week int | None

Weekly only: 1 (Monday) through 7 (Sunday).

day_of_month int | None

Monthly only: 1 through 28.

tags list[str] | None

Filter scenarios by tags.

run_count int | None

Run each scenario N times.

List all past evaluation runs generated by this scheduled evaluation.

scheduled_evaluation_id str Required
Scheduled evaluation ID.
include list[Literal["agent", "dataset"]] | None
Related resources to include in the response.

Retrieve a scheduled evaluation by its ID.

scheduled_evaluation_id str Required
Scheduled evaluation ID.
include list[Literal["evaluations"]] | None
Replace the evaluations references with full Evaluation objects.

Update a scheduled evaluation’s configuration.

scheduled_evaluation_id str Required
Scheduled evaluation ID.
name str | None
Updated name.
frequency FrequencyOption | None
Updated frequency.
time str | None
Updated time (HH:MM, UTC).
day_of_week int | None
Updated day of week (1—7).
day_of_month int | None
Updated day of month (1—28).
run_count int | None
Updated run count.
paused bool | None
Updated paused status.

List all scheduled evaluations for a project.

project_id str Required
Project ID.
include list[Literal["evaluations"]] | None
Replace each schedule’s evaluations references with full Evaluation objects.
last_days int | None
Only keep the evaluation runs of the last N days (1 to 365) in each schedule’s evaluations list. The method still returns all schedules.

Delete a scheduled evaluation by its ID.

scheduled_evaluation_id str Required
Scheduled evaluation ID.

Delete multiple scheduled evaluations at once.

scheduled_evaluation_ids list[str] Required
IDs to delete.

Lightweight issue tracker for managing findings from evaluations and scans. Link tasks to specific evaluation results, scenarios, or probe attempts.

from giskard_hub.types import Task, TaskStatus, TaskPriority

Create a task. The Hub requires at least one linked resource: evaluation_result_id, dataset_scenario_id, or probe_attempt_id.

project_id str Required

Project ID.

description str Required

What needs to be done.

priority TaskPriority | None

"low", "medium", or "high".

status TaskStatus | None

"open", "in_progress", or "resolved".

assignee_ids list[str]

User IDs to assign.

evaluation_result_id str | None

Link to a specific evaluation result.

dataset_scenario_id str | None

Link to a specific scenario.

probe_attempt_id str | None

Link to a specific scan probe attempt.

disable_test bool

Set the linked scenario to draft status. This applies only when you also give dataset_scenario_id.

hide_result bool

Hide the linked evaluation result.

Retrieve a task by its ID.

task_id str Required
Task ID.

Update an existing task’s metadata and assignees.

task_id str Required
Task ID.
status TaskStatus | None
Updated status: "open", "in_progress", or "resolved".
priority TaskPriority | None
Updated priority: "low", "medium", or "high".
description str | None
Updated description.
assignee_ids list[str] | None
Updated user IDs to assign.
set_scenario_status str | None
Also set the linked scenario’s status, "active" or "draft".

List all tasks for a project, ordered by creation date descending.

project_id str Required
Project ID.

Delete a task by its ID.

task_id str Required
Task ID.

Delete multiple tasks at once.

task_ids list[str] Required
IDs of tasks to delete.

Create, update, and manage individual scenarios within datasets. Sub-resource: hub.scenarios.comments.

from giskard_hub.types import Scenario, ScenarioComment, Interaction

Create a new scenario from a list of interactions.

dataset_id str Required
Dataset this scenario belongs to.
interactions Iterable[InteractionParam] Required

Interactions as [{"input": {...}, "output": {...}, "checks": [...]}]. For chat agents, input is {"messages": [{"role", "content"}]}.

status "active" | "draft" | None
Scenario status.
tags list[str]
Tags for filtering.
source_probe_attempt_id str | None
Scan probe attempt this scenario was promoted from.

Retrieve a scenario by its ID.

scenario_id str Required
Scenario ID.

Update an existing scenario’s interactions, tags, or status.

scenario_id str Required
Scenario ID.
interactions Iterable[InteractionParam] | None
New list of interactions. It replaces all interactions of the scenario.
status "active" | "draft" | None
Updated status.
tags list[str] | None
Updated tags.
dataset_id str | None
Move the scenario to a different dataset.

Delete a scenario by its ID.

scenario_id str Required
Scenario ID.
scenario_ids list[str] Required

IDs of scenarios to delete.

Update multiple scenarios at once. All scenarios must belong to the same dataset. Returns the updated scenarios.

scenario_ids list[str] Required
Scenario IDs.
status Literal["active", "draft"] | None
Updated status. "active" applies only to scenarios that have at least one enabled check.
disabled_checks list[str] | None
IDs of checks to disable on the selected scenarios.
enabled_checks list[str] | None
IDs of checks to enable on the selected scenarios.
added_tags list[str] | None
Tags to add.
removed_tags list[str] | None
Tags to remove.

Copy or move scenarios to another dataset. By default, the scenarios are copied.

scenario_ids list[str] Required
Scenario IDs to move.
target_dataset_id str Required
Target dataset ID.
duplicate bool Default: True
If True, copy the scenarios and keep the originals. Pass False to move them.
scenario_id str Required

Scenario ID.

content str Required

Comment text.

comment_id str Required

Comment ID.

scenario_id str Required

Scenario ID.

content str Required

Updated text.

comment_id str Required

Comment ID.

scenario_id str Required

Scenario ID.


Access conversations captured from the Hub's interactive playground UI.

from giskard_hub.types import PlaygroundChat
project_id str Required

Project ID.

include list[Literal["agent"]] | None

Embed related resources (["agent"]).

limit int | None

Maximum results.

offset int | None

Results offset.

chat_id str Required

Chat ID.

include list[Literal["agent"]] | None

Embed related resources (["agent"]).

Delete a playground chat by its ID.

chat_id str Required
Chat ID.

Delete multiple playground chats at once.

chat_ids list[str] Required
IDs of chats to delete.

Query the audit trail for compliance reporting, change history, and debugging. Every create, update, and delete action is recorded.

from giskard_hub.types import Audit, AuditDisplay

Search audit events with free-text queries, filters, and pagination. Pass include_metadata=True for tuple[list[Audit], APIPaginatedMetadata].

query str | None

Free-text search query.

filters AuditFiltersParam | None

Filter criteria (see filter keys below).

order_by list[AuditOrderByParam] | None

Sorting criteria.

limit int

Maximum results.

offset int

Results offset.

compact bool

When True, trim the data field of each audit event to its summary keys.

include_metadata bool Default: False

Include pagination metadata. If true, returns a tuple of (results, metadata).

Filter keys:

Key Type Example
project_id list filter {"selected_options": ["project-id"]}
entity_type list filter {"selected_options": ["agent", "evaluation"]}
action list filter {"selected_options": ["insert", "delete"]}
user_id list filter {"selected_options": ["user-id"]}
created_at date range {"from_": "2025-01-01T00:00:00Z", "to_": "2025-12-31T23:59:59Z"}

List audit history for a specific resource, including diffs of each change. Pass include_metadata=True for pagination metadata.

entity_id str Required
UUID of the entity.
entity_type str Required
Type of entity (e.g. "project", "agent", "evaluation").
limit int
Maximum results.
offset int
Results offset.
include_metadata bool Default: False
Include pagination metadata.

Read the credit balance and usage of your Hub. To price an action before you start it, use the estimate methods of `hub.datasets`, `hub.evaluations`, `hub.scans`, and `hub.red_team_audits`.

from giskard_hub.types import CreditUsageSummary

Retrieve the credit usage summary.

project_id str | None

Restrict the summary to a single project.

user_id str | None

Restrict the summary to a single user. When omitted, a user without permission to read other users gets only their own usage.

Example
credits = hub.usage.retrieve_credits()
print(credits.available_balance)

All Python types referenced by the methods above. Click any type name in a method’s return value or parameter to jump straight to its definition. Each card is collapsed by default. Expand it to see the fields.

Shared building blocks used by every resource. The *Param variants are TypedDicts used in request bodies.

role str

Sender role: typically "user", "assistant", or "system".

content str

Message text.

role str Required

Sender role: typically "user", "assistant", or "system".

content str Required

Message text.

role str

Sender role.

content str

Message text.

metadata dict[str, object] | None

Arbitrary metadata attached to the message.

role str Required

Sender role.

content str Required

Message text.

metadata dict[str, object] | None

Arbitrary metadata attached to the message.

name str

Header name.

value str

Header value.

name str Required

Header name.

value str Required

Header value.

message str

Error message returned by the agent or runtime.

details dict[str, object] | None

Optional structured error context.

message str Required

Error message returned by the agent or runtime.

details dict[str, object]

Optional structured error context.

id str

Unique identifier.

email str

User email address.

name str | None

Display name, if set.

groups list[GroupReference]

Groups that the user belongs to.

id str

Unique identifier.

name str

Group name.

id str

Unique identifier.

name str

Display name.

state TaskState

Current state.

current int

Items processed so far.

total int

Total items to process.

error str | None

Error message if the task failed.

"running" Task is in progress.
"finished" Task completed successfully.
"error" Task failed.
"canceled" Task was canceled.
"skipped" Task was skipped.
count int

Number of items returned in this page.

offset int

Offset of the first item in this page.

limit int

Maximum page size requested.

total int

Total number of items across all pages.

selected_options list[Any]

Values to match.

is_empty bool

Match rows where the column is empty. Defaults to False.

match_mode "include" | "exclude"

Keep or drop the matching rows. Defaults to "include".

match_logic "any" | "all"

Match any or all of the selected options. Defaults to "any".

from_ str | None

Start of the date range, as an ISO 8601 string.

to_ str | None

End of the date range, as an ISO 8601 string.

id str

Unique identifier.

name str

Display name.

description str | None

Human-readable description.

url str

HTTP endpoint URL.

project_id str

Parent project ID.

supported_languages list[str]

Language codes the agent supports.

headers dict[str, str]

HTTP headers sent with every request.

input_schema dict[str, Any] | None

JSON Schema describing the agent’s expected input.

output_schema dict[str, Any] | None

JSON Schema describing the agent’s expected output.

auto_bindings list[ForwardBinding | AggregateBinding] | None

Automatic input/output bindings.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

mode "forward"

Binding mode discriminator.

target str

Input field the value is written to.

source str

JSONPath in the previous output the value is read from.

mode "aggregate"

Binding mode discriminator.

target str

Input field the aggregated values are written to (e.g. "messages").

outputs_path str

JSONPath in each previous output to aggregate (e.g. "$.response").

mode "forward"

Binding mode discriminator. Always set it, because the Hub uses it to tell the binding types apart.

target str Required

Input field the value is written to.

source str Required

JSONPath in the previous output the value is read from.

mode "aggregate"

Binding mode discriminator. Always set it, because the Hub uses it to tell the binding types apart.

target str Required

Input field the aggregated values are written to (for example "messages").

outputs_path str Required

JSONPath in each previous output to aggregate (for example "$.response").

id str

Unique identifier.

name str

Agent name. Defaults to "".

input_schema dict[str, Any]

JSON Schema of the agent’s input.

output_schema dict[str, Any]

JSON Schema of the agent’s output.

id str

Unique identifier.

name str

Display name.

response ChatMessage | None

The agent’s response message.

error ExecutionError | None

Error details if the agent call failed.

metadata dict[str, object] | None

Arbitrary metadata returned by the agent.

response ChatMessageParam | None Required

The agent’s response message.

error ExecutionErrorParam | None

Error details if the agent call failed.

metadata dict[str, object]

Arbitrary metadata returned by the agent.

output dict[str, Any]

Raw structured output of the agent, matching its output schema. For chat agents: {"response": {...}, "metadata": {...}}.

error ExecutionError | None

Error details if the agent call failed.

name str

Agent name (used for local evaluations).

description str | None

Optional description.

name str Required

Agent name.

description str | None

Optional description.

id str

Unique identifier.

built_in bool

Whether this is a built-in check.

identifier str

Reusable identifier string.

name str

Display name.

description str | None

Human-readable description.

project_id str

Parent project ID.

params dict[str, Any]

Check-specific configuration, derived from spec without the kind key. The shape depends on the check type, as in Check type params but without the type key.

spec dict[str, Any]

Full check specification as stored by the Hub, including the kind discriminator.

source "builtin" | "project"

Whether the check is a built-in check or a check defined in the project.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

name str

Check identifier.

display_name str | None

Human-readable name.

status TaskState

Execution status.

passed bool | None

Whether the check passed.

error str | None

Error message if execution failed.

reason str | None

Explanation that the check returned. For LLM-based checks, this is the reasoning of the judge.

annotations list[OutputAnnotation | ContextAnnotation] | None

Annotated spans in the agent’s response (OutputAnnotation) or in the reference text of the check (ContextAnnotation).

details dict[str, Any] | None

Extra check-specific details returned by the check.

spec dict[str, Any] | None

Snapshot of the resolved check specification used at evaluation time. Set on evaluation results only.

target str | None

JSONPath of the field that the check evaluated. Set on evaluation results only.

reference_text str | None

Reference text that the check compared against, when the check uses one. Set on .run_single() results only.

check_id str | None

ID of the check that produced this result.

check_position int | None

Position of the check in the interaction’s check list.

identifier str

Check identifier.

enabled bool | None

Whether the check is enabled.

params dict[str, Any]

Check-specific parameters (spec without the kind key).

spec dict[str, Any] | None

Full check specification, including the kind discriminator.

position int

Position of the check in the list.

identifier str

Check identifier to apply. Each entry needs an identifier or a check_id.

check_id str

ID of the check to apply, as an alternative to identifier.

enabled bool

Whether the check is enabled. Checks with enabled=False are skipped.

params dict[str, Any]

Check-specific parameters. Put params beside identifier, for example {"identifier": "hub_conformity", "params": {"rule": "Use formal language."}}.

override_spec dict[str, Any]

Values that override the stored check specification for this run. In .run_single() and .estimate_run_interaction_checks(), the SDK merges override_spec and params, and params wins on the same key.

text str

The annotated substring.

label str

Label assigned to the span.

start_char_index int

Start position in the response (character offset).

end_char_index int

End position in the response (character offset).

type "output"

The annotation references the agent’s output.

text str

The annotated substring.

label str

Label assigned to the span.

start_char_index int

Start position in the reference text of the check (character offset).

end_char_index int

End position in the reference text of the check (character offset).

type "context"

The annotation references the reference text of the check, such as the grounding context or the expected answer.

json_path str

JSONPath expression to evaluate against the agent’s output metadata.

expected_value bool | int | float | str

The value the JSONPath should resolve to.

expected_value_type "string" | "number" | "boolean"

Expected primitive type of the resolved value.

alias union

TypeAlias for the union of typed params dicts for built-in checks and compatibility aliases: HubCorrectnessParamsParam, HubConformityParamsParam, HubGroundednessParamsParam, HubMetadataParamsParam, LLMJudgeParamsParam, ConformityParamsParam, GroundednessParamsParam, ContradictionParamsParam, ToxicityParamsParam, AnswerRelevanceParamsParam, SemanticSimilarityParamsParam, StringMatchingParamsParam, RegexMatchingParamsParam, the six comparison params, JsonValidParamsParam, and ReadabilityParamsParam. See Check type params for the concrete shapes.

id str

Unique identifier.

name str

Display name.

description str | None

Human-readable description.

project_id str

Parent project ID.

input_schema dict[str, Any]

JSON Schema for scenario inputs (defaults to the chat input schema).

output_schema dict[str, Any]

JSON Schema for scenario outputs (defaults to the chat output schema).

status TaskProgress

Async operation status (for generated datasets).

tags list[str]

All tags used across scenarios.

state TaskState

Computed from status.state, for example "finished" or "running".

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

name str

Display name.

dataset_id str

Dataset to subset.

dataset_name str | None

Name of the dataset.

tags list[str] | None

Restrict to scenarios matching these tags.

target_type "dataset" | None

Discriminator for criterion unions.

input_schema dict[str, Any] | None

JSON Schema of the dataset’s scenario inputs.

output_schema dict[str, Any] | None

JSON Schema of the dataset’s scenario outputs.

id str

Unique identifier.

dataset_id str

Parent dataset ID.

interactions list[Interaction] | None

Ordered interactions, each with an input, optional output, and checks.

comments list[ScenarioComment]

Comments attached to this scenario.

tags list[str]

Tags for filtering.

status "active" | "draft"

Scenario status.

schema_validation ScenarioSchemaValidation

Whether the scenario’s input and output match the dataset schemas.

annotations dict[str, Any]

User-supplied data, for example from an imported scenario, that checks can read as trace.annotations.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str | None

Unique identifier.

position int

Zero-based position of the interaction in the scenario.

input Any

Input matching the dataset’s input schema (for chat: {"messages": [...]}). Any JSON value is accepted.

output Any

Expected output (display and reference only, matching the output schema). Any JSON value is accepted.

checks list[InteractionCheckConfig] | None

Checks applied to the agent’s response for this interaction.

metadata dict[str, Any] | None

Metadata attached to the interaction.

simulator_config dict[str, Any] | None

Simulator configuration of the interaction. The Hub stores and exports it with the scenario.

created_at datetime | None

Creation timestamp.

updated_at datetime | None

Last update timestamp.

check_id str

ID of the check.

name str | None

Display name of the check.

target str | None

JSONPath of the field that the check evaluates, when it replaces the default target of the check.

enabled bool

Whether the check runs. Defaults to True.

override_spec dict[str, Any] | None

Values that override the stored check specification for this interaction.

position int

Position of the check in the interaction’s check list. Defaults to 0.

spec dict[str, Any] | None

Resolved check specification that the Hub snapshots when it creates an evaluation.

input Any Required

Input matching the dataset’s input schema (for chat: {"messages": [...]}). Any JSON value is accepted.

output Any | None

Expected output, matching the dataset’s output schema. Any JSON value is accepted.

position int

Zero-based position of the interaction. Defaults to its index in the list.

checks Iterable[InteractionCheckConfigParam] | None

Checks to apply to the agent’s response for this interaction.

metadata dict[str, Any] | None

Metadata attached to the interaction.

identifier str Required

Identifier of the check to apply.

enabled bool

Whether the check runs. Defaults to True.

params dict[str, Any]

Check-specific parameters. The SDK sends them to the Hub as override_spec, without the type key.

input_valid bool

Whether the interaction inputs match the dataset’s input schema.

output_valid bool

Whether the interaction outputs match the dataset’s output schema.

id str

Unique identifier.

type "test_case"

Reference type discriminator.

id str

Unique identifier.

content str

Comment text.

Author of the comment.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id "created_at" | "id" | "status" | "updated_at" Required

Column to sort by.

desc bool

Sort descending when true.

alias dict

Dict mapping a column name to a ListFilterValueParam or a DateRangeFilterValueParam. Valid columns: "metrics", "status", "tags".

id str

Unique identifier.

name str

Display name.

The evaluated agent. By default this is an AgentInterface with id, name, input_schema, and output_schema.

The dataset used.

criteria DatasetSubset | None

Subset of the dataset used as evaluation criteria.

project_id str

Parent project ID.

local bool

Whether this is a local evaluation.

is_upload bool

Whether this evaluation was imported via hub.evaluations.upload().

metrics list[Metric]

Aggregated pass/fail metrics per check.

failure_categories dict[str, int]

Number of failed results per failure category title. Failed results without a category count under "__undefined__".

tags list[Metric]

Per-tag aggregated metrics.

status TaskProgress

Async operation status.

state TaskState

Computed from status.state, for example "finished", "running", or "error".

old_evaluation_id str | None

ID of the previous evaluation this one is based on.

scheduled_evaluation_id str | None

ID of the scheduled evaluation that produced this run.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

name str

Display name.

name str

Check identifier (for example "hub_correctness"), "global" for the overall metric, or the tag name for items in Evaluation.tags.

display_name str | None

Human-readable name.

passed int | None

Number of scenarios that passed.

failed int | None

Number of scenarios that failed.

errored int | None

Number of scenarios that errored.

total int | None

Total scenarios evaluated.

success_rate float | None

Pass rate between 0.0 and 1.0, computed as passed / (passed + failed). Errored results do not count. None when no result passed or failed.

id str

Unique identifier.

evaluation_id str

Parent evaluation ID.

The scenario.

scenario_exists bool | None

Whether the scenario still exists.

state TaskState

Result state. One of the TaskState values, such as "finished", "running", "error", or "canceled".

results list[CheckResult]

Per-check outcomes.

interaction_results list[InteractionResultData] | None

Per-interaction inputs, outputs, and check results.

output AgentOutput | Any | None

Output of the last interaction. A JSON object parses as AgentOutput. Any other JSON value (string, list, number, or boolean) stays as is.

error str | None

Error message if the agent call failed.

failure_category FailureCategoryResult | None

Assigned failure classification.

hidden bool

Whether this result is hidden from the default view.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

interaction_position int

Position of the interaction in the scenario.

input Any | None

The input sent to the agent for this interaction. Any JSON value.

output Any | None

The agent’s response for this interaction. Any JSON value.

checks list[InteractionCheckConfig] | None

Check configurations applied to this interaction.

check_results list[CheckResult]

Outcomes of the checks for this interaction. Empty when no check ran.

state str

Execution state of this interaction. Empty string when not set.

error str | None

Error message if the interaction failed.

metadata dict[str, Any] | None

Metadata of the scenario interaction at this position, copied from the scenario snapshot.

identifier str

Stable identifier (e.g. "hallucination").

title str

Display title.

description str

Human-readable description.

identifier str Required

Stable identifier.

title str Required

Display title.

description str Required

Human-readable description.

id str

Unique identifier.

type "test_case_evaluation"

Reference type discriminator.

category FailureCategory | None

The assigned failure category.

status TaskState | None

Classification status.

error str | None

Error message if classification failed.

id "failure_category_name" | "id" | "sample_success" | "status" | "visibility" Required

Column to sort by.

desc bool

Sort descending when true.

alias dict

Dict mapping a column name to a filter value. Valid columns: "failure_category_name", "metrics", "sample_success", "status", "tags", "visibility". You can also pass "scenario_id" with a scenario ID string to return only the results of that scenario. "chat_test_case_id" is a deprecated alias of "scenario_id".

id str

Unique identifier.

The scanned agent. An AgentInterface by default, or the full Agent when you pass include=["agent"].

project_id str

Parent project ID.

knowledge_base KnowledgeBaseReference | KnowledgeBase | None

Linked knowledge base, if the scan was grounded.

grade "A" | "B" | "C" | "D" | None

Overall grade.

status TaskProgress

Async operation status.

state TaskState

Computed from status.state.

start_datetime datetime | None

When the scan started.

end_datetime datetime | None

When the scan finished.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique probe identifier.

name str

Probe display name.

desc str

Human-readable description.

tags list[str]

Tags applied to this probe.

id str

Unique identifier.

title str

Display title.

description str

Human-readable description.

owasp_id str | None

Mapping to the OWASP LLM Top 10, if applicable.

id str

Unique identifier.

name str

Probe display name.

category str

Probe category.

description str

Human-readable description.

probe_lidar_id str

LIDAR probe identifier.

tags list[str]

Tags applied to this probe.

scan_id str

Parent scan ID.

metrics list[ScanProbeMetric] | None

Aggregated severity counts.

status TaskProgress

Async operation status.

state TaskState

Convenience accessor for status.state.

severity Severity

Severity level.

count int

Number of attempts at this severity.

id str

Unique identifier.

probe_id str

Parent probe ID.

input dict[str, Any]

Structured adversarial input sent to the agent (for chat agents: {"messages": [...]}).

output dict[str, Any]

Structured response from the agent.

metadata dict[str, object]

Arbitrary metadata about the attempt.

reason str

Explanation of the attempt outcome and its severity, as given by the probe evaluator.

severity Severity

Severity assigned to the attempt outcome.

review_status ReviewStatus

Reviewer-assigned status.

error ScanProbeAttemptError | None

Error details if the attempt failed to execute.

message str

Error message.

SAFE 0

No vulnerability found.

MINOR 10

Minor issue.

MAJOR 20

Significant issue.

CRITICAL 30

Critical vulnerability.

"pending" Awaiting review.
"ignored"

Reviewed, but not added to a dataset.

"acknowledged"

Reviewed and added to a dataset.

"corrected"

A reviewer marked the attempt as a false positive.

id str

Unique identifier.

type "probe_attempt"

Reference type discriminator.

Types returned by hub.red_team_audits.

id str

Unique identifier.

project_id str

Parent project ID.

target_agent_id str

Audited agent ID.

name str | None

Audit name.

mode "regular" | "light"

Audit effort. "light" is the Light audit and "regular" is the Full audit.

Current status of the audit.

progress RedTeamAuditProgress | None

Live progress reported by the runner. None unless the audit is running or uploading, and until the runner sends its first progress report.

input_evaluation_ids list[str]

Evaluations used as leads for the attacker agents.

output_dataset_id str | None

Audit dataset, with every conversation that the attacker agents had with your agent as a reusable scenario.

output_dataset_name str | None

Name of the output dataset.

output_evaluation_id str | None

Evaluation with the results that support the findings.

output_evaluation_name str | None

Name of the output evaluation.

trust_level str | None

AI Trust level of the agent, one of "low", "insufficient", "satisfactory", or "high".

trust_level_grade str | None

Letter grade of the AI Trust level, from "A" (high) to "D" (low). Set when the audit content is available.

has_audit_content bool

Whether the audit content (trust level, assessment, findings, and remediations) is available through .retrieve_content(). The findings list can be empty.

has_pdf bool

Whether a PDF report is available.

has_intermediate_archive bool

Whether an intermediate archive of the run is available.

evaluation_upload_status "not_started" | "uploaded" | "skipped" | "error"

Status of the upload of the output evaluation. "skipped" means that the audit has no findings or was imported with .upload().

evaluation_upload_error str | None

Error message if the upload of the output evaluation failed.

evaluation_uploaded_count int

Number of results uploaded to the output evaluation.

error str | None

Reason why the audit stopped before it finished, such as a runner failure or a timeout.

runner str | None

Runner provider that executes the audit, such as "kubernetes" or "compose".

logs_truncated bool

Whether the logs reached the size limit. Later log output is not stored.

started_at datetime | None

When the audit started.

run_deadline datetime | None

End of the run time, equal to started_at plus the maximum run duration. After this time, the audit moves to uploading and the runner has a grace period to upload its results.

finished_at datetime | None

When the audit reached a final status (finished, error, canceled, or timed_out).

last_heartbeat_at datetime | None

Last heartbeat received from the runner.

last_log_at datetime | None

Time of the last log chunk.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

"queued" Waiting to start.
"running" In progress.
"uploading"

The run passed its deadline. The runner has a grace period to upload its results.

"finished" Completed.
"error" Failed.
"canceled" Canceled before completion.
"timed_out"

Stopped because the runner timed out, stopped sending heartbeats, or did not finish before the end of the upload grace period.

phase "reconnaissance" | "risk_model" | "attacks" | "report"

Current phase of the audit.

wave int | None

Number of the current wave, starting at 1. None during the reconnaissance phase.

waves int | None

Total number of waves of the audit. None during the reconnaissance phase.

attackers_total int | None

Number of attacker agents planned for the current wave. Set only in the attacks phase.

attackers_done int | None

Number of attacker agents of the current wave that have finished. Set only in the attacks phase.

attackers_running int | None

Number of attacker agents of the current wave that are running. Set only in the attacks phase.

findings int | None

Number of findings accepted so far, across all waves.

chunks list[RedTeamAuditLogChunk]

Log chunks of this page.

next_cursor int

Value to pass as after to get the next page.

Current status of the audit.

logs_truncated bool

Whether the logs reached the size limit. Later log output is not stored.

sequence int

Sequence number of the chunk.

timestamp datetime

When the chunk was written.

stream "stdout" | "stderr" | "system"

Output stream of the chunk.

text str

Log text.

trust_level str

AI Trust level of the agent, one of "low", "insufficient", "satisfactory", or "high".

trust_level_grade str

Letter grade of the AI Trust level, from "A" (high) to "D" (low).

overall_assessment RedTeamAuditOverallAssessment

Overall assessment of the agent.

findings list[RedTeamAuditFinding]

Identified issues.

remediations list[RedTeamAuditRemediation]

Recommended fixes.

conclusion str | None

Conclusion of the report.

coverage RedTeamAuditCoverage | None

Risk scenarios covered by the audit.

risk_model RedTeamAuditRiskModel | None

Risk model built for the agent’s use case, with its missions, assets, feared events, risk origins, and scenarios.

attack_counts dict[str, int]

Number of attack conversations in the output dataset for each risk scenario ID. Risk scenarios without attacks are not in the dictionary. Empty when risk_model is None.

report dict[str, Any]

Report metadata, with the title, subtitle, target_name, client, date, version, and authors keys.

generated_at datetime | None

When the report was generated.

headline str

One-line summary.

body str

Full assessment text.

external_id str

Finding identifier in the report.

position int

Position of the finding in the report.

title str

Finding title.

display_title str | None

Short title for the PDF report and the Hub UI. When it is None, the Hub UI shows title.

severity str | None

Severity of the finding, one of "low", "medium", "high", or "critical".

impact str | None

Impact of the finding, one of "low", "medium", "high", or "critical".

impact_rationale str

Why the impact has this level.

likelihood str | None

Likelihood of the finding, one of "low", "medium", "high", or "critical".

likelihood_rationale str

Why the likelihood has this level.

technical_description str

Technical description of the issue.

report_description str

Description of the issue in the report.

reproduction_steps str

Steps to reproduce the issue.

Conversations that support the finding.

associated_scenarios list[str]

Risk scenarios related to the finding.

taxonomy_codes list[str]

Taxonomy codes of the finding, such as OWASP categories.

remediation_ids list[str]

Remediations that address the finding.

source_report_id str | None

ID of the attacker report that the judge accepted as this finding, such as "RPT-0001".

risk_model_wave str | None

Risk model wave that the finding belongs to.

thread_id str

ID of the attack conversation that supports the finding.

reason str

Why the conversation supports the finding.

highlighted bool

Whether the report highlights this evidence.

result_url str | None

Link to the evaluation result in the Hub.

excerpt_sequences list[int]

Sequence numbers of the conversation turns that the PDF report shows as an excerpt. Empty when highlighted is False.

external_id str

Remediation identifier in the report.

position int

Position of the remediation in the report.

recommendation str

Recommended fix.

priority str | None

Priority of the fix, one of "low", "medium", or "high".

finding_ids list[str]

Findings that the remediation addresses.

mode "regular" | "light"

Audit effort.

scenarios_total int

Number of risk scenarios in the risk model.

covered_scenario_ids list[str]

Risk scenarios that the audit tested.

uncovered_scenario_ids list[str]

Risk scenarios that the audit did not test.

id str

Unique identifier.

name str

Display name.

description str | None

Human-readable description.

filename str | None

Original upload filename.

project_id str

Parent project ID.

n_documents int

Number of indexed documents.

topics list[Topic]

Discovered topics.

status TaskProgress

Async indexing status.

state TaskState

Computed from status.state.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

name str

Display name.

id str

Unique identifier.

name str

Topic name.

knowledge_base_id str

Parent knowledge base ID.

document_count int | None

Number of documents in this topic.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

knowledge_base_id str

Parent knowledge base ID.

snippet str

Truncated content snippet.

content str

Computed alias of snippet (the truncated content shown in search results).

topic_id str | None

Topic ID, if classified.

topic_name str | None

Topic display name.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

knowledge_base_id str

Parent knowledge base ID.

content str

Full document content.

topic_id str | None

Topic ID, if classified.

topic_name str | None

Topic display name.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id "created_at" | "updated_at" | "topic_id" Required

Column to sort by.

desc bool

Sort descending when true.

alias dict

Dict mapping a column name to a filter value. Valid columns: "topic_id".

id str

Unique identifier.

name str

Display name.

description str

Human-readable description.

failure_categories list[FailureCategory]

Project-level failure classifications.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

name str

Prompt preset name.

description str | None

Prompt preset description.

rules list[str]

Rules the generated conversations should follow.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

inputs list[dict[str, Any]]

Preview samples. Each item holds the generated input and the agent output.

generated_rules list[str] | None

Rules inferred from the prompt preset description.

"daily" Run every day.
"weekly" Run on a specific day each week.
"monthly" Run on a specific day each month.
alias union

TypeAlias for SuccessExecutionStatus | ErrorExecutionStatus | None.

alias union

TypeAlias for SuccessExecutionStatusParam | ErrorExecutionStatusParam.

evaluation_id str

ID of the evaluation produced by the execution.

status "success"

Always "success".

evaluation_id str Required

ID of the evaluation produced by the execution.

status "success"

Always "success".

error_message str

Description of what went wrong.

status "error"

Always "error".

error_message str Required

Description of what went wrong.

status "error"

Always "error".

id str

Unique identifier.

name str

Display name.

project_id str

Parent project ID.

agent_id str | None

Agent to evaluate.

agent AgentReference | None

Reference to the agent to evaluate.

dataset_id str

Dataset to evaluate against.

dataset DatasetReference | None

Reference to the dataset to evaluate against.

frequency FrequencyOption

"daily", "weekly", or "monthly".

time str

Time of day in HH:MM format (UTC).

day_of_week int | None

Weekly only: 1 (Monday) through 7 (Sunday).

day_of_month int | None

Monthly only: 1 through 28.

tags list[str]

Tags used to filter scenarios.

run_count int

Number of times each scenario is run per execution.

paused bool

Whether the schedule is currently paused.

last_execution_at datetime | None

Timestamp of the most recent execution.

last_execution_status LastExecutionStatus | None

Status of the most recent execution.

evaluations list[EvaluationReference]

Evaluation runs produced by this schedule. Full Evaluation objects when you pass include=["evaluations"]. With last_days, .list() keeps only the runs of the last N days.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

description str

Task description.

status TaskStatus

Current status.

priority TaskPriority | None

Priority level.

project_id str

Parent project ID.

created_by User

User who created the task.

assignees list[User]

Assigned users.

Linked resources (evaluation results, scenarios, or probe attempts). A reference of an unknown type is parsed as UnknownTaskReference.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

"open" Newly created, not yet picked up.
"in_progress" Being worked on.
"resolved" Closed.
"low" Low priority.
"medium" Medium priority.
"high" High priority.
id str

Unique identifier.

type str

Reference type returned by the Hub that the SDK does not recognize.

id str

Unique identifier.

project_id str

Parent project ID.

user UserReference | None

The user who started the chat.

user_id str | None

ID of the user who started the chat.

agent_id str | None

ID of the agent that responded.

agent AgentReference | Agent | None

The agent that responded.

exchanges list[PlaygroundExchange]

Ordered exchanges.

created_at datetime

Creation timestamp.

updated_at datetime

Last update timestamp.

input dict[str, Any]

Structured input sent to the agent.

output dict[str, Any]

Structured output returned by the agent.

metadata dict[str, Any] | None

Arbitrary metadata attached to the exchange.

id str

Unique identifier.

action "insert" | "update" | "delete"

Action performed on the entity.

entity_id str

UUID of the affected entity.

entity_type str

Type of the affected entity (e.g. "agent", "evaluation").

user_id str

User who performed the action.

project_id str | None

Project the entity belongs to, if applicable.

user_name str | None

Display name of the user who performed the action.

data dict[str, object]

Snapshot of the entity data captured with the event. With compact=True in .search(), only the name, evaluation_id, and dataset_id keys are kept.

triggered_by_entity_type str | None

Type of the entity that triggered this change, if cascaded.

triggered_by_entity_id str | None

ID of the entity that triggered this change, if cascaded.

created_at datetime

When the action occurred.

updated_at datetime

Last update timestamp.

id str

Unique identifier.

action "insert" | "update" | "delete"

Action performed.

user_id str

User who performed the action.

user_name str | None

User display name.

diffs list[AuditDisplayDiffItem]

Pre-formatted diff items for display.

real_change_count int

Number of fields that actually changed.

summary_fields list[str]

Field names highlighted in the summary.

created_at datetime

When the action occurred.

kind "added" | "removed" | "changed" | "skip"

Kind of change for display.

scope str

"scalar" for a single value or "array" for a list field.

root str

Root field name.

label str | None

Display label for the changed field.

before_str str | None

Pre-formatted previous value.

after_str str | None

Pre-formatted new value.

skip_count int | None

Number of skipped items if kind="skip".

id "action" | "created_at" | "entity_type" | "project_id" | "user_id" Required

Column to sort by.

desc bool

Sort descending when true.

alias dict

Dict mapping a column name to a filter value. Valid columns: "action", "created_at", "entity_type", "project_id", "user_id".

operation "evaluation" | "generation" | "scan" | "audit" | "audit_light" | "playground"

Priced action. A Full audit uses "audit" and a Light audit uses "audit_light".

item_count int | None

Number of metered items, such as scenarios. None for audits.

estimated_amount int

Estimated cost in credits.

available_balance int

Current credit balance of the Hub. The project_id and user_id filters do not apply to this value.

reserved_amount int

Estimated credits reserved by work that is reserved, queued, or running.

settled_consumption int

Actual credits charged for settled work.

debits int

Total of debit ledger entries, as a positive number.

refunds int

Total of refund ledger entries.

net_movement int

Net sum of all credit ledger entries, including initial credits, top-ups, debits, refunds, and corrections.


All exceptions inherit from HubClientError and are importable from the root package.

from giskard_hub import (
HubClientError, # Base exception for all SDK errors
APIError, # Base for request errors (has .message, .request, .body)
APIStatusError, # Base for HTTP status errors (has .status_code, .response)
APIConnectionError, # Could not connect to the Hub
APITimeoutError, # Request timed out (subclass of APIConnectionError)
APIResponseValidationError, # Response does not match the expected schema
BadRequestError, # 400
AuthenticationError, # 401, invalid API key
PermissionDeniedError, # 403, insufficient permissions
NotFoundError, # 404, resource does not exist
ConflictError, # 409, resource conflict
UnprocessableEntityError, # 422, validation error
RateLimitError, # 429, too many requests
InternalServerError, # 500+, server error
)

A missing API key raises HubClientError when you create the client. Other status codes raise APIStatusError.

Error handling example
from giskard_hub import HubClient, NotFoundError, AuthenticationError
hub = HubClient()
try:
agent = hub.agents.retrieve("00000000-0000-0000-0000-000000000000")
except NotFoundError as e:
print(f"Agent not found: {e}")
except AuthenticationError:
print("Check your API key")

Methods that support pagination accept limit and offset. Pass include_metadata=True to get an APIPaginatedMetadata object:

Pagination example
results, metadata = hub.evaluations.results.search(
"evaluation-id", limit=50, offset=0, include_metadata=True,
)
print(f"Page: {metadata.count} of {metadata.total} (offset {metadata.offset})")
Access HTTP headers and status
response = hub.with_raw_response.agents.retrieve("agent-id")
print(response.status_code)
agent = response.parse().data

.parse() returns the Hub response envelope. Read .data to get the resource.

Per-request override
hub.with_options(max_retries=5, timeout=300.0).evaluations.create(...)
Proxy configuration
from giskard_hub import HubClient, DefaultHttpxClient
hub = HubClient(
http_client=DefaultHttpxClient(proxy="http://proxy.example.com:8080"),
)
Enable debug logging
export GISKARD_HUB_LOG=debug

Every API method accepts these optional keyword arguments for per-request customization. The hub.helpers methods do not accept them.

extra_headers dict[str, str] | None

Additional HTTP headers for this request.

extra_query dict[str, object] | None

Additional query parameters.

extra_body object | None

Additional JSON body fields.

timeout float | httpx.Timeout | None

Override the default timeout for this request.