Skip to content

Preserve Copilot durable checkpoints through secret redaction - #78855

Merged
pelikhan merged 13 commits into
mainfrom
copilot/fix-checkpoint-validation-issue
Nov 19, 2026
Merged

pelikhan merged 13 commits into
mainfrom
copilot/fix-checkpoint-validation-issue

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

On the first durable Copilot run, secret redaction can change the staged transcript after its hashes are recorded. Validation then rejects the artifact as “damaged or redacted,” leaving no checkpoint for the next run to resume.

  • Transcript redaction: Mask credentials in Copilot event payloads while preserving the session ID, event metadata, and JSONL structure.
  • Checkpoint integrity: Verify the staged hashes before redaction and update only the hashes for transcript changes made by the host redactor. Unexpected changes or redaction that would alter event structure still block upload.
  • Workflow wiring: Run this path only for staged Copilot durable checkpoints. Upload still requires successful secret redaction and checkpoint validation.

@pelikhan pelikhan changed the title [WIP] Fix durable mode checkpoint validation failure on first Copilot run Preserve Copilot durable checkpoints through secret redaction Nov 17, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 00:16
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 00:16
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #78855 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #78855 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~9 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot enable durable on one copilot agentic workflow

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot enable a agentic workflow with durable for copilot / codex / Claude (one of each)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

Reviewed PR head cc98e35c21b26a3354a04d54fc4749f2bf2c2521 against T-UAS-060 (Unified Agent Session Specification 2.11.0).

Finding

The new Copilot checkpoint structure check explicitly exempts native IDs and *Id fields from redaction. This violates T-UAS-060, which requires decoded credential redaction including native IDs and nested payloads, and can publish secrets embedded in identifiers. Please revise the invariant and test so only required identity/structure guarantees remain while all persisted string values are redacted.

Static review only; tests were not run.

Generated by PR Specification Reviewer for #78855 · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review-specs to run again

Comment thread actions/setup/js/durable_files.cjs Outdated
if (typeof value === "string") return null;
if (Array.isArray(value)) return value.map(eventPayloadShape);
if (value && typeof value === "object") {
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, /^(?:id|type|role|toolName)$|Id$/.test(key) ? child : eventPayloadShape(child)]));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

T-UAS-060 in docs/src/content/docs/specs/unified-agent-session-specification.md requires persisted native events to redact decoded string values, explicitly including native IDs and nested structured payloads. This predicate exempts id, type, role, toolName, and every *Id value from eventPayloadShape, so a secret appearing in (for example) sessionId or another native identifier remains in the uploaded checkpoint; the accompanying test also treats redacting the session ID as unsafe. Please preserve only the required event/session identity invariants while still redacting credential values in all persisted string fields, and update the structure check/test accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The checkpoint now fails closed if a credential would change protected session or event metadata, so that value is not published; other payload strings can be redacted. See 7a2c394 and c486147.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Safe-delta validation permits only recognized secret-mask replacements and rejects arbitrary transcript rewrites. The implementation and regression coverage are in 7a2c394; the durable checkpoint tests pass.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-2a098bd4-2b53-49c2-aeab-99e516399533","parents":[],"payload":{"id":"ldg-40184538-0928-4fed-95a8-cc59222f35c2","operation":"append","value":{"finding_count":1,"head_sha":"cc98e35c21b26a3354a04d54fc4749f2bf2c2521","outcome":"regression"}},"sha":"sha256:2c5f48ecbb326aadae9681f69e42fdd59d43fd4616eaeb07db825db0afbf0007","timestamp":"2026-11-18T00:23:36.722Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-18T00:20:24Z
review_event: REQUEST_CHANGES
top_themes:
  - durable checkpoint hash invalidation after general artifact redaction
files_reviewed:
  - actions/setup/js/durable_files.cjs
  - actions/setup/js/redact_secrets.cjs
  - pkg/workflow/engine_durable_artifacts.go
  - pkg/workflow/redact_secrets.go
comment_count: 1
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~9 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one blocking correctness issue: the durable checkpoint is rehashed before the general artifact redaction pass, but the bundle is under the scanned /tmp/gh-aw/agent tree. A later pass can modify the blob without updating the manifest, causing validation to reject the checkpoint. Static review only; tests were not run per review instructions.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~9 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again

Comment thread actions/setup/js/redact_secrets.cjs Outdated
if (redactDurableCopilot) {
try {
const { redactCopilotCheckpoint } = require("./durable_files.cjs");
redactCopilotCheckpoint(text => redactArtifactContent(text, secretValues, maskedValues).content);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The durable bundle is created under /tmp/gh-aw/agent, which is one of the roots scanned by findFiles() immediately before this call, and its .json blobs therefore remain in files. After this checkpoint-specific rewrite updates the manifest hash, the later processFile(file, ...) pass can redact those same blobs again (including JSONL structured-redaction paths), leaving the manifest hash stale and causing validation to reject the checkpoint. Exclude the durable bundle from the general artifact pass or ensure it cannot be modified after rehashing; add an end-to-end test through main() for this ordering.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In c486147, the general pass skips transcript blobs already redacted and rehashed; an end-to-end main() regression verifies the checkpoint remains valid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The static dependency is covered by the setup deployment lists; durable_files.cjs is included for both MCP scripts and safe outputs in 2170337.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-8a7e58c8-b2f8-44b0-a851-b73003de35b7","parents":[],"payload":{"id":"ldg-61f1b111-2be9-4c12-a23f-0be66a857104","operation":"append","value":{"finding_count":1,"head_sha":"cc98e35c21b26a3354a04d54fc4749f2bf2c2521","outcome":"findings"}},"sha":"sha256:8279b3ad11ea2edc9efdfe624f75f462e63bdc4bc0bf3a36eee0d9a67bf473d9","timestamp":"2026-11-18T00:32:06.581Z","type":"ledger_append","version":1}
History

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Checkpoint integration omits required deployment dependencies and emits undefined step references, causing dependency checks and workflow validation to fail.

5 open issues
What changed in this PR

This PR updates gh-aw’s durable Copilot checkpoint pipeline to preserve resumable sessions through secret redaction while retaining integrity checks.

Changes:

  • Add structure-aware transcript redaction with staged-hash verification and selective hash updates.
  • Wire checkpoint sanitization into the secret-redaction step for durable Copilot runs.
  • Add regression coverage and document checkpoint publication safeguards.
File Description
pkg/​workflow/​redact_secrets.go Adds durable Copilot options to generated redaction steps.
pkg/​workflow/​engine_durable_test.go Checks generated environment, step ordering, and validation gates.
pkg/​workflow/​engine_durable_artifacts.go Emits checkpoint configuration for redaction.
docs/​src/​content/​docs/​reference/​engines.md Documents transcript redaction and checkpoint rejection conditions.
actions/​setup/​js/​redact_secrets.cjs Invokes checkpoint sanitization before general artifact redaction.
actions/​setup/​js/​durable_files.test.cjs Covers redacted-session restoration, tampering, and identity protection.
actions/​setup/​js/​durable_files.cjs Validates event structure and updates hashes after trusted transcript redaction.

Review effort: Max (adaptive)

const maskedValues = [...masks].sort((a, b) => b.length - a.length);
if (redactDurableCopilot) {
try {
const { redactCopilotCheckpoint } = require("./durable_files.cjs");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The setup deployment lists include durable_files.cjs; the transitive dependency tests pass. Fixed in 7a2c394.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

durable_files.cjs is included in both deployment arrays in 2170337, so the redaction module’s static dependency is available in both destinations.

Comment thread pkg/workflow/redact_secrets.go Outdated
yaml.WriteString(" await main({ prepareForCustomMasking: true });\n")
options = append(options, "prepareForCustomMasking: true")
}
durableCopilot := data.durableExecutionPlan != nil && data.EngineConfig != nil && data.EngineConfig.ID == "copilot"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checkpoint wiring is limited to the job that stages durable files in 7a2c394.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checkpoint redaction is gated on staged durable Copilot files, avoiding stage-step references in shared safe-output and work-queue jobs. Fixed in 7a2c394.

Comment thread actions/setup/js/durable_files.cjs Outdated
if (typeof value === "string") return null;
if (Array.isArray(value)) return value.map(eventPayloadShape);
if (value && typeof value === "object") {
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, /^(?:id|type|role|toolName)$|Id$/.test(key) ? child : eventPayloadShape(child)]));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The structure check now protects known top-level metadata without freezing nested tool payload keys; the nested credential regression passes. Fixed in 7a2c394.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The structure check preserves known top-level Copilot metadata while allowing redaction inside nested tool payloads. Fixed in 7a2c394; the nested credential regression passes.

Comment thread actions/setup/js/durable_files.cjs Outdated
if (!entry.bytes.equals(Buffer.from(text)) || !isDeepStrictEqual(copilotEventStructure(text), copilotEventStructure(sanitized))) {
throw new Error("Cannot safely redact durable Copilot session events");
}
assertNoSecrets(sanitized);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GH_AW_SECRET_NAMES is excluded from credential-value checks, with regression coverage. Fixed in 7a2c394.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GH_AW_SECRET_NAMES is excluded from credential-value checks while actual credential values remain checked. Fixed in 7a2c394; regression tests pass.

Comment on lines +770 to +772
} catch {
core.setFailed(`${ERR_VALIDATION}: Could not safely sanitize the durable Copilot checkpoint`);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checkpoint rejection now invalidates the checkpoint and warns without failing shared redaction. Fixed in 7a2c394; c486147 covers rejection during the general file pass.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checkpoint-only rejection now invalidates the checkpoint and warns without failing shared redaction. Fixed in c486147; regression tests pass.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Comment thread actions/setup/js/durable_files.cjs Outdated
const text = entry.bytes.toString("utf8");
const sanitized = redact(text);
if (text === sanitized) continue;
if (!entry.bytes.equals(Buffer.from(text)) || !isDeepStrictEqual(copilotEventStructure(text), copilotEventStructure(sanitized))) {

Copilot AI commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@copilot enable durable on one copilot agentic workflow

Enabled durable sessions in the Copilot smoke workflow in 2170337.

@copilot enable a agentic workflow with durable for copilot / codex / Claude (one of each)

Enabled durable sessions in the Copilot, Codex, and Claude smoke workflows in 2170337.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check Unit tests (N-R) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "73d264833600ced6a95467ad16ddabe104a8ede4",
  "kind": "requested",
  "schema_version": "1",
  "state": "7163b3f77edc20d302683cb4a7b1a11d90bb537299c5cc3f075c9286e51e776c",
  "work": [
    "e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 19, 2026 00:17
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…t-validation-issue

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged latest main in 930f877 and fixed the rollout framing failures in 5970574. Focused Go and setup-JS tests, standard Go lint, and secret scanning passed. The full compile gate hit npm-registry DNS failures; CodeQL timed out and was not retried.

@copilot merge main, fix ci failures

Merged latest main in 930f877 and fixed the rollout framing failures in 5970574. Focused Go and setup-JS tests, standard Go lint, and secret scanning passed. The full compile gate hit npm-registry DNS failures; CodeQL timed out and was not retried.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

…t-validation-issue

# Conflicts:
#	pkg/cli/org_rollout.go

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

[!WARNING]
Threat detection engine error
...

Merged main in 8e0cb31; the rollout regression tests pass with the existing fix in 5970574. The final validation gate timed out.

@copilot resolve the merge conflicts in this pull request

Resolved and merged main in 8e0cb31. Focused rollout tests passed; the final validation gate timed out.

@pelikhan
pelikhan merged commit 57db981 into main Nov 19, 2026
121 checks passed
@pelikhan
pelikhan deleted the copilot/fix-checkpoint-validation-issue branch November 19, 2026 13:56
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.

Durable mode: checkpoint validation fails with 'damaged or redacted' on first Copilot run

5 participants