Evaluation inherit from VijilModel, while generated API models such as RedteamStatusResponse inherit directly from BaseModel. SDK exceptions inherit from VijilError.
Hand-curated models inherit from VijilModel, which ignores unknown response fields. Models generated from the Console schemas inherit directly from Pydantic’s BaseModel. When vijil.models exports a model, import it there. Treat vijil._generated as internal implementation detail.
Pagination
Page[T]
Generic paginated response returned by resource collection methods such as list() and client.evaluations.responses().
Page[T] normalizes the Console’s items or results collections and its total or count fields. Some methods intentionally return a plain list, such as client.rca_runs.list().
Core Models
Evaluation
Returned by client.evaluate() for behavioral evaluations. Trust Scores and Harness fields do not apply to Red Team evaluations.
completed, succeeded, saved, failed, and cancelled as terminal statuses.
EvaluationResponse
Returned in the page.items list from client.evaluations.responses(). Each model represents one prompt and Agent response from a completed behavioral evaluation.
probe_score and status describe the parent Probe and repeat on each of its prompt rows. detector_results contains the raw per-Detector results for that prompt. This model does not apply to Red Team evaluations.
RedteamStatusResponse
Returned by client.evaluate(..., type="redteam") and client.evaluations.redteam_status(evaluation_id). This is a Red Team progress snapshot, not a Trust Score.
A Red Team run can report
created, starting, or running before it reaches a terminal status: succeeded, failed, cancelled, or degraded. A degraded run has finished with some attackers lost, so inspect its error and wave details before relying on the report. Red Team does not use the behavioral completed or saved statuses.
Dimensions
dimensions from the Console’s pillar score fields or its scores dictionary.
EvaluationResponse
client.evaluations.responses() returns a Page[EvaluationResponse] containing individual behavioral Evaluation records.
Agent
The Console schema uses agent_name and agent_url as the public field names.
client.agents resource removes API key values from Console responses before returning an Agent.
Job
Job record even when its status is failed or cancelled. Inspect job.status and job.error after polling.
TrustScore
score.summarize(results=results, scale=100) to flatten full Evaluation results into summary, Harness, Scenario, and Probe rows. Get results with client.scores.results().
DomeConfig
Harness and Report
For a custom Harness,
show() and create(wait=True) populate workflow with the generation status when available.
Report.created_at can be a Unix timestamp or an ISO-formatted string.
Other Models
MonitorSummary and Detection models exist for forward compatibility, but their corresponding resource read methods currently raise NotImplementedError. See SDK Resources for supported telemetry operations.
Errors
Import SDK exceptions fromvijil.exceptions:
VijilError. The hierarchy supports two ways to classify a failure:
Source-Attributed Errors
Each concrete exception exposes asource and a remediation hint.
Catch
ConsoleRejected to handle every Console rejection together, or catch one of its status-specific subclasses.
HTTP Status Errors
Other non-success statuses, such as
409, raise ConsoleRejected directly.
Configuration and Job Errors
Error-Handling Pattern
Catch the narrowest actionable exception before its parent class.Automatic Retries
The HTTP client makes at most three total attempts for a request:- For transport failures and
5xxresponses, it waits one second before the second attempt and two seconds before the third. - For
429responses, it uses a numericRetry-Aftervalue. If the header is missing or invalid, it waits one second. - For a
401response, it performs one refresh-and-retry when the credentials support token refresh.
NetworkError, VijilRateLimitError, or VijilServerError, depending on the last failure. Individual operations can disable retries when repeating the request would be unsafe. Multipart uploads do not retry automatically.