Skip to content

cayu.tools.grants

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

TARGETED_TOOL_GRANT_DEFAULT_LIFETIME_SECONDS

Section titled “TARGETED_TOOL_GRANT_DEFAULT_LIFETIME_SECONDS”
from cayu.tools import TARGETED_TOOL_GRANT_DEFAULT_LIFETIME_SECONDS
TARGETED_TOOL_GRANT_DEFAULT_LIFETIME_SECONDS = 300

Release source · Runtime guarantees · Capability guides

TARGETED_TOOL_GRANT_INSPECTION_MAX_RECORDS

Section titled “TARGETED_TOOL_GRANT_INSPECTION_MAX_RECORDS”
from cayu.tools import TARGETED_TOOL_GRANT_INSPECTION_MAX_RECORDS
TARGETED_TOOL_GRANT_INSPECTION_MAX_RECORDS = 256

Release source · Runtime guarantees · Capability guides

from cayu.tools import TARGETED_TOOL_GRANT_MAX_CALLS
TARGETED_TOOL_GRANT_MAX_CALLS = 32

Release source · Runtime guarantees · Capability guides

from cayu.tools import TARGETED_TOOL_GRANT_MAX_LIFETIME_SECONDS
TARGETED_TOOL_GRANT_MAX_LIFETIME_SECONDS = 86400

Release source · Runtime guarantees · Capability guides

from cayu.tools import TARGETED_TOOL_GRANT_MAX_REQUESTS
TARGETED_TOOL_GRANT_MAX_REQUESTS = 32

Release source · Runtime guarantees · Capability guides

from cayu.tools import TARGETED_TOOL_GRANT_SCHEMA_VERSION
TARGETED_TOOL_GRANT_SCHEMA_VERSION = 1

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrant

Application request for bounded addressability to one registered tool.

A request contains no executable, schema, policy, or authorization material. The runtime resolves all such identity from the registered catalogue.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] TARGETED_TOOL_GRANT_SCHEMA_VERSION
request_id str Field(max_length=TARGETED_TOOL_GRANT_REQUEST_ID_MAX_CHARS)
tool_id str required
max_calls StrictInt Field(default=1, ge=1, le=TARGETED_TOOL_GRANT_MAX_CALLS)
lifetime_seconds StrictInt Field(default=TARGETED_TOOL_GRANT_DEFAULT_LIFETIME_SECONDS, ge=1, le=TARGETED_TOOL_GRANT_MAX_LIFETIME_SECONDS)
expires_after_interaction Literal[True] True
origin str | None None
TargetedToolGrant.validate_schema_version(value: object) -> object
TargetedToolGrant.validate_request_id(value: str) -> str
TargetedToolGrant.validate_interaction_expiry(value: object) -> object
TargetedToolGrant.validate_tool_id(value: str) -> str
TargetedToolGrant.validate_origin(value: str | None) -> str | None

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantInspection

Public grant state with aliased scope and no principal authority.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] TARGETED_TOOL_GRANT_SCHEMA_VERSION
grant_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
tool_ref str required
request_id str Field(max_length=TARGETED_TOOL_GRANT_REQUEST_ID_MAX_CHARS)
session_id str required
interaction_id str required
generation_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
agent_name str required
task_id str | None None
environment_name str | None None
tool_id str required
tool_name str required
catalogue_revision str required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
issued_at datetime required
expires_at datetime required
expires_after_interaction Literal[True] True
max_calls StrictInt Field(ge=1, le=TARGETED_TOOL_GRANT_MAX_CALLS)
used_calls StrictInt Field(ge=0, le=TARGETED_TOOL_GRANT_MAX_CALLS)
origin str | None None
revoked_at datetime | None None
TargetedToolGrantInspection.validate_schema_version(value: object) -> object
TargetedToolGrantInspection.validate_interaction_expiry(value: object) -> object
TargetedToolGrantInspection.validate_tool_ref(value: str) -> str
TargetedToolGrantInspection.validate_request_identity(value: str) -> str
TargetedToolGrantInspection.validate_scope_identity(value: str, info) -> str
TargetedToolGrantInspection.validate_optional_scope_identity(value: str | None, info) -> str | None
TargetedToolGrantInspection.validate_tool_id(value: str) -> str
TargetedToolGrantInspection.validate_catalogue_revision(value: str) -> str
TargetedToolGrantInspection.validate_descriptor_version(value: str) -> str
TargetedToolGrantInspection.validate_origin(value: str | None) -> str | None
TargetedToolGrantInspection.normalize_timestamp(value: datetime | None, info) -> datetime | None
TargetedToolGrantInspection.validate_lifecycle() -> TargetedToolGrantInspection
TargetedToolGrantInspection.remaining_calls() -> int

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantIssueOutcome

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
ISSUED class attribute 'issued'
REUSED class attribute 'reused'

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantIssueResult

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
records tuple[TargetedToolGrantRecord, ...] required
outcomes tuple[TargetedToolGrantIssueOutcome, ...] required
events tuple[Event, ...] required
TargetedToolGrantIssueResult.copy_records(value: object) -> object
TargetedToolGrantIssueResult.copy_events(value: object) -> object
TargetedToolGrantIssueResult.bound_outcomes(value: object) -> object
TargetedToolGrantIssueResult.validate_lengths() -> TargetedToolGrantIssueResult

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantReconstructionResult

Validated grants remaining callable within one recovered interaction.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
valid tuple[TargetedToolGrantRecord, ...] ()
rejected tuple[tuple[str, TargetedToolUseRejectionReason], ...] ()
events tuple[Event, ...] ()
TargetedToolGrantReconstructionResult.copy_valid_records(value: object) -> object
TargetedToolGrantReconstructionResult.copy_events(value: object) -> object
TargetedToolGrantReconstructionResult.bound_rejections(value: object) -> object
TargetedToolGrantReconstructionResult.validate_shape() -> TargetedToolGrantReconstructionResult

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantRecord

Immutable durable state for one issued targeted reference.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] TARGETED_TOOL_GRANT_SCHEMA_VERSION
grant_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
tool_ref str required
request_id str Field(max_length=TARGETED_TOOL_GRANT_REQUEST_ID_MAX_CHARS)
session_id str required
interaction_id str required
generation_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
agent_name str required
task_id str | None None
environment_name str | None None
principal str | None None
tenant str | None None
tool_id str required
tool_name str required
catalogue_revision str required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
issued_at datetime required
expires_at datetime required
expires_after_interaction StrictBool True
max_calls StrictInt Field(ge=1, le=TARGETED_TOOL_GRANT_MAX_CALLS)
used_calls StrictInt Field(default=0, ge=0, le=TARGETED_TOOL_GRANT_MAX_CALLS)
origin str | None None
revoked_at datetime | None None
revocation_reason str | None None
TargetedToolGrantRecord.validate_schema_version(value: object) -> object
TargetedToolGrantRecord.validate_required_text(value: str, info) -> str
TargetedToolGrantRecord.validate_request_identity(value: str) -> str
TargetedToolGrantRecord.validate_tool_ref(value: str) -> str
TargetedToolGrantRecord.validate_scope_identity(value: str, info) -> str
TargetedToolGrantRecord.validate_tool_id(value: str) -> str
TargetedToolGrantRecord.validate_catalogue_revision(value: str) -> str
TargetedToolGrantRecord.validate_descriptor_version(value: str) -> str
TargetedToolGrantRecord.validate_optional_text(value: str | None, info) -> str | None
TargetedToolGrantRecord.validate_origin(value: str | None) -> str | None
TargetedToolGrantRecord.validate_revocation_reason(value: str | None) -> str | None
TargetedToolGrantRecord.normalize_timestamp(value: datetime | None, info) -> datetime | None
TargetedToolGrantRecord.validate_lifecycle() -> TargetedToolGrantRecord
TargetedToolGrantRecord.remaining_calls() -> int

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolGrantStateSnapshot

Complete typed grant state for trusted durable export and validation.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] TARGETED_TOOL_GRANT_SCHEMA_VERSION
records tuple[TargetedToolGrantRecord, ...] ()
uses tuple[TargetedToolUseBinding, ...] ()
TargetedToolGrantStateSnapshot.validate_schema_version(value: object) -> object
TargetedToolGrantStateSnapshot.require_materialized_sequences(value: object, info) -> object
TargetedToolGrantStateSnapshot.validate_state() -> TargetedToolGrantStateSnapshot

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolUseBinding

Permanent digest-only evidence for one accepted grant use.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] TARGETED_TOOL_GRANT_SCHEMA_VERSION
grant_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
use_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
session_id str required
interaction_id str required
model_step_id str required
outer_tool_call_id str required
arguments_sha256 str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
invocation_id str required
bound_at datetime required
TargetedToolUseBinding.validate_schema_version(value: object) -> object
TargetedToolUseBinding.validate_required_text(value: str, info) -> str
TargetedToolUseBinding.validate_scope_identity(value: str, info) -> str
TargetedToolUseBinding.validate_execution_identity(value: str, info) -> str
TargetedToolUseBinding.normalize_timestamp(value: datetime) -> datetime
TargetedToolUseBinding.validate_use_id() -> TargetedToolUseBinding

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolUseDisposition

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
BOUND class attribute 'bound'
REJOINED class attribute 'rejoined'
REJECTED class attribute 'rejected'

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolUseRejectionReason

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
MALFORMED class attribute 'malformed'
UNKNOWN class attribute 'unknown'
NOT_YET_VALID class attribute 'not_yet_valid'
EXPIRED class attribute 'expired'
REVOKED class attribute 'revoked'
EXHAUSTED class attribute 'exhausted'
CROSS_SESSION class attribute 'cross_session'
CROSS_INTERACTION class attribute 'cross_interaction'
CROSS_GENERATION class attribute 'cross_generation'
PRINCIPAL_MISMATCH class attribute 'principal_mismatch'
TENANT_MISMATCH class attribute 'tenant_mismatch'
AGENT_MISMATCH class attribute 'agent_mismatch'
TASK_MISMATCH class attribute 'task_mismatch'
ENVIRONMENT_MISMATCH class attribute 'environment_mismatch'
OUT_OF_CEILING class attribute 'out_of_ceiling'
CATALOGUE_DRIFT class attribute 'catalogue_drift'
DESCRIPTOR_DRIFT class attribute 'descriptor_drift'
INVALID_ARGUMENTS class attribute 'invalid_arguments'
ALTERED_REPLAY class attribute 'altered_replay'

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolUseRequest

Bounded identities required to reserve one future effective invocation.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
tool_ref str required
session_id str required
interaction_id str required
generation_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
agent_name str required
task_id str | None None
environment_name str | None None
principal str | None None
tenant str | None None
catalogue_revision str required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
tool_id str required
tool_name str required
model_step_id str required
outer_tool_call_id str required
arguments_sha256 str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
invocation_id str required
expected_run_epoch StrictInt Field(ge=0)
TargetedToolUseRequest.validate_tool_ref(value: str) -> str
TargetedToolUseRequest.validate_scope_identity(value: str, info) -> str
TargetedToolUseRequest.validate_execution_identity(value: str, info) -> str
TargetedToolUseRequest.validate_tool_id(value: str) -> str
TargetedToolUseRequest.validate_catalogue_revision(value: str) -> str
TargetedToolUseRequest.validate_descriptor_version(value: str) -> str
TargetedToolUseRequest.validate_optional_text(value: str | None, info) -> str | None

Release source · Runtime guarantees · Capability guides

from cayu.tools import TargetedToolUseResult

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
disposition TargetedToolUseDisposition required
reason TargetedToolUseRejectionReason | None None
grant TargetedToolGrantRecord | None None
binding TargetedToolUseBinding | None None
event Event | None None
TargetedToolUseResult.copy_grant(value: object) -> object
TargetedToolUseResult.copy_event_evidence(value: object) -> object
TargetedToolUseResult.validate_shape() -> TargetedToolUseResult

Release source · Runtime guarantees · Capability guides