Skip to content

cayu.environments.base

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.environments import copy_environment
copy_environment(environment: Environment) -> Environment

Release source · Runtime guarantees · Capability guides

from cayu.environments import DEFAULT_WORKSPACE_INSTRUCTION_PATHS
DEFAULT_WORKSPACE_INSTRUCTION_PATHS = ('AGENTS.md', '.cayu/AGENTS.md')

Release source · Runtime guarantees · Capability guides

from cayu.environments import DEFAULT_WORKSPACE_INSTRUCTIONS_MAX_BYTES
DEFAULT_WORKSPACE_INSTRUCTIONS_MAX_BYTES = 32 * 1024

Release source · Runtime guarantees · Capability guides

from cayu.environments import Environment

Execution context an agent session can use.

The environment is intentionally thin for now. Concrete local, Docker, hosted, or customer-hosted environments can bind workspace, runner, vault, and MCP services without making those details part of AgentSpec.

Environment.__init__(spec: EnvironmentSpec, *, workspace: Workspace | None=None, artifact_store: ArtifactStore | None=None, runner: Runner | None=None, vault: Vault | None=None, proxy: CredentialProxy | None=None, knowledge_store: KnowledgeStore | None=None, knowledge_access_scope: KnowledgeAccessScope | None=None, binding: WorkspaceBinding | None=None, mcp_servers: Iterable[McpServerSpec] | None=None, workspace_instructions: WorkspaceInstructionsInput | None=None) -> None
Environment.knowledge_store() -> KnowledgeStore | None

Return the registration-time knowledge store binding.

The binding is intentionally read-only. Runtime execution profiles and isolated intervention admission both authenticate this exact object; replacing it after admission would turn those checks into a check/use race.

Environment.knowledge_access_scope() -> KnowledgeAccessScope | None

Return a defensive copy of the registration-time access scope.

async Environment.resolve_secret(ref: SecretRef, *, scope: dict[str, Any] | None=None) -> ResolvedSecret

Resolve a secret ref through the environment vault.

Release source · Runtime guarantees · Capability guides

from cayu.environments import EnvironmentSpec

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
name str required
metadata dict[str, Any] Field(default_factory=dict)
execution_profile_identity ExecutionProfileBehaviorIdentity | None None
lifecycle_policy EnvironmentLifecyclePolicy | None None
workspace_checkpoint_policy WorkspaceCheckpointPolicy | None None
EnvironmentSpec.copy_workspace_checkpoint_policy(value: object) -> WorkspaceCheckpointPolicy | None
EnvironmentSpec.copy_lifecycle_policy(value: object) -> EnvironmentLifecyclePolicy | None
EnvironmentSpec.copy_metadata(value: dict[str, Any]) -> dict[str, Any]
EnvironmentSpec.validate_nonblank_name(value: str, info) -> str

Release source · Runtime guarantees · Capability guides

from cayu.environments import load_workspace_instructions
async load_workspace_instructions(environment: Environment) -> WorkspaceInstructions | None

Release source · Runtime guarantees · Capability guides

from cayu.environments import WorkspaceInstructions

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
content str required
sources tuple[str, ...] ('explicit',)
WorkspaceInstructions.validate_content(value: str) -> str
WorkspaceInstructions.validate_sources(value) -> tuple[str, ...]

Release source · Runtime guarantees · Capability guides

from cayu.environments import WorkspaceInstructionsConfig

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
paths tuple[str, ...] DEFAULT_WORKSPACE_INSTRUCTION_PATHS
mode Literal['first_found', 'merge'] 'first_found'
max_bytes int DEFAULT_WORKSPACE_INSTRUCTIONS_MAX_BYTES
WorkspaceInstructionsConfig.validate_paths(value) -> tuple[str, ...]
WorkspaceInstructionsConfig.validate_max_bytes(value: int) -> int

Release source · Runtime guarantees · Capability guides