Skip to content

fix(provenance): feature flagged, inexact sidecars - #6491

Merged
icecrasher321 merged 4 commits into
stagingfrom
staging-v31
Aug 10, 2026
Merged

fix(provenance): feature flagged, inexact sidecars#6491
icecrasher321 merged 4 commits into
stagingfrom
staging-v31

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Feature flag durable surface provenance to log and not fail.

Type of Change

  • Bug fix

Testing

N/A

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 10, 2026 4:18pm

Request Review

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Changes core secret projection, durable provenance import, and fail-closed execution paths; default posture is more permissive (warn and proceed), which can under-redact until surfaces are explicitly enforced.

Overview
Durable secret provenance no longer fails runs by default when sidecars are missing or incomplete. A new env var DURABLE_SECRET_PROVENANCE_ENFORCED_SURFACES (all or memory, table-row, knowledge) restores fail-closed behavior per surface; otherwise reads log at error and continue. importDurableSecretProvenance takes an optional surface so memory, knowledge, and table paths share that policy; malformed sidecars still latch the registry.

Table and memory reads change behavior: one unrecorded row in a page no longer voids the whole query_rows result when enforcement is off; agent memory treats stored unknown provenance the same way instead of refusing every later turn.

Secret matching and provenance treat true, false, and null as non-identifying literals—they are not substituted in model/table content and are not recorded into durable provenance (fixes mass boolean cell redaction when a flag variable held false). Numeric short secrets like 123 still project.

Provenance narrowing when a value cannot be fully scanned (large payloads, opaque refs, traversal limits) now over-approximates with all candidate entries instead of marking provenance incomplete and breaking downstream model boundaries.

Reviewed by Cursor Bugbot for commit d26394b. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes durable secret-provenance enforcement configurable per memory, table-row, and knowledge surface, defaulting unknown provenance to logging rather than execution failure. It also treats JSON boolean/null literals as non-identifying and preserves all candidate provenance when bounded value scanning cannot narrow the set.

  • Adds and documents DURABLE_SECRET_PROVENANCE_ENFORCED_SURFACES.
  • Applies surface-specific enforcement to memory, table-row, and knowledge reads.
  • Changes opaque or oversized provenance scans to conservatively retain candidate secrets.
  • Excludes true, false, and null from secret matching and durable provenance.
  • Updates tests for the new fail-open and matching behavior.

Confidence Score: 5/5

The PR appears safe to merge because the security trade-offs exposed by the new fail-open behavior are explicitly intentional, configurable, logged, and covered by targeted tests.

The reviewed paths consistently apply the new per-surface policy, retain fail-closed handling for malformed provenance, and test both enforcement modes and the revised matcher behavior; no unacknowledged actionable defect remains.

Important Files Changed

Filename Overview
apps/sim/lib/execution/durable-secret-provenance-enforcement.ts Introduces cached parsing and reporting for surface-specific durable provenance enforcement.
apps/sim/lib/execution/durable-secret-provenance.ts Makes unknown provenance fail open for explicitly named, unenforced durable surfaces while malformed sidecars remain fail closed.
apps/sim/lib/table/rows/secret-provenance.ts Skips and reports unrecorded rows when table enforcement is disabled instead of invalidating an entire result page.
apps/sim/lib/knowledge/secret-provenance.ts Routes knowledge provenance imports through the new surface-specific enforcement policy.
apps/sim/executor/handlers/agent/memory.ts Applies the memory enforcement policy to stored and per-message provenance imports.
apps/sim/executor/utils/resolved-secret-trace-registry.ts Excludes non-identifying literals and falls back to unnarrowed candidate provenance for values that cannot be fully scanned.
apps/sim/executor/utils/resolved-secret-match-policy.ts Defines exact lowercase JSON boolean/null renderings as non-identifying secret literals.
apps/sim/lib/core/config/env.ts Registers the new optional durable provenance enforcement environment variable.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read durable content] --> B{Provenance exact?}
  B -- Yes --> C[Import recorded entries]
  B -- No --> D{Surface enforced?}
  D -- Yes --> E[Mark registry incomplete and refuse]
  D -- No --> F[Log unrecorded provenance and continue]
  C --> G[Project content at model boundary]
  F --> G
  G --> H{Registry complete?}
  H -- No --> E
  H -- Yes --> I[Replace known secret matches]
Loading

Reviews (1): Last reviewed commit: "update test" | Re-trigger Greptile

@icecrasher321
icecrasher321 merged commit 156ee3e into staging Aug 10, 2026
30 checks passed
@icecrasher321
icecrasher321 deleted the staging-v31 branch August 10, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant