Launch Week 3: Five days of launches

Governance Controls

The Governance Controls methods of `client.organization`, in Python and TypeScript.

Overview

The Confident AI SDK exposes every Governance Control method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.

Methods

List Governance Controls

Lists your organization's governance controls, newest created first, each with its health across the projects it governs. A control's definition is not included — read its versions for that. Health is computed from the latest verdict per governed project, so it reflects the current state rather than the whole assessment history.

from confident_ai import ConfidentAI
from confident_ai.organization import GovernanceControlActivity
from confident_ai.organization import GovernanceControlType

client = ConfidentAI()

result = client.organization.list_governance_controls(
    type=GovernanceControlType.RUNTIME,
    activity=GovernanceControlActivity.ACTIVE,
    page=1,
    page_size=25,
)

For async mode, call a_list_governance_controls and await it as shown below:

result = await client.organization.a_list_governance_controls(...)

Parameters

ParameterTypeDescription
typeOptional[GovernanceControlType]See GovernanceControlType.
activityOptional[GovernanceControlActivity]See GovernanceControlActivity.
pageOptional[int]The page to return. Defaults to 1.
page_sizeOptional[int]The number of controls per page, at most 100. Defaults to 25.

Returns

This method returns an object of type GovernanceControlList.

Create Governance Control

Creates a governance control and returns its id. Supplying the config that matches the control's type snapshots its first version in the same call; omitting it creates the control with no definition, which assesses as ERROR until you add a version. Operational controls are seeded by Confident AI and cannot be created here. A new control governs nothing until a policy holds it.

from confident_ai import ConfidentAI
from confident_ai.organization import CreatableGovernanceControlType
from confident_ai.common import FilterSet
from confident_ai.organization import GovernanceControlAggregation
from confident_ai.organization import GovernanceControlDataModel
from confident_ai.organization import GovernanceControlExtraQueryParams
from confident_ai.organization import GovernanceControlMetricDataCategory
from confident_ai.organization import GovernanceControlPreDeploymentConfig
from confident_ai.organization import GovernanceControlPreDeploymentWindow
from confident_ai.organization import GovernanceControlRuntimeConfig
from confident_ai.organization import GovernanceControlSeverity
from confident_ai.organization import GovernanceControlThresholdDirection
from confident_ai.organization import GovernanceControlThresholdSettings

client = ConfidentAI()

result = client.organization.create_governance_control(
    name="Production error rate under 2%",
    type=CreatableGovernanceControlType.RUNTIME,
    description="Traces must error on fewer than 2% of production requests over the last day.",
    runtime_config=GovernanceControlRuntimeConfig(
        data_model=GovernanceControlDataModel.TRACE,
        aggregation=GovernanceControlAggregation.AVG_COST,
        threshold_settings=GovernanceControlThresholdSettings(
            value=0.02,
            direction=GovernanceControlThresholdDirection.ABOVE
        ),
        extra_query_params=GovernanceControlExtraQueryParams(
            category=GovernanceControlMetricDataCategory.TRACE
        ),
        filters=FilterSet(
            operator="AND",
            groups=[]
        ),
        severity=GovernanceControlSeverity.CRITICAL
    ),
    pre_deployment_config=GovernanceControlPreDeploymentConfig(
        identifier="pre-release",
        window=GovernanceControlPreDeploymentWindow(
            days=30
        ),
        official_only=False,
        filters=FilterSet(
            operator="AND",
            groups=[]
        ),
        severity=GovernanceControlSeverity.CRITICAL
    ),
    governance_policy_id="<GOVERNANCE-POLICY-ID>",
)

For async mode, call a_create_governance_control and await it as shown below:

result = await client.organization.a_create_governance_control(...)

Parameters

ParameterTypeDescription
namestrRequired. The name of the control, unique within your organization.
typeCreatableGovernanceControlTypeRequired. See CreatableGovernanceControlType.
descriptionOptional[str]What the control checks and why. Send null to leave it unset.
runtime_configOptional[GovernanceControlRuntimeConfig]See GovernanceControlRuntimeConfig.
pre_deployment_configOptional[GovernanceControlPreDeploymentConfig]See GovernanceControlPreDeploymentConfig.
governance_policy_idOptional[str]Accepted but not acted on: the control is created unattached whether or not you send it. Attach it through the governance policy's own controls endpoint.

Returns

This method returns an object of type GovernanceControlRef.

Get Governance Control

Retrieves a single governance control with its health across the projects it governs and when it was last assessed. The rule it evaluates is not returned here — list the control's versions to read its definition.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.organization.get_governance_control(
    control_id="<GOVERNANCE-CONTROL-ID>",
)

For async mode, call a_get_governance_control and await it as shown below:

result = await client.organization.a_get_governance_control(...)

Parameters

ParameterTypeDescription
control_idstrRequired. The id of the governance control.

Returns

This method returns an object of type GovernanceControl.

Update Governance Control

Updates a governance control's name or description and returns it. Both live on the control rather than on a version, so this does not snapshot a new version and does not change what the control checks — append a version for that. An operational control's name and description come from Confident AI's registry and cannot be edited.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.organization.update_governance_control(
    control_id="<GOVERNANCE-CONTROL-ID>",
    name="Production error rate under 1%",
    description="Traces must error on fewer than 1% of production requests over the last day.",
)

For async mode, call a_update_governance_control and await it as shown below:

result = await client.organization.a_update_governance_control(...)

Parameters

ParameterTypeDescription
control_idstrRequired. The id of the governance control.
nameOptional[str]The name of the control, unique within your organization.
descriptionOptional[str]What the control checks and why. Send null to clear it.

Returns

This method returns an object of type GovernanceControl.

Delete Governance Control

Permanently deletes a governance control, every version of its definition, and every verdict recorded against it. Any policy holding the control loses it and stops applying that check. Warning: This action cannot be undone. To stop a control gating one policy without deleting it, remove it from that policy instead.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.organization.delete_governance_control(
    control_id="<GOVERNANCE-CONTROL-ID>",
)

For async mode, call a_delete_governance_control and await it as shown below:

result = await client.organization.a_delete_governance_control(...)

Parameters

ParameterTypeDescription
control_idstrRequired. The id of the governance control.

Returns

This method returns an object of type GovernanceControlRef.

Assess Governance Control

Runs a governance control now against every project it governs, rather than waiting for the scheduled sweep, recording one verdict per project against the control's current version. A project is governed when its policy holds the control, or extends a base policy that does. Verdicts are append-only: each becomes that project's current status and a row in the control's history, and running this again adds rows rather than replacing them. A project with nothing to measure resolves to NO_DATA, one whose control is not fully configured to ERROR. A control in no policy, or with no version, governs nothing and returns zero counts. Cost scales with the number of governed projects.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.organization.assess_governance_control(
    control_id="<GOVERNANCE-CONTROL-ID>",
)

For async mode, call a_assess_governance_control and await it as shown below:

result = await client.organization.a_assess_governance_control(...)

Parameters

ParameterTypeDescription
control_idstrRequired. The id of the governance control.

Returns

This method returns an object of type AssessGovernanceControlResult.

List Governance Control Assessments

Lists a governance control's recorded verdicts, one per project per run, newest first. Verdicts belong to the version they were computed against, so they are read one version at a time. There is no time window — every verdict ever recorded against that version is paginated here, so a control assessed daily across five projects returns five rows per day rather than a single current state. The newest verdict for a project is that project's current status; everything older is history. A control with no versions yet is a 404 rather than an empty list.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.organization.list_governance_control_assessments(
    control_id="<GOVERNANCE-CONTROL-ID>",
    version="00.00.02",
    page=1,
    page_size=25,
)

For async mode, call a_list_governance_control_assessments and await it as shown below:

result = await client.organization.a_list_governance_control_assessments(...)

Parameters

ParameterTypeDescription
control_idstrRequired. The id of the governance control.
versionOptional[str]The version label of the control version to read verdicts for. Omit it to read the current version, which is the one with the highest sequence.
pageOptional[int]The page to return. Defaults to 1.
page_sizeOptional[int]The number of assessments per page, at most 100. Defaults to 25.

Returns

This method returns an object of type GovernanceControlAssessmentList.

Types

AssessGovernanceControlResult

What one on-demand run of a control produced across the projects it governs.

class AssessGovernanceControlResult:
    projects_assessed: int = Field(alias="projectsAssessed")
    assessments: int
    status_counts: Dict[str, int] = Field(alias="statusCounts")

projects_assessedintRequired

How many governed projects the control was run against. It is 0 when the control is in no policy or has no version yet.

Example: 5

assessmentsintRequired

How many verdicts this run recorded. It matches projectsAssessed unless recording one failed, in which case that project is skipped rather than reported.

Example: 5

status_countsDict[str, int]Required

How many projects resolved to each verdict, keyed by one of the GovernanceControlStatus values. A verdict no project resolved to is absent rather than zero, so an empty object means nothing was assessed.

Example: {"PASS":4,"FAIL":1}

CreatableGovernanceControlType

The control types you can create. OPERATIONAL is absent because Confident AI seeds those controls from its own registry.

class CreatableGovernanceControlType(Enum):
    RUNTIME = "RUNTIME"
    PRE_DEPLOYMENT_EVALS = "PRE_DEPLOYMENT_EVALS"
    PRE_DEPLOYMENT_RED_TEAMING = "PRE_DEPLOYMENT_RED_TEAMING"

RUNTIME · PRE_DEPLOYMENT_EVALS · PRE_DEPLOYMENT_RED_TEAMING

FilterSet

A set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as Name or User Id, against a value with a condition such as Is or Contains.

class FilterSet:
    operator: Literal["AND", "OR"]
    groups: List[FilterSetGroup]

operatorLiteral["AND", "OR"]Required

groupsList[FilterSetGroup]Required

GovernanceControl

One check a governance policy applies to the projects it governs. The control is a stable identity — its name, its type and its membership of policies — while the rule it evaluates lives on its append-only versions, the newest of which is the definition every new assessment runs against.

class GovernanceControl:
    id: str
    name: str
    description: Optional[str]
    type: GovernanceControlType
    operational_key: Optional[str] = Field(alias="operationalKey")
    recommended: bool
    configured: bool
    policies_count: int = Field(alias="policiesCount")
    severity: Optional[GovernanceControlSeverity]
    assessments_count: int = Field(alias="assessmentsCount")
    created_at: str = Field(alias="createdAt")
    health: GovernanceControlHealth
    last_assessed_at: Optional[str] = Field(alias="lastAssessedAt")

idstrRequired

The id of the control, generated by Confident AI.

Example: "<GOVERNANCE-CONTROL-ID>"

namestrRequired

The name of the control, unique within your organization.

Example: "Production error rate under 2%"

descriptionOptional[str]Required

What the control checks and why, or null when it has none.

Example: "Traces must error on fewer than 2% of production requests over the last day."

typeGovernanceControlTypeRequired

operational_keyOptional[str]Required

The Confident AI registry entry an OPERATIONAL control was seeded from, which is what it checks. It is null for every other type.

recommendedboolRequired

Whether Confident AI recommends this control as part of a baseline. It is set on the controls Confident AI seeds and is false for controls you create.

Example: false

configuredboolRequired

Whether the control's current version carries enough of a definition to be assessed. A runtime control needs a data model, an aggregation and a numeric threshold; a pre-deployment control needs either a run identifier or officialOnly. An unconfigured control assesses as ERROR, and an OPERATIONAL control is always configured.

Example: true

policies_countintRequired

How many governance policies hold this control. A control in no policy governs nothing and is never assessed.

Example: 2

severityOptional[GovernanceControlSeverity]Required

The severity recorded on the control's current version, or null when the control has no version yet or its severity was left unset.

See GovernanceControlSeverity.

assessments_countintRequired

How many verdicts have been recorded for this control, summed across every version of its definition.

Example: 128

created_atstrRequired

When the control was created.

Example: "2025-01-14T09:30:00+00:00"

healthGovernanceControlHealthRequired

last_assessed_atOptional[str]Required

When this control was most recently assessed against any project, across every version of its definition, or null when it has never been assessed.

Example: "2025-01-20T02:00:00+00:00"

GovernanceControlActivity

Whether a control is attached to at least one governance policy. A control in no policy governs no project and is never assessed.

class GovernanceControlActivity(Enum):
    ACTIVE = "active"
    INACTIVE = "inactive"

ACTIVE · INACTIVE

GovernanceControlAggregation

How a runtime control reduces the data it measures to the single number it compares against its threshold. Each aggregation is only valid for some data models — Avg score and Pass rate need METRIC_DATA, Avg rating needs ANNOTATION, Input tokens needs SPAN — and a pairing the selected dataModel does not support is rejected.

class GovernanceControlAggregation(Enum):
    AVG_COST = "Avg cost"
    AVG_LATENCY = "Avg latency"
    AVG_RATING = "Avg rating"
    AVG_SCORE = "Avg score"
    AVG_VALUE = "Avg value"
    COUNT = "Count"
    ERROR_COUNT = "Error count"
    ERROR_RATE = "Error rate"
    FAILURE_RATE = "Failure rate"
    INPUT_COST = "Input cost"
    INPUT_TOKENS = "Input tokens"
    MEDIAN_SCORE = "Median score"
    OUTPUT_COST = "Output cost"
    OUTPUT_TOKENS = "Output tokens"
    P50_LATENCY = "P50 latency"
    P90_LATENCY = "P90 latency"
    P99_LATENCY = "P99 latency"
    PASS_RATE = "Pass rate"
    TOTAL_COST = "Total cost"
    TOTAL_TOKENS = "Total tokens"
    UNIQUE_END_USERS = "Unique end users"
    UNIQUE_METADATA_VALUES = "Unique metadata values"
    UNIQUE_THREADS = "Unique threads"

AVG_COST · AVG_LATENCY · AVG_RATING · AVG_SCORE · AVG_VALUE · COUNT · ERROR_COUNT · ERROR_RATE · FAILURE_RATE · INPUT_COST · INPUT_TOKENS · MEDIAN_SCORE · OUTPUT_COST · OUTPUT_TOKENS · P50_LATENCY · P90_LATENCY · P99_LATENCY · PASS_RATE · TOTAL_COST · TOTAL_TOKENS · UNIQUE_END_USERS · UNIQUE_METADATA_VALUES · UNIQUE_THREADS

GovernanceControlAssessment

One verdict of one version of a control against one project. Assessments are append-only, so a project's current state for a control is its newest assessment and everything older is history.

class GovernanceControlAssessment:
    id: str
    governance_control_id: str = Field(alias="governanceControlId")
    governance_control_version: GovernanceControlVersionReference = Field(alias="governanceControlVersion")
    project_id: str = Field(alias="projectId")
    project_name: str = Field(alias="projectName")
    status: GovernanceControlStatus
    evidence: Optional[Dict[str, Any]]
    error: Optional[str]
    created_at: str = Field(alias="createdAt")

idstrRequired

The id of the assessment, generated by Confident AI.

Example: "<GOVERNANCE-CONTROL-ASSESSMENT-ID>"

governance_control_idstrRequired

The id of the control that was assessed.

Example: "<GOVERNANCE-CONTROL-ID>"

governance_control_versionGovernanceControlVersionReferenceRequired

project_idstrRequired

The id of the project the control was assessed against.

Example: "<PROJECT-ID>"

project_namestrRequired

The name of the project the control was assessed against.

Example: "Checkout Assistant"

statusGovernanceControlStatusRequired

evidenceOptional[Dict[str, Any]]Required

What the verdict was based on, or null when the assessment errored before it measured anything. Its keys follow the control type: a runtime assessment reports the dataModel, aggregation, threshold, direction, the window it measured and the value it measured (or noData: true when the window was empty); a pre-deployment assessment reports the run it gated on as latestRunId and latestRunAt plus whether it passed; an operational assessment reports whatever the platform check found.

Example: {"dataModel":"TRACE","aggregation":"Error rate","threshold":0.02,"direction":"above","filterGroupCount":1,"window":{"start":"2025-01-19T02:00:00+00:00","end":"2025-01-20T02:00:00+00:00"},"value":0.031}

errorOptional[str]Required

Why the check could not be run, set only alongside an ERROR verdict. It is null on every other verdict.

created_atstrRequired

When the verdict was recorded.

Example: "2025-01-20T02:00:00+00:00"

GovernanceControlAssessmentList

One page of a control's verdicts for a single version of its definition, with the total across all pages.

class GovernanceControlAssessmentList:
    governance_assessments: List[GovernanceControlAssessment] = Field(alias="governanceAssessments")
    total_governance_control_assessments: int = Field(alias="totalGovernanceControlAssessments")
    version: str
    page: int
    page_size: int = Field(alias="pageSize")

governance_assessmentsList[GovernanceControlAssessment]Required

The verdicts recorded against the version that was read, newest first. Every verdict for that version is returned, without a time window, so a project that has been assessed daily for a month appears once per assessment rather than once.

See GovernanceControlAssessment.

total_governance_control_assessmentsintRequired

The number of verdicts recorded against the version that was read, across every page.

Example: 64

versionstrRequired

The version the verdicts belong to, echoed so a caller who omitted version knows which one was read.

Example: "00.00.02"

pageintRequired

The page this response covers.

Example: 1

page_sizeintRequired

The number of verdicts per page.

Example: 25

GovernanceControlDataModel

The production data a runtime control measures: TRACE for whole requests, SPAN for individual steps, THREAD for conversations, METRIC_DATA for evaluation scores, and ANNOTATION for human ratings. It decides which aggregations are valid.

class GovernanceControlDataModel(Enum):
    TRACE = "TRACE"
    SPAN = "SPAN"
    THREAD = "THREAD"
    METRIC_DATA = "METRIC_DATA"
    ANNOTATION = "ANNOTATION"

TRACE · SPAN · THREAD · METRIC_DATA · ANNOTATION

GovernanceControlExtraQueryParams

Extra scoping for the data a runtime control measures, beyond its data model and filters.

class GovernanceControlExtraQueryParams:
    category: Optional[GovernanceControlMetricDataCategory] = None

categoryOptional[GovernanceControlMetricDataCategory]

GovernanceControlHealth

How a control is doing across the projects it governs, computed from the latest verdict per project rather than from its whole assessment history. A project is governed when its policy holds the control, or when its policy extends a base policy that holds it.

class GovernanceControlHealth:
    pass_rate: Optional[float] = Field(alias="passRate")
    projects_assessed: int = Field(alias="projectsAssessed")
    projects_failing: int = Field(alias="projectsFailing")
    projects_total: int = Field(alias="projectsTotal")
    projects: Optional[List[GovernanceControlProjectStatus]] = None

pass_rateOptional[float]Required

The share of governed projects whose latest verdict passes, from 0 to 100, rounded to a whole number. NO_DATA verdicts are excluded from both sides of the ratio, and the value is null when no governed project has produced a counted verdict yet.

Example: 75

projects_assessedintRequired

How many governed projects have produced a counted verdict, meaning a PASS, FAIL or ERROR rather than NO_DATA.

Example: 4

projects_failingintRequired

How many governed projects have a latest verdict of FAIL or ERROR.

Example: 1

projects_totalintRequired

How many projects the control governs in total, including those it has never been assessed against. The difference from projectsAssessed is the projects with no counted verdict yet.

Example: 5

projectsOptional[List[GovernanceControlProjectStatus]]

The latest verdict for each governed project, one entry per project counted in projectsTotal. It is empty when the control is attached to no policy.

See GovernanceControlProjectStatus.

GovernanceControlList

One page of governance controls, with the total across all pages.

class GovernanceControlList:
    governance_controls: List[GovernanceControlSummary] = Field(alias="governanceControls")
    total_governance_controls: int = Field(alias="totalGovernanceControls")
    page: int
    page_size: int = Field(alias="pageSize")

governance_controlsList[GovernanceControlSummary]Required

The organization's governance controls for the current page, newest created first.

See GovernanceControlSummary.

total_governance_controlsintRequired

The number of controls matching type and activity, across every page.

Example: 12

pageintRequired

The page this response covers.

Example: 1

page_sizeintRequired

The number of controls per page.

Example: 25

GovernanceControlMetricDataCategory

Which kind of item the evaluation scores were recorded on, for a control measuring METRIC_DATA.

class GovernanceControlMetricDataCategory(Enum):
    TRACE = "TRACE"
    SPAN = "SPAN"
    THREAD = "THREAD"

TRACE · SPAN · THREAD

GovernanceControlPreDeploymentConfig

The rule a PRE_DEPLOYMENT_EVALS or PRE_DEPLOYMENT_RED_TEAMING control evaluates, read as one sentence: find the project's newest completed run whose identifier is identifier within the last window.days days, and pass when that run satisfies filters. An identifier of pre-release with a 30-day window and a filter of Pass rate >= 0.9 fails a project whose last pre-release run scored below 90%, and reports NO_DATA when it has not run one at all. PRE_DEPLOYMENT_EVALS looks at test runs and PRE_DEPLOYMENT_RED_TEAMING at red teaming runs; the endpoint picks which by the control's own type, so the same shape serves both. Send a non-empty identifier unless officialOnly is true.

class GovernanceControlPreDeploymentConfig:
    identifier: str
    window: GovernanceControlPreDeploymentWindow
    official_only: Optional[bool] = Field(default=None, alias="officialOnly")
    filters: Optional[FilterSet]
    severity: Optional[GovernanceControlSeverity]

identifierstrRequired

The identifier of the run to gate on, as sent when the test run or red teaming run was created. Send an empty string when officialOnly is true.

Example: "pre-release"

windowGovernanceControlPreDeploymentWindowRequired

official_onlyOptional[bool]

Gate on the project's most recent official run instead of on a run matching identifier, which ignores identifier and the window. Defaults to false.

Example: false

filtersOptional[FilterSet]Required

The conditions the run has to satisfy to pass, matched against the run itself rather than used to narrow a search — the control still gates on the newest run in the window, and fails when that run does not match. Send null to pass on the mere existence of a run.

See FilterSet.

severityOptional[GovernanceControlSeverity]Required

How much a failure matters. Send null to leave it unset, which still blocks a deployment gate.

See GovernanceControlSeverity.

GovernanceControlPreDeploymentWindow

The rolling lookback a pre-deployment control searches for the run it gates on.

class GovernanceControlPreDeploymentWindow:
    days: int

daysintRequired

How many days back the control looks for a run. It is stored as a day count rather than as dates, so the gate does not go stale as it is re-assessed.

Example: 30

GovernanceControlProjectStatus

One governed project's latest verdict for a control, which is the current state of that pair.

class GovernanceControlProjectStatus:
    project_id: str = Field(alias="projectId")
    project_name: str = Field(alias="projectName")
    status: Optional[GovernanceControlStatus]

project_idstrRequired

The id of the governed project.

Example: "<PROJECT-ID>"

project_namestrRequired

The name of the governed project.

Example: "Checkout Assistant"

statusOptional[GovernanceControlStatus]Required

The project's latest verdict for this control, or null when the control has never been assessed against it.

See GovernanceControlStatus.

GovernanceControlRef

A reference to a governance control by its id.

class GovernanceControlRef:
    id: str

idstrRequired

The id of the governance control.

Example: "<GOVERNANCE-CONTROL-ID>"

GovernanceControlRuntimeConfig

The rule a RUNTIME control evaluates, read as one sentence: aggregate aggregation over dataModel for the trailing 24 hours, restricted to filters, and fail when the result sits on the direction side of the threshold. Aggregating Error rate over TRACE against a threshold of 0.02 above fails a project whose traces errored on more than 2% of requests in the last day. The window is fixed and is not part of the definition. The aggregation has to be one the data model supports.

class GovernanceControlRuntimeConfig:
    data_model: Optional[GovernanceControlDataModel] = Field(alias="dataModel")
    aggregation: Optional[GovernanceControlAggregation]
    threshold_settings: Optional[GovernanceControlThresholdSettings] = Field(alias="thresholdSettings")
    extra_query_params: Optional[GovernanceControlExtraQueryParams] = Field(default=None, alias="extraQueryParams")
    filters: Optional[FilterSet]
    severity: Optional[GovernanceControlSeverity]

data_modelOptional[GovernanceControlDataModel]Required

The production data to measure. Send null to leave the control unconfigured, which makes it assess as ERROR until it is set.

See GovernanceControlDataModel.

aggregationOptional[GovernanceControlAggregation]Required

How to reduce the measured data to the one number the threshold is compared against. It must be an aggregation the selected dataModel supports.

See GovernanceControlAggregation.

threshold_settingsOptional[GovernanceControlThresholdSettings]Required

The threshold the aggregated value is compared against. Send null to leave the control unconfigured.

See GovernanceControlThresholdSettings.

extra_query_paramsOptional[GovernanceControlExtraQueryParams]

Extra scoping for the measured data. It is the one field that is carried over from the current version when you omit it; send null to clear it.

See GovernanceControlExtraQueryParams.

filtersOptional[FilterSet]Required

Narrows the data that is aggregated, so the control measures a slice of production rather than all of it. Send null to measure everything.

See FilterSet.

severityOptional[GovernanceControlSeverity]Required

How much a failure matters. Send null to leave it unset, which still blocks a deployment gate.

See GovernanceControlSeverity.

GovernanceControlSeverity

How much a failing control matters, set per version rather than per control. LOW never blocks a deployment gate; CRITICAL, HIGH and MEDIUM block, and so does leaving the severity unset.

class GovernanceControlSeverity(Enum):
    CRITICAL = "CRITICAL"
    HIGH = "HIGH"
    MEDIUM = "MEDIUM"
    LOW = "LOW"

CRITICAL · HIGH · MEDIUM · LOW

GovernanceControlStatus

The verdict of assessing one governance control against a project or organization.

class GovernanceControlStatus(Enum):
    PASS = "PASS"
    FAIL = "FAIL"
    ERROR = "ERROR"
    NO_DATA = "NO_DATA"

PASS · FAIL · ERROR · NO_DATA

GovernanceControlSummary

A control as it appears in a list: what it is, how widely it is applied, and how it is doing across the projects it governs. Its definition is not included — read the control's versions for that.

class GovernanceControlSummary:
    id: str
    name: str
    description: Optional[str]
    type: GovernanceControlType
    operational_key: Optional[str] = Field(alias="operationalKey")
    recommended: bool
    configured: bool
    policies_count: int = Field(alias="policiesCount")
    severity: Optional[GovernanceControlSeverity]
    assessments_count: int = Field(alias="assessmentsCount")
    created_at: str = Field(alias="createdAt")
    health: GovernanceControlHealth

idstrRequired

The id of the control, generated by Confident AI.

Example: "<GOVERNANCE-CONTROL-ID>"

namestrRequired

The name of the control, unique within your organization.

Example: "Production error rate under 2%"

descriptionOptional[str]Required

What the control checks and why, or null when it has none.

Example: "Traces must error on fewer than 2% of production requests over the last day."

typeGovernanceControlTypeRequired

operational_keyOptional[str]Required

The Confident AI registry entry an OPERATIONAL control was seeded from, which is what it checks. It is null for every other type.

recommendedboolRequired

Whether Confident AI recommends this control as part of a baseline. It is set on the controls Confident AI seeds and is false for controls you create.

Example: false

configuredboolRequired

Whether the control's current version carries enough of a definition to be assessed. A runtime control needs a data model, an aggregation and a numeric threshold; a pre-deployment control needs either a run identifier or officialOnly. An unconfigured control assesses as ERROR, and an OPERATIONAL control is always configured.

Example: true

policies_countintRequired

How many governance policies hold this control. A control in no policy governs nothing and is never assessed.

Example: 2

severityOptional[GovernanceControlSeverity]Required

The severity recorded on the control's current version, or null when the control has no version yet or its severity was left unset.

See GovernanceControlSeverity.

assessments_countintRequired

How many verdicts have been recorded for this control, summed across every version of its definition.

Example: 128

created_atstrRequired

When the control was created.

Example: "2025-01-14T09:30:00+00:00"

healthGovernanceControlHealthRequired

GovernanceControlThresholdDirection

Which side of the threshold fails: above fails once the measured value rises past value, below fails once it drops under it.

class GovernanceControlThresholdDirection(Enum):
    ABOVE = "above"
    BELOW = "below"

ABOVE · BELOW

GovernanceControlThresholdSettings

The comparison that turns a runtime control's measured value into a verdict.

class GovernanceControlThresholdSettings:
    value: float
    direction: GovernanceControlThresholdDirection

valuefloatRequired

The number the aggregated value is compared against, in the unit the aggregation produces — a rate is a fraction between 0 and 1, a latency is in milliseconds, a cost is in USD.

Example: 0.02

directionGovernanceControlThresholdDirectionRequired

GovernanceControlType

What a governance control checks: RUNTIME watches production behaviour, PRE_DEPLOYMENT_EVALS and PRE_DEPLOYMENT_RED_TEAMING gate a release, and OPERATIONAL covers process rather than the system itself.

class GovernanceControlType(Enum):
    RUNTIME = "RUNTIME"
    PRE_DEPLOYMENT_EVALS = "PRE_DEPLOYMENT_EVALS"
    PRE_DEPLOYMENT_RED_TEAMING = "PRE_DEPLOYMENT_RED_TEAMING"
    OPERATIONAL = "OPERATIONAL"

RUNTIME · PRE_DEPLOYMENT_EVALS · PRE_DEPLOYMENT_RED_TEAMING · OPERATIONAL

GovernanceControlVersionReference

The version of a control's definition an assessment was computed against.

class GovernanceControlVersionReference:
    id: str
    version: str

idstrRequired

The id of the control version, generated by Confident AI.

Example: "<GOVERNANCE-CONTROL-VERSION-ID>"

versionstrRequired

The human-readable label of the control version.

Example: "00.00.02"

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI