Skip to content

cayu.tools.browser_control

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.

from cayu.tools import BrowserControlPolicy

Application-owned live-view and operator-action permission.

Implementations must authorize the session/allocation and action explicitly. Authentication or a matching tenant alone is not an authorization decision. Decisions are scoped to the supplied revision; they are not reusable grants for later control generations. No page content, pixels, or input is supplied.

Bases: ABC.

BrowserControlPolicy.identity() -> str

Return a stable, versioned, non-secret application policy identity.

async BrowserControlPolicy.decide(request: BrowserControlPolicyRequest) -> BrowserControlPolicyResult

Authorize this exact action, or deny without causing browser effects.

Release source · Runtime guarantees · Capability guides

from cayu.tools import BrowserControlPolicyRequest

One exact, content-free application authorization question.

Bases: _ControlModel.

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
principal BrowserControlPrincipal Field(repr=False)
identity BrowserControlIdentity required
operator_session_id _Identity Field(repr=False)
action BrowserControlAction required
record_revision _Counter required
control_epoch _Counter required
state BrowserControlState required
BrowserControlPolicyRequest.portable_text(value: Any) -> Any
BrowserControlPolicyRequest.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> Self

Release source · Runtime guarantees · Capability guides

from cayu.tools import BrowserControlPolicyResult

No permission is granted by omission or by a truthy extension value.

Bases: _ControlModel.

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
allowed Annotated[bool, Field(strict=True)] False
BrowserControlPolicyResult.portable_text(value: Any) -> Any
BrowserControlPolicyResult.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> Self

Release source · Runtime guarantees · Capability guides

from cayu.tools import BrowserOperatorPurpose

Application-declared intervention scope, never page-authored instructions.

Bases: _ControlModel.

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
code Annotated[str, Field(strict=True, pattern='^[a-z][a-z0-9_]{0,63}$')] required
expected_origins tuple[Annotated[str, Field(strict=True, max_length=2048)], ...] Field(min_length=1, max_length=32)
BrowserOperatorPurpose.portable_text(value: Any) -> Any
BrowserOperatorPurpose.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> Self
BrowserOperatorPurpose.canonical_origins(values: tuple[str, ...]) -> tuple[str, ...]

Release source · Runtime guarantees · Capability guides