Skip to content

Python: [Generated by SRE Agent] docs: clarify checkpoint storage security model and deserialization trust boundaries#6295

Open
chetantoshniwal wants to merge 2 commits into
mainfrom
docs/checkpoint-storage-security-model
Open

Python: [Generated by SRE Agent] docs: clarify checkpoint storage security model and deserialization trust boundaries#6295
chetantoshniwal wants to merge 2 commits into
mainfrom
docs/checkpoint-storage-security-model

Conversation

@chetantoshniwal
Copy link
Copy Markdown
Contributor

@chetantoshniwal chetantoshniwal commented Jun 3, 2026

Summary

Adds documentation sections to the checkpoint encoding and Azure Functions serialization modules, clarifying the trust model for checkpoint storage backends.

Changes

  • _checkpoint_encoding.py: Added a "Security Model" section to the module docstring documenting:

    • Checkpoint storage is a trusted data source requiring proper access controls
    • The RestrictedUnpickler allowlist is defense-in-depth, not a security boundary
    • Developer responsibilities for securing storage backends
    • Guidance on using allowed_types and strip_pickle_markers
  • _serialization.py (azurefunctions): Added a "Security Model" section explaining:

    • Azure Durable Functions storage account trust requirements
    • RBAC / shared-access policy guidance
    • Cross-reference to the core encoding security documentation

Motivation

Improve developer guidance around the security model for checkpoint serialization so that integrators understand the trust boundaries and their responsibilities when configuring storage backends.

…rust boundaries

Add Security Model documentation sections to the checkpoint encoding and
Azure Functions serialization modules explaining:
- Checkpoint storage is a trusted data source requiring access controls
- The RestrictedUnpickler allowlist is defense-in-depth, not a security boundary
- Developer responsibilities for securing storage backends
- Guidance on using allowed_types and strip_pickle_markers

Co-authored-by: Azure SRE Agent <noreply@microsoft.com>
Copilot AI review requested due to automatic review settings June 3, 2026 01:15
@chetantoshniwal chetantoshniwal requested a review from a team as a code owner June 3, 2026 01:15
@moonbox3 moonbox3 added the python label Jun 3, 2026
@chetantoshniwal chetantoshniwal changed the title [Generated by SRE Agent] docs: clarify checkpoint storage security model and deserialization trust boundaries docs: clarify checkpoint storage security model and deserialization trust boundaries Jun 3, 2026
@github-actions github-actions Bot changed the title docs: clarify checkpoint storage security model and deserialization trust boundaries Python: [Generated by SRE Agent] docs: clarify checkpoint storage security model and deserialization trust boundaries Jun 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds explicit Security Model documentation to Python checkpoint encoding and Azure Functions serialization utilities, clarifying the trust boundary around checkpoint storage and the limits of the restricted unpickler approach.

Changes:

  • Documented that checkpoint storage must be treated as a trusted data source and that restricted unpickling is defense-in-depth rather than a hard security boundary.
  • Added guidance on storage access controls and on using type restrictions (allowed_types / storage configuration) to reduce deserialization attack surface.
  • Added Azure Functions–specific notes about Durable Functions storage trust assumptions and marker stripping for untrusted inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py Adds a Security Model section describing trust assumptions and responsibilities for checkpoint decode.
python/packages/azurefunctions/agent_framework_azurefunctions/_serialization.py Adds a Security Model section for Durable Functions storage and references core checkpoint encoding guidance.

Comment thread python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py Outdated
Comment thread python/packages/azurefunctions/agent_framework_azurefunctions/_serialization.py Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _serialization.py551081%65–71, 190–192
packages/core/agent_framework/_workflows
   _checkpoint_encoding.py640100% 
TOTAL37787442088% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
7510 34 💤 0 ❌ 0 🔥 1m 55s ⏱️

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 4 | Confidence: 94%

✓ Correctness

This is a documentation-only PR adding Security Model sections to two module docstrings. All claims in the documentation are accurate: _RestrictedUnpickler exists with an allowlist mechanism, getattr is indeed in the allowlist for enum reconstruction, strip_pickle_markers exists and works as described, allowed_types is a parameter on decode_checkpoint_value, and all cross-references point to correct module/function paths. No correctness issues found.

✓ Security Reliability

This is a documentation-only PR adding security model sections to two module docstrings. The documented claims are accurate: RestrictedUnpickler exists with the described allowlist behavior, strip_pickle_markers correctly neutralizes pickle marker injection, and allowed_types is a real parameter. The guidance is sound and consistent with the implementation. No security or reliability issues introduced.

✓ Test Coverage

This is a documentation-only PR that adds Security Model sections to two module docstrings. No code behavior is changed, so no new tests are needed. All referenced functions (RestrictedUnpickler, strip_pickle_markers, allowed_types, decode_checkpoint_value, deserialize_value) exist and already have comprehensive test coverage, including dedicated security tests in test_checkpoint_unrestricted_pickle.py that verify the restricted unpickler blocks arbitrary callables, reduce payloads, and code execution while allowing listed types.

✓ Design Approach

The new security-model documentation is mostly aligned with the existing deserialization trust boundary, but the Azure Functions module introduces one actionable documentation bug: it tells readers to configure allowed_types on checkpoint storage even though this package’s wrapper does not expose that parameter and the storage-facing API elsewhere in the repo uses allowed_checkpoint_types instead.


Automated review by chetantoshniwal's agents

Comment thread python/packages/azurefunctions/agent_framework_azurefunctions/_serialization.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants