Repository navigation
Preserve Copilot durable checkpoints through secret redaction - #78855
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ PR Specification Reviewer completed successfully!
|
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: 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.
|
|
@copilot enable durable on one copilot agentic workflow |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: 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.
|
|
@copilot enable a agentic workflow with durable for copilot / codex / Claude (one of each) |
There was a problem hiding this comment.
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
| 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)])); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Comment MemoryPeek at saved memory (spec-review-history)History |
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
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
| if (redactDurableCopilot) { | ||
| try { | ||
| const { redactCopilotCheckpoint } = require("./durable_files.cjs"); | ||
| redactCopilotCheckpoint(text => redactArtifactContent(text, secretValues, maskedValues).content); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
In c486147, the general pass skips transcript blobs already redacted and rehashed; an end-to-end main() regression verifies the checkpoint remains valid.
There was a problem hiding this comment.
The static dependency is covered by the setup deployment lists; durable_files.cjs is included for both MCP scripts and safe outputs in 2170337.
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
Checkpoint integration omits required deployment dependencies and emits undefined step references, causing dependency checks and workflow validation to fail.
5 open issues
Include durable_files.cjs in deployment dependency lists · New Restrict checkpoint wiring to jobs with the staging step · New Limit protected-value checks to known Copilot metadata paths · New Exclude GH_AW_SECRET_NAMES from credential-value checks · New Warn on checkpoint rejection instead of failing shared redaction · New
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"); |
There was a problem hiding this comment.
The setup deployment lists include durable_files.cjs; the transitive dependency tests pass. Fixed in 7a2c394.
There was a problem hiding this comment.
durable_files.cjs is included in both deployment arrays in 2170337, so the redaction module’s static dependency is available in both destinations.
| yaml.WriteString(" await main({ prepareForCustomMasking: true });\n") | ||
| options = append(options, "prepareForCustomMasking: true") | ||
| } | ||
| durableCopilot := data.durableExecutionPlan != nil && data.EngineConfig != nil && data.EngineConfig.ID == "copilot" |
There was a problem hiding this comment.
Checkpoint wiring is limited to the job that stages durable files in 7a2c394.
There was a problem hiding this comment.
Checkpoint redaction is gated on staged durable Copilot files, avoiding stage-step references in shared safe-output and work-queue jobs. Fixed in 7a2c394.
| 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)])); |
There was a problem hiding this comment.
The structure check now protects known top-level metadata without freezing nested tool payload keys; the nested credential regression passes. Fixed in 7a2c394.
There was a problem hiding this comment.
The structure check preserves known top-level Copilot metadata while allowing redaction inside nested tool payloads. Fixed in 7a2c394; the nested credential regression passes.
| if (!entry.bytes.equals(Buffer.from(text)) || !isDeepStrictEqual(copilotEventStructure(text), copilotEventStructure(sanitized))) { | ||
| throw new Error("Cannot safely redact durable Copilot session events"); | ||
| } | ||
| assertNoSecrets(sanitized); |
There was a problem hiding this comment.
GH_AW_SECRET_NAMES is excluded from credential-value checks, with regression coverage. Fixed in 7a2c394.
There was a problem hiding this comment.
GH_AW_SECRET_NAMES is excluded from credential-value checks while actual credential values remain checked. Fixed in 7a2c394; regression tests pass.
| } catch { | ||
| core.setFailed(`${ERR_VALIDATION}: Could not safely sanitize the durable Copilot checkpoint`); | ||
| } |
There was a problem hiding this comment.
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]>
| 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))) { |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Enabled durable sessions in the Copilot smoke workflow in 2170337.
Enabled durable sessions in the Copilot, Codex, and Claude smoke workflows in 2170337. |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
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"
}
|
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]>
Merged latest
Merged latest |
|
@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]>
Merged
Resolved and merged |


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.