Skip to content

Migrate policy evaluation consumers to read from CAS instead of inline predicate #2950

Closed

Description

@migmartri

Context

In #2949 we introduced PolicyEvaluationBundle CAS storage: during attestation push, policy evaluations are serialized as a protobuf bundle, uploaded to CAS, and referenced from the attestation predicate via policyEvaluationsRef (a ResourceDescriptor with digest and media type). The inline policyEvaluations field in the predicate is now marked as deprecated.

Problem

Today, all consumers read policy evaluations from the inline policyEvaluations field embedded in the attestation predicate JSON stored in the database. This is the field we want to eventually remove to reduce attestation envelope bloat.

Key read path: WorkflowRunService.View() → bizAttestationToPb() → chainloop.ExtractPredicate() → predicate.GetPolicyEvaluations() → extractPolicyEvaluations().

Proposed approach

Update GetPolicyEvaluations() (or its callers) to:

  1. Check if policyEvaluationsRef exists in the predicate
  2. If yes, download the PolicyEvaluationBundle from CAS using the digest, deserialize, and return
  3. If no ref (older attestations), fall back to the inline policyEvaluations field

Once all consumers have migrated, the inline policyEvaluations field can be stripped or reduced from the predicate during rendering, completing the attestation size reduction.

Considerations

  • The control plane needs CAS download capabilities (already available via pkg/blobmanager/ Downloader interface)
  • CAS downloads add latency; caching should be considered for frequently accessed attestations
  • Backward compatibility with older attestations that only have inline data must be preserved

Activity

  1. added 4 commits that reference this issue on Mar 28, 2026
    7649a0c
    be91cda
    382dc2f
    ffc1981
  2. self-assigned this
    on Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions