Skip to content

Python: Harden Python checkpoint persistence defaults #4894

@moonbox3

Description

@moonbox3

Persisted checkpoint handling in the Python SDK should be hardened so the default experience is more restrictive and safer by default.

Today, checkpoint persistence is optimized for broad object round-tripping and ease of use. Before GA, we should tighten the default behavior for persisted checkpoints and reduce the default type surface area that can be restored.

Proposed direction:

  • Narrow the default set of types that round-trip from persisted checkpoints.
  • Include a small built-in set of framework-approved types by default, such as primitives and other common value types.
  • Add an explicit allow-list for additional checkpoint-safe types.
  • Update docs, tests, and samples to reflect the safer default posture.

Example API shapes we could evaluate:

storage = FileCheckpointStorage("/tmp/checkpoints")
storage = FileCheckpointStorage(
    "/tmp/checkpoints",
    allowed_checkpoint_types=[
        "my_app.models.SafeState",
    ],
)

Built-in supported types could include framework-approved value types such as primitives plus selected common types like datetime.datetime and uuid.UUID.

Acceptance criteria:

  • Default persisted checkpoint loading is more restrictive than it is today.
  • Common framework-owned checkpoint scenarios continue to work without extra user configuration.
  • Developers have a documented extension point for additional supported types.
  • Docs and samples reflect the updated default guidance.

Open questions:

  • What is the minimum built-in type surface area needed to support common workflow scenarios?
  • What upgrade guidance do we want for existing persisted checkpoints?

Metadata

Metadata

Assignees

Labels

pythonworkflowsRelated to Workflows in agent-framework

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions