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()from giskard_hub import AsyncHubClientimport asyncio
async def main(): async with AsyncHubClient() as hub: projects = await hub.projects.list()
asyncio.run(main())HubClient
Section titled âHubClientâSynchronous client. All resource operations are available as attributes.
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.
AsyncHubClient
Section titled âAsyncHubClientâ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.
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.
Resources
Section titled âResourcesâResource groups exposed by the client for managing Hub entities.
hub.agents
Section titled âhub.agentsâ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() → Agent 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.
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() → Agent Retrieve an agent by its ID.
agent_id str Required ID of the agent to retrieve.
.update() → Agent 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 url str | None description str | None headers dict[str, str] | None supported_languages list[str] | None input_schema dict[str, Any] | None output_schema dict[str, Any] | None auto_bindings list[ForwardBindingParam | AggregateBindingParam] | None .list() → list[Agent] List all agents, optionally filtered by project.
project_id str | None .delete() → None Delete an agent by its ID.
agent_id str Required .bulk_delete() → None Delete multiple agents at once.
agent_ids list[str] Required .generate_completion() → GenerateCompletionOutput 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.
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_connection() → dict[str, Any] Test connectivity to an agent endpoint without persisting the agent. Returns the raw response of the connection test.
url str Required project_id str Required headers dict[str, str] | list[HeaderParam] {name: value} dict or a list of HeaderParam. agent_id str | None 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 .generate_description() → str Auto-generate a description for an agent by observing its behaviour. Returns the generated description.
agent_id str Required hub.checks
Section titled âhub.checksâ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() → Check 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.
params CheckTypeParam 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.
check = hub.checks.create( project_id=project.id, identifier="custom_tone_professional", name="Professional tone", params={"type": "hub_conformity", "rule": "Use formal language."},).retrieve() → Check check_id str Required ID of the check to retrieve.
.update() → Check Update an existing check. Only the provided fields are modified.
check_id str Required identifier str | None custom_. name str | None params CheckTypeParam | None spec dict[str, object] | None kind. You cannot use it together with params. description str | None .list() → list[Check] 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.
.delete() → None check_id str Required ID of the check to delete.
.bulk_delete() → None check_ids list[str] Required IDs of checks to delete.
Check type params
Section titled âCheck type paramsâ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.
hub.datasets
Section titled âhub.datasetsâ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() → Dataset Create a new empty dataset in the specified project.
name str Required project_id str Required description str | None input_schema dict[str, Any] | None output_schema dict[str, Any] | None .upload() → Dataset Import scenarios from a file or list of dicts into a dataset.
project_id str Required 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 name str | None dataset_id is omitted. .generate_preset_based() → Dataset 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 agent_id str Required prompt_preset_id str Required n_examples int dataset_id str | None dataset_name str | None dataset_id is omitted. .generate_document_based() → Dataset Generate scenarios grounded in knowledge base documents. Async â use hub.helpers.wait_for_completion().
agent_id str Required knowledge_base_id str Required project_id str Required dataset_name str description str | None n_examples int topic_ids list[str] target_path str | None .estimate_preset_based() → CreditEstimate Estimate the credit cost of a preset-based dataset generation.
num_examples int Required .estimate_document_based() → CreditEstimate Estimate the credit cost of a document-based dataset generation.
n_examples int Required .retrieve() → Dataset dataset_id str Required ID of the dataset to retrieve.
.update() → Dataset 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.
.list() → list[Dataset] project_id str | None Project ID to filter by.
.delete() → None Delete a dataset by its ID.
dataset_id str Required .bulk_delete() → None Delete multiple datasets at once.
dataset_ids list[str] Required .list_tags() → list[str] List all tags used across scenarios in a dataset.
dataset_id str Required .list_scenarios() → list[Scenario] List all scenarios in a dataset.
dataset_id str Required .search_scenarios() → list[Scenario] | tuple[list[Scenario], APIPaginatedMetadata] Search scenarios with filters, sorting, and pagination. Pass include_metadata=True to receive tuple[list[Scenario], APIPaginatedMetadata].
dataset_id str Required query str | None order_by list[ScenarioOrderByParam] | None filters ScenarioFiltersParam | None limit int | None offset int | None include_metadata bool Default: False hub.evaluations
Section titled âhub.evaluationsâ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() → Evaluation 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.
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_local() → Evaluation Create a local evaluation for running agent inference in your own process.
Agent info as {"name": str, "description": str | None}. Only name is required.
dataset_id str Required name str | None tags list[str] | None .upload() → Evaluation Upload a giskard.checks SuiteResult (from Giskard OSS) as a local Hub evaluation.
project_id str Required payload dict[str, Any] Required SuiteResult.to_hub_format(). agent_id str | None name str | None auto_classify_failures bool | None .run_single() → list[CheckResult] Evaluate a single (input, output) pair against checks without creating a full evaluation.
project_id str Required input_data dict[str, Any] Required {"messages": [...]}). identifier or a check_id. Checks with enabled=False are skipped. metadata dict[str, Any] agent_description str DeprecationWarning. .rerun_errored_results() → Evaluation Rerun all errored results without triggering a full re-evaluation.
evaluation_id str Required .estimate() → CreditEstimate Estimate the credit cost of an evaluation before you create it.
project_id str Required dataset_id str | None old_evaluation_id, not both. old_evaluation_id str | None tags list[str] | None dataset_id. run_count int .estimate_run_interaction_checks() → CreditEstimate Estimate the credit cost of running checks with .run_single().
project_id str Required checks argument of .run_single(). agent_id str | None .estimate_rerun_errored_results() → CreditEstimate Estimate the credit cost of .rerun_errored_results().
evaluation_id str Required .retrieve() → Evaluation Retrieve an evaluation by its ID.
evaluation_id str Required .update() → Evaluation Update an evaluationâs name.
evaluation_id str Required name str Required .list() → list[Evaluation] List all evaluations for a project.
project_id str Required .delete() → None Delete an evaluation by its ID.
evaluation_id str Required .bulk_delete() → None Delete multiple evaluations at once.
evaluation_ids list[str] Required hub.evaluations.results
Section titled âhub.evaluations.resultsâInspect, filter, update, and rerun individual evaluation results.
from giskard_hub.types import CreditEstimate, FailureCategory, ScenarioEvaluation.retrieve() → ScenarioEvaluation result_id str Required Result ID.
evaluation_id str Required Evaluation ID.
include list[Literal["scenario"]] | None Embed related resources.
.update() → ScenarioEvaluation Update the failure category of an evaluation result.
result_id str Required evaluation_id str Required failure_category FailureCategoryParam | None .list() → list[ScenarioEvaluation] evaluation_id str Required Evaluation ID.
include list[Literal["scenario"]] | None Embed related resources.
.search() → list[ScenarioEvaluation] | tuple[list[ScenarioEvaluation], APIPaginatedMetadata] Search and filter results. Pass include_metadata=True for pagination metadata.
evaluation_id str Required query str | None filters ResultFiltersParam | None order_by list[ResultOrderByParam] | None limit int | None offset int | None include list[Literal["scenario"]] | None include_metadata bool Default: False .rerun_scenario() → ScenarioEvaluation Rerun a single result.
result_id str Required Result ID.
evaluation_id str Required Evaluation ID.
.estimate_rerun_scenario() → CreditEstimate 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_local_output() → ScenarioEvaluation Submit locally-generated agent output for evaluation and scoring.
result_id str Required evaluation_id str Required agent_output AgentOutputParam | None error str | None .update_visibility() → ScenarioEvaluation Show or hide a result from the default view.
result_id str Required evaluation_id str Required hidden bool Required set_scenario_draft bool | None hub.helpers
Section titled âhub.helpersâ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.wait_for_completion() → TStateful 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.
.evaluate() → Evaluation Run an evaluation for a given agent over a dataset. Handles both remote and local agents.
Agent ID, Agent object, or a Python callable for local evaluation. Callable signature: (messages: list[ChatMessage]) -> str | ChatMessage | AgentOutput.
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 tags list[str] | None evaluation = hub.helpers.evaluate( agent=my_agent, dataset=my_dataset, project=my_project, name="Remote eval",)def my_fn(messages: list[ChatMessage]) -> str: return "Hello from my local agent"
evaluation = hub.helpers.evaluate(agent=my_fn, dataset="dataset-id", name="Local eval",).print_metrics() → None Print a formatted metrics table to the console for an evaluation or scan.
The evaluation or scan to print metrics for.
hub.knowledge_bases
Section titled âhub.knowledge_basesâ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() → KnowledgeBase 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.
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() → list[KnowledgeBaseDocumentRow] | tuple[list[KnowledgeBaseDocumentRow], APIPaginatedMetadata] Search documents in a knowledge base with filters, sorting, and pagination.
knowledge_base_id str Required query str | None filters KnowledgeBaseDocumentFiltersParam | None order_by list[KnowledgeBaseDocumentOrderByParam] | None limit int | None offset int | None include_metadata bool Default: False .retrieve_document() → KnowledgeBaseDocumentDetail Retrieve a specific document with its full content.
knowledge_base_id str Required document_id str Required .retrieve() → KnowledgeBase Retrieve a knowledge base by its ID, including its topics.
knowledge_base_id str Required .update() → KnowledgeBase Update a knowledge baseâs metadata.
knowledge_base_id str Required name str | None description str | None project_id str | None status TaskProgress | None .list() → list[KnowledgeBase] List all knowledge bases, optionally filtered by project.
project_id str | None .delete() → None Delete a knowledge base by its ID.
knowledge_base_id str Required .bulk_delete() → None Delete multiple knowledge bases at once.
knowledge_base_ids list[str] Required hub.projects
Section titled âhub.projectsâ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.create() → Project name str Required Project name.
description str | None Project description.
.update() → Project 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() → Project Retrieve a project by its ID.
project_id str Required .list() → list[Project] List all projects accessible to the current user.
.delete() → None Delete a project by its ID.
project_id str Required .bulk_delete() → None Delete multiple projects at once.
project_ids list[str] Required hub.projects.prompt_presets
Section titled âhub.projects.prompt_presetsâReusable persona and behaviour templates for preset-based dataset generation.
from giskard_hub.types import PromptPreset, PromptPresetPreview.create() → PromptPreset 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.
.preview() → PromptPresetPreview Generate a preview conversation for a prompt preset without persisting it.
project_id str Required description str Required agent_id str Required rules list[str] .retrieve() → PromptPreset Retrieve a prompt preset by its ID within a project.
prompt_preset_id str Required project_id str Required .update() → PromptPreset Update an existing prompt presetâs definition.
prompt_preset_id str Required project_id str Required name str | None description str | None rules list[str] | None .list() → list[PromptPreset] List all prompt presets for a project.
project_id str Required .delete() → None Delete a prompt preset from a project.
prompt_preset_id str Required project_id str Required hub.scans
Section titled âhub.scansâ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,).create() → Scan 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'"]).
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() → CreditEstimate Estimate the credit cost of a scan before you create it.
knowledge_base_id str | None probe_ids list[str] | None tags list[str] | None .list_categories() → list[ScanCategory] List all available scan categories and their OWASP mappings.
.list_available_probes() → list[ScanAvailableProbe] List every probe that you can use in a scan. Use the IDs with
.create(probe_ids=[...]).
.list_probes() → list[ScanProbe] List all probe results for a scan.
scan_id str Required .retrieve() → Scan Retrieve a scan result by its ID, with optional related resource inclusion.
scan_id str Required include list[Literal["agent", "knowledge_base"]] | None .list() → list[Scan] List all scan results, optionally filtered by project.
project_id str | None include list[Literal["agent", "knowledge_base"]] | None .delete() → None Delete a scan result by its ID.
scan_id str Required .bulk_delete() → None Delete multiple scan results at once.
scan_ids list[str] Required hub.scans.probes
Section titled âhub.scans.probesâ.retrieve() → ScanProbe probe_id str Required Probe ID.
.list_attempts() → list[ScanProbeAttempt] List all adversarial attempts for a specific probe.
probe_id str Required hub.scans.attempts
Section titled âhub.scans.attemptsâ.update() → ScanProbeAttempt Update a probe attemptâs review status, severity, or success flag.
probe_attempt_id str Required review_status ReviewStatus | None "pending", "ignored", "acknowledged", "corrected". severity Severity | None SAFE (0), MINOR (10), MAJOR (20), CRITICAL (30). successful bool | None hub.red_team_audits
Section titled âhub.red_team_auditsâLaunch Autonomous Agent Audits, follow their progress, and read their findings.
from giskard_hub.types import ( CreditEstimate, RedTeamAudit, RedTeamAuditContent, RedTeamAuditLogs,).create() → RedTeamAudit 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.
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).upload() → RedTeamAudit Import the results of an audit that ran outside the Hub.
project_id str Required target_agent_id str Required content FileTypes Required name str | None report FileTypes risk_model FileTypes .retrieve() → RedTeamAudit Retrieve an audit by its ID. Read status and progress to follow a running audit.
audit_id str Required .retrieve_content() → RedTeamAuditContent 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 .retrieve_logs() → RedTeamAuditLogs Retrieve a page of the execution logs of an audit.
audit_id str Required after int next_cursor of the previous page. Defaults to 0 on the server. limit int 500 on the server. .list() → list[RedTeamAudit] List audits, optionally filtered by project.
project_id str | None .delete() → None Delete an audit by its ID. A running audit is canceled first.
audit_id str Required .estimate() → CreditEstimate Estimate the credit cost of an audit before you launch it.
mode "regular" | "light" "regular" on the server. hub.scheduled_evaluations
Section titled âhub.scheduled_evaluationsâSet up recurring evaluation runs on a daily, weekly, or monthly cadence for continuous quality monitoring.
from giskard_hub.types import ScheduledEvaluation, FrequencyOption.create() → ScheduledEvaluation project_id str Required Project ID.
agent_id str Required Agent to evaluate.
dataset_id str Required Dataset to evaluate against.
"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_evaluations() → list[Evaluation] List all past evaluation runs generated by this scheduled evaluation.
scheduled_evaluation_id str Required include list[Literal["agent", "dataset"]] | None .retrieve() → ScheduledEvaluation Retrieve a scheduled evaluation by its ID.
scheduled_evaluation_id str Required include list[Literal["evaluations"]] | None evaluations references with full Evaluation objects. .update() → ScheduledEvaluation Update a scheduled evaluationâs configuration.
scheduled_evaluation_id str Required name str | None frequency FrequencyOption | None time str | None day_of_week int | None day_of_month int | None run_count int | None paused bool | None .list() → list[ScheduledEvaluation] List all scheduled evaluations for a project.
project_id str Required include list[Literal["evaluations"]] | None evaluations references with full Evaluation objects. last_days int | None evaluations list. The method still returns all schedules. .delete() → None Delete a scheduled evaluation by its ID.
scheduled_evaluation_id str Required .bulk_delete() → None Delete multiple scheduled evaluations at once.
scheduled_evaluation_ids list[str] Required hub.tasks
Section titled âhub.tasksâ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() → Task 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() → Task Retrieve a task by its ID.
task_id str Required .update() → Task Update an existing taskâs metadata and assignees.
task_id str Required status TaskStatus | None "open", "in_progress", or "resolved". priority TaskPriority | None "low", "medium", or "high". description str | None assignee_ids list[str] | None set_scenario_status str | None "active" or "draft". .list() → list[Task] List all tasks for a project, ordered by creation date descending.
project_id str Required .delete() → None Delete a task by its ID.
task_id str Required .bulk_delete() → None Delete multiple tasks at once.
task_ids list[str] Required hub.scenarios
Section titled âhub.scenariosâCreate, update, and manage individual scenarios within datasets. Sub-resource: hub.scenarios.comments.
from giskard_hub.types import Scenario, ScenarioComment, Interaction.create() → Scenario Create a new scenario from a list of interactions.
dataset_id str Required Interactions as [{"input": {...}, "output": {...}, "checks": [...]}]. For chat agents, input is {"messages": [{"role", "content"}]}.
status "active" | "draft" | None tags list[str] source_probe_attempt_id str | None .retrieve() → Scenario Retrieve a scenario by its ID.
scenario_id str Required .update() → Scenario Update an existing scenarioâs interactions, tags, or status.
scenario_id str Required interactions Iterable[InteractionParam] | None status "active" | "draft" | None tags list[str] | None dataset_id str | None .delete() → None Delete a scenario by its ID.
scenario_id str Required .bulk_delete() → None scenario_ids list[str] Required IDs of scenarios to delete.
.bulk_update() → list[Scenario] Update multiple scenarios at once. All scenarios must belong to the same dataset. Returns the updated scenarios.
scenario_ids list[str] Required status Literal["active", "draft"] | None "active" applies only to scenarios that have at least one enabled check. disabled_checks list[str] | None enabled_checks list[str] | None added_tags list[str] | None removed_tags list[str] | None .bulk_move() → None Copy or move scenarios to another dataset. By default, the scenarios are copied.
scenario_ids list[str] Required target_dataset_id str Required duplicate bool Default: True True, copy the scenarios and keep the originals. Pass False to move them. hub.scenarios.comments
Section titled âhub.scenarios.commentsâ.add() → ScenarioComment scenario_id str Required Scenario ID.
content str Required Comment text.
.edit() → ScenarioComment comment_id str Required Comment ID.
scenario_id str Required Scenario ID.
content str Required Updated text.
.delete() → None comment_id str Required Comment ID.
scenario_id str Required Scenario ID.
hub.playground_chats
Section titled âhub.playground_chatsâAccess conversations captured from the Hub's interactive playground UI.
from giskard_hub.types import PlaygroundChat.list() → list[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.
.retrieve() → PlaygroundChat chat_id str Required Chat ID.
include list[Literal["agent"]] | None Embed related resources (["agent"]).
.delete() → None Delete a playground chat by its ID.
chat_id str Required .bulk_delete() → None Delete multiple playground chats at once.
chat_ids list[str] Required hub.audit_logs
Section titled âhub.audit_logsâ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() → list[Audit] | tuple[list[Audit], APIPaginatedMetadata] 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_entities() → list[AuditDisplay] | tuple[list[AuditDisplay], APIPaginatedMetadata] List audit history for a specific resource, including diffs of each change. Pass include_metadata=True for pagination metadata.
entity_id str Required entity_type str Required "project", "agent", "evaluation"). limit int offset int include_metadata bool Default: False hub.usage
Section titled âhub.usageâ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_credits() → 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.
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.
Core types
Section titled âCore typesâ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.
Agent types
Section titled âAgent typesâ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.
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.
Check types
Section titled âCheck typesâ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.
Dataset and scenario types
Section titled âDataset and scenario typesâ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.
user UserReference 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".
Evaluation types
Section titled âEvaluation typesâid str Unique identifier.
name str Display name.
agent AgentInterface | Agent The evaluated agent. By default this is an AgentInterface with id,
name, input_schema, and output_schema.
dataset Dataset | DatasetReference 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.
scenario Scenario | ScenarioReference 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".
Scan types
Section titled âScan typesâid str Unique identifier.
agent AgentInterface | Agent 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.
Red team audit types
Section titled âRed team audit typesâ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.
status RedTeamAuditStatus 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.
state RedTeamAuditStatus 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.
evidence list[RedTeamAuditFindingEvidence] 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.
Knowledge base types
Section titled âKnowledge base typesâ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".
Project and prompt preset types
Section titled âProject and prompt preset typesâ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.
Scheduled evaluation types
Section titled âScheduled evaluation typesâ"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.
Task types
Section titled âTask typesâ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.
references list[ScenarioEvaluationReference | ScanProbeAttemptReference | ScenarioReference | UnknownTaskReference] 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.
Playground chat types
Section titled âPlayground chat typesâ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.
Audit types
Section titled âAudit typesâ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".
Credit types
Section titled âCredit typesâ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.
Error types
Section titled âError typesâ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.
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")Advanced patterns
Section titled âAdvanced patternsâPagination
Section titled âPaginationâMethods that support pagination accept limit and offset. Pass include_metadata=True to get an APIPaginatedMetadata object:
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})")Raw response access
Section titled âRaw response accessâ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.
Retries and timeouts
Section titled âRetries and timeoutsâhub.with_options(max_retries=5, timeout=300.0).evaluations.create(...)Custom HTTP client
Section titled âCustom HTTP clientâfrom giskard_hub import HubClient, DefaultHttpxClient
hub = HubClient( http_client=DefaultHttpxClient(proxy="http://proxy.example.com:8080"),)Debug logging
Section titled âDebug loggingâexport GISKARD_HUB_LOG=debugCommon extra parameters
Section titled âCommon extra parametersâ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.