a2a docsreferenceruntime

a2a_pack.runtime

Declarative runtime/deployment metadata.

These types describe how the platform should run an agent: lifecycle, state needs, isolation level, resource budget, egress policy. They are read by the deployer and by the registry; agent code itself should not depend on which runtime is selected.

AgentRuntime (class)

AgentRuntime(*, lifecycle: a2a_pack.runtime.Lifecycle = <Lifecycle.EPHEMERAL: 'ephemeral'>, state: a2a_pack.runtime.State = <State.NONE: 'none'>, sandbox: a2a_pack.runtime.Sandbox = <Sandbox.MICROSANDBOX: 'microsandbox'>, resources: a2a_pack.runtime.Resources = <factory>, concurrency: typing.Annotated[int, Gt(gt=0)] = 1, egress: a2a_pack.runtime.EgressPolicy = <factory>, tools_used: tuple[str, ...] = ()) -> None

Aggregate runtime declaration; published on the Agent Card.

EgressPolicy (class)

EgressPolicy(*, allow_hosts: tuple[str, ...] = (), allow_internal_services: tuple[str, ...] = (), deny_internet_by_default: bool = True) -> None

What external hosts the agent is allowed to talk to.

Lifecycle (class)

Lifecycle(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

How long an instance of the agent process lives.

Resources (class)

Resources(*, cpu: str = '100m', memory: str = '256Mi', gpu: typing.Annotated[int, Ge(ge=0)] = 0, max_runtime_seconds: typing.Annotated[int, Gt(gt=0)] = 600) -> None

Resource budget hint for the deployer.

Sandbox (class)

Sandbox(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Isolation level. The platform always runs agents under microsandbox.

Modeled as an enum (rather than a constant) so the wire format stays stable if more isolation tiers are added later, but only one value is currently valid: every agent runs in a microvm-class sandbox.

SkillPolicy (class)

SkillPolicy(*, timeout_seconds: float | None = None, idempotent: bool = False, max_retries: typing.Annotated[int, Ge(ge=0)] = 0, cost_class: str | None = None, allow_scope_expansion: bool = False) -> None

Per-skill operational policy advertised on the Agent Card.

State (class)

State(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

What kind of state the agent retains between invocations.

Source: apps/a2a/a2a_pack/runtime.py