inspect_ai.viewer

Customize Inspect view behavior.

Viewer

ViewerConfig

Top-level viewer configuration.

scanner_result_view keys are fnmatch-style glob patterns ("*", "audit_*", exact names). Pass a ScannerResultView to apply a single configuration to every scanner.

class ViewerConfig(BaseModel)

Attributes

scanner_result_view ScannerResultView | dict[str, ScannerResultView]

Glob-keyed map from scanner name pattern to its sidebar config. May also be a bare ScannerResultView.

Scanner Results

ScannerResultView

How the scann results should render the results.

class ScannerResultView(BaseModel)

Attributes

fields list[ScannerResultField | MetadataField | str] | None

Ordered list of sections to render. List order is render order; None means fall back to the built-in default order.

exclude_fields list[ScannerResultField | MetadataField | str]

Fields to suppress. For a ScannerResultField entry, the matching section is removed from the resolved fields list (useful to subtract from the default order). For a MetadataField entry, the key is additionally removed from the generic metadata section’s dump.

Fields

MetadataField

A metadata key promoted out of metadata into a top level value.

class MetadataField(BaseModel)

Attributes

key str

The metadata[key] entry to promote into its own section.

label str | None

Override the section header text. Defaults to key when unset.

collapsed bool

Whether the field should be collapsed by default.

ScannerResultField

A built-in scanner-result section (e.g. value, explanation).

class ScannerResultField(BaseModel)

Attributes

name Literal['explanation', 'label', 'value', 'validation', 'answer', 'metadata']

Which built-in section to render.

label str | None

Override the section header text (e.g. "Explanation" → "Rationale").

collapsed bool

Whether the field should be collapsed by default.