Skip to main content

enterprise_ai.skills

Source: sdks/python/src/enterprise_ai/skills/__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 DigestMismatch​

The artifact content does not match the expected digest.

EaiError

Class SkillsClient​

/v1/skills.

Resource

SkillsClient.create​

create(manifest: dict[str, Any]) -> Any

Register a skill. Applies a Skill manifest: creates the skill or replaces it (a replaced skill goes back to draft, a blocked one stays blocked). The digest and the signature are verified at once: the skill becomes approved when they verify. A Git or OCI artifact needs artifact.digest (422 invalid_manifest). apply_status is created or updated. Needs tenant_admin, developer or application_owner; the caller becomes ReBAC owner. Audited as skill.apply.

Route: /v1/skills (POST).

NameTypeDefaultRequiredDescription
manifestdict[str, Any]yesSkill manifest of the new skill, sent as the request body.

Returns: Any. Decoded JSON answer of the operation "Register a skill".

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

SkillsClient.get​

get(name: str) -> Any

Get a skill. Returns the skill with its manifest, content, digest, signature and verification. Needs the ReBAC relation viewer. 404 skill_not_found.

Route: /v1/skills/{name} (GET).

NameTypeDefaultRequiredDescription
namestryesName of the skill.

Returns: Any. Decoded JSON answer of the operation "Get a skill".

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

SkillsClient.list​

list(**page: Any) -> Any

List the skills. Skills of the tenant in name order, with version, owner, digest, verification result and status. One page only.

Route: /v1/skills (GET).

NameTypeDefaultRequiredDescription
**pageAnynoPagination options passed to the listing: limit (maximum number of items per page) and cursor (the next_cursor of the previous page). Iterating the returned page follows every cursor.

Returns: Any. Decoded JSON answer of the operation "List the skills".

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

SkillsClient.load​

load(name: str, artifact: str | Path | bytes | None = None) -> Any

Load a skill for an agent. Skill Loader: returns what a runtime needs to use the skill (instructions of an inline skill, artifact, entrypoint, permissions, dependencies, signer). Needs the ReBAC relation can_invoke. Refusals, each audited as skill.load denied: - 403 skill_blocked: the skill is blocked or deprecated; - 409 skill_digest_mismatch: the content no longer matches its digest; - 403 skill_unsigned: the signature does not verify; - 403 skill_not_granted: with agent, the skill is not listed in the agent manifest; - 403 skill_permission_denied: the skill asks for scopes the agent lacks, or its classification ceiling is below the agent one.

Route: /v1/skills/{name}/load (GET).

NameTypeDefaultRequiredDescription
namestryesName of the skill.
artifactstr | Path | bytes | NoneNonenoLocal copy of the skill (bytes, file or folder) whose digest must match the one returned by the loader (sync client).

Returns: Any. Decoded JSON answer of the operation "Load a skill for an agent".

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

SkillsClient.set_status​

set_status(name: str, status: str, reason: str | None = None) -> Any

Change the status of a skill. approved goes through a promotion: an approval is opened for tenant_admin or security_officer and the answer is 202 with approval_id and status: pending_approval. The other statuses (draft, restricted, deprecated, blocked) apply at once (200). Needs tenant_admin or security_officer and the ReBAC relation editor. Audited as skill.status.

Route: /v1/skills/{name}/status (POST).

NameTypeDefaultRequiredDescription
namestryesName of the skill.
statusstryesdraft, approved (through an approval), restricted, deprecated or blocked.
reasonstr | NoneNonenoWhy the status changes (up to 2000 characters).

Returns: Any. Decoded JSON answer of the operation "Change the status of a skill".

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

SkillsClient.verify​

verify(name: str) -> Any

Verify a skill signature. Checks again the content digest and the signature against the trusted keys and stores the result: verified, method, signer, reason. A verified skill becomes approved, otherwise draft (a blocked skill stays blocked). Needs tenant_admin, developer, application_owner or security_officer and the ReBAC relation editor. Audited as skill.verify.

Route: /v1/skills/{name}/verify (POST).

NameTypeDefaultRequiredDescription
namestryesName of the skill.

Returns: Any. Decoded JSON answer of the operation "Verify a skill signature".

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

Functions​

compute_digest​

compute_digest(path: str | Path | bytes) -> str

sha256:<hex> of bytes, a file, or a directory tree.

NameTypeDefaultRequiredDescription
pathstr | Path | bytesyesBytes, a file or a folder; in a folder, .git, __pycache__, .venv, node_modules and .DS_Store are skipped.

Returns: str. Text sha256:<hex>; a folder is hashed over its sorted relative paths and contents.

verify_digest​

verify_digest(content: str | Path | bytes, expected: str) -> str

Raise :class:DigestMismatch unless content hashes to expected.

NameTypeDefaultRequiredDescription
contentstr | Path | bytesyesBytes, a file or a folder, hashed with compute_digest.
expectedstryesExpected digest sha256:<hex>, compared in constant time.

Returns: str. The computed digest, equal to expected.

Raises: DigestMismatch.