Python SDK

Fleet SDK

Deploy exact applications, run supervised physical research, and roll back safely

Fleet owns physical authority: target readiness, deployment, task leases, supervision, research, and rollback. Missing readiness or supervision is a refusal, never permission to choose another controller.

Prefer the integrated deployment program

async with sx.connect(project_id) as client:
    deployment_operation = await client.deploy(manifest)
    print(deployment_operation.ref)
    deployment = await deployment_operation

This is the shortest safe path because one program carries the manifest through build, evaluation, whole-application qualification, capability approval, and rollout.

Deploy from precomputed evidence

When you own a custom promotion controller, pass the exact values from the earlier gates:

operation = await client.fleet.deploy(
    application,
    to=canary_group,
    qualification=qualification,
    approvals=(approval,),
)
deployment = await operation

The application, target group, qualification, and approvals must agree exactly. Fleet does not repair a mismatch inside the request.

Roll back

rollback = await client.fleet.rollback(deployment)
restored = await rollback

Rollback restores the previous healthy application and enabled capability set as a new durable operation. Keep its reference and terminal result just as you would for a rollout.

Run bounded physical research

from sx_fleet.research import RunBudget

operation = await client.fleet.research(
    deployment.deployment_ref,
    approval=approval,
    budget=RunBudget(max_episodes=20, max_duration_s=7_200),
)
run = await operation

The run cannot exceed its episode or duration bounds. The active deployment, capability approval, supervision policy, and executed task identity remain attached to its returned evidence.

Use the right surface

Use Python for promotion controllers, deployment automation, bounded research submission, health integrations, and rollback programs.

Fail-closed rules

RefusalWhat it protectsRecovery
target not readymotion from unknown hardware statecommission and calibrate the exact station
qualification mismatchan untested graph or targetqualify the complete application on that target
missing capability approvalwork outside proven task authorityproduce passing Worlds and qualification evidence
supervision unavailableunsupervised executionrestore the required rung; unanswered escalation safe-stops
stale or wrong deploymentacting on a different applicationresolve the exact current deployment before retrying

Humans own physical authority

Agents and automation may prepare, submit within prior bounds, and monitor. Hardware admission, motion authority, safety policy, and promotion stay with their accountable owner.