Skip to main content

enterprise_ai.security

Source: sdks/python/src/enterprise_ai/security/__init__.py. Back to the Python SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class SecurityClient​

/v1/security/posture and /v1/security/settings.

Resource

SecurityClient.cancel_run​

cancel_run(run_id: str, reason: str | None = None) -> Any

Cancel a run. Moves the run to cancelled with the error cancelled; its active sub-agent runs are cancelled too. Needs tenant_admin, developer, agent or security_officer. A run already terminal answers 409 invalid_transition. Audited as run.transition.

Route: /v1/runs/{run_id}/cancel (POST).

NameTypeDefaultRequiredDescription
run_idstryesIdentifier (UUID) of the run.
reasonstr | NoneNonenoWhy the action is taken. Written to the audit trail with the actor and the time.

Returns: Any. Decoded JSON answer of the operation "Cancel a run".

Raises: the typed errors of the transport (Errors).

SecurityClient.check_state​

check_state() -> Any

Get the security posture. Returns environment, generated_at, protections (authentication methods and other protections in force), checks (each with its status pass, warn or fail, severity and message) and summary (number of checks per status). For a caller with a tenant, also tenant with the security settings of the tenant, which some checks take into account. Needs security_officer or tenant_admin. Read only.

Route: /v1/security/posture (GET).

This element takes no parameter.

Returns: Any. Decoded JSON answer of the operation "Get the security posture".

Raises: the typed errors of the transport (Errors).

SecurityClient.get_settings​

get_settings() -> Any

Get the security settings. Returns tenant_id and settings: the security settings of the tenant, defaults included. Needs tenant_admin or security_officer and a tenant (403 tenant_required).

Route: /v1/security/settings (GET).

This element takes no parameter.

Returns: Any. Decoded JSON answer of the operation "Get the security settings".

Raises: the typed errors of the transport (Errors).

SecurityClient.posture​

posture() -> Any

Get the security posture. Returns environment, generated_at, protections (authentication methods and other protections in force), checks (each with its status pass, warn or fail, severity and message) and summary (number of checks per status). For a caller with a tenant, also tenant with the security settings of the tenant, which some checks take into account. Needs security_officer or tenant_admin. Read only.

Route: /v1/security/posture (GET).

This element takes no parameter.

Returns: Any. Decoded JSON answer of the operation "Get the security posture".

Raises: the typed errors of the transport (Errors).

SecurityClient.report_incident​

report_incident(title: str, severity: str, **extra: Any) -> Any

Open an incident. Opens an incident in status open, adds the created entry to the timeline and forwards it to the SIEM. Needs tenant_admin, security_officer, developer or agent. An unknown severity answers 400 invalid_request. Writes the audit event incident.create. The answer (201) carries the incident with its timeline.

Route: /v1/incidents (POST).

NameTypeDefaultRequiredDescription
titlestryesTitle, 3 to 300 characters.
severitystryessev1 (most severe) to sev4; the aliases critical, high, medium and low are accepted. Default sev3.
**extraAnynoExtra fields merged into the request body.

Returns: Any. Decoded JSON answer of the operation "Open an incident".

Raises: the typed errors of the transport (Errors).

SecurityClient.update_settings​

update_settings(settings: dict[str, Any] | None = None, **fields: Any) -> Any

Update the security settings. Partial update: only the settings sent change, the others keep their value. Needs tenant_admin or security_officer and a tenant.

Route: /v1/security/settings (PUT).

NameTypeDefaultRequiredDescription
settingsdict[str, Any] | NoneNonenoSettings to change; keyword arguments are merged on top.
**fieldsAnynoFields of the method (for example user and password), up to 16 text values.

Returns: Any. Decoded JSON answer of the operation "Update the security settings".

Raises: the typed errors of the transport (Errors).