Repository navigation
Fix restricted tool contracts in Formal Spec Verifier and Delight - #76589
Conversation
Use scoped validation and finite help grants, bound formal-model checks behind a reviewed-source helper, and align memory paths and denial recovery guidance. Add operation-contract and process-double regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: 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.
|
|
✅ 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ 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.
|
There was a problem hiding this comment.
Reviewed PR head 49c43a8. Applicable contracts include Copilot SDK Driver Specification v1.0.2, Sections 3.4 and 4.2 (authentication-token isolation; raw tokens must not be exposed or logged), and the security architecture secret-leak/threat-detection obligations.
Blocking finding (also reported by the existing security bot comment): .github/scripts/formal_spec_check.cjs:102 invokes pinned runtimes with spawnSync without an explicit sanitized env, while lines 97-99 persist complete stdout/stderr. The newly permitted model files are repository-controlled and therefore can read inherited process variables or print them; the captured logs are then exposed as evidence. This defeats the intended secret-isolation boundary and can disclose COPILOT_CONNECTION_TOKEN or other ambient credentials. Pass a minimal explicit environment (preserving only required non-secret runtime variables) and redact/bound captured output before persisting it; add a regression asserting the child receives no ambient secrets and evidence cannot contain them. No specification synchronization is appropriate until this security behavior is corrected.
No generated files or implementation changes were made by this review. Coverage was limited to the prefetched PR diff, changed workflow contracts, applicable specifications, and existing review comments; tests were not run per static-review policy.
Generated by PR Specification Reviewer for #76589 · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again
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 functional blocking issue: the new nested formal-check evidence layout is not readable using the workflow's permitted top-level cat .../* command. The inline comment explains the failure and a fix direction. The specialist pass was unavailable because its file-read tool invocation was denied; this review therefore relies on independent static analysis of the pre-fetched diff.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /codebase-design, and /tdd. Requesting changes on correctness and test-coverage gaps in the new formal-spec helper and the Delight pre-agent step.
📋 Key Themes & Highlights
Key Themes
- Slug collision:
specs/a/b.mdandspecs/a-b.mdmap to the same model directory. - Stale budget lock:
budget.lockis not reclaimed after an abnormal exit, so later checks fail. - Pipefail abort:
set -euo pipefailplus an emptygrep | shufaborts the Delight pre-agent step. - Untested risks: no tests cover slug collisions or the child process environment.
- Pre-existing grants (not new in this PR): the formal lock still allows bare
shell(cat),shell(yq), andshell(head), which match arbitrary paths. The permission handler approvescat /proc/self/environandcat .envbecause it checks only the command prefix. This should be narrowed in a follow-up. - Repo-memory branch mismatch: the Delight prompt reads
repo-memory/default, which matches the mount id, butshared/repo-memory-standard.mdstill setsbranch-name: memory/delightand the prompt says not to use the branch name. Confirm the persisted branch is what the next run reads.
Positive Highlights
- ✅ The helper confines paths, records source SHA-256 hashes, and serializes runs under a shared budget.
- ✅ Lock grants now name the helper rather than wildcard
node/timeout. - ✅ The new tests follow the repo's ESM/vitest conventions.
Verification notes
- Checked the HEAD lock permissions with the real permission handler. The asserted rejects for
go version,git log, andpython3hold. vitestis not installed at the root, so I did not run the new tests. The PR body's "26 tests pass" is unverified here.- The PR body says the independent security-review gate was not completed. This review does not replace it.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
ok
There was a problem hiding this comment.
🟡 Changes recommended
Critical flaws allow formal checks to report success for invalid models, while unvalidated dependencies and an agent-modifiable allowlisted helper undermine confinement and execution safeguards.
9 open issues
Validate and hash all local dependencies · New Treat SANY semantic errors as validation failures · New Align Formal grant expectations with the corrected commands · New Protect the allowlisted helper from agent modifications · New Recover stale locks and account for interrupted checks · New Prevent TLC trace files from polluting the model directory · New Load findings and improvements from the files Step 7 produces · New Build or precollect the CLI before the agent runs · New Use Koka compile evidence instead of ungranted discovery probes · New
What changed in this PR
Updates gh-aw’s Formal Spec Verifier and Delight workflows to align permitted commands with their tasks and reduce repeated tool denials.
Changes:
- Replace ineffective command patterns with scoped validation grants, exact help commands, and first-denial recovery guidance.
- Add a SANY/TLC/Koka helper with pinned runtimes, process limits, a shared time budget, and evidence logging.
- Align Delight’s memory access with the restored directory, regenerate both locks, and add permission and helper regression fixtures.
| File | Description |
|---|---|
actions/setup/js/restricted_tool_workflows.test.cjs |
Adds permission, denial-recovery, and memory-contract checks. |
actions/setup/js/formal_spec_check.test.cjs |
Adds process-double coverage for helper validation, limits, and evidence. |
.github/workflows/delight.md |
Updates help-command grants, recovery guidance, and memory paths. |
.github/workflows/delight.lock.yml |
Regenerates Delight’s setup, permissions, and workflow hashes. |
.github/workflows/daily-formal-spec-verifier.md |
Updates Go grants and routes formal checks through the helper. |
.github/workflows/daily-formal-spec-verifier.lock.yml |
Regenerates Formal’s execution grants and workflow hashes. |
.github/scripts/formal_spec_check.cjs |
Implements bounded formal-check execution and evidence collection. |
Review effort: Max (auto)
Isolate child environments and persist bounded redacted evidence, reject colliding model slugs, provide safe lock diagnostics and exact evidence inspection, and handle empty Delight samples without hiding real failures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Regarding the code-quality completion notice: no code change is needed for the notice itself. The actionable evidence-access finding is addressed in its inline thread with a documented, tested per-file inspection path. |
|
Regarding the design-decision result: no code change is needed for this reported-no-action status. I have not treated it as proof of implementation completeness or authorization. |
|
Regarding the Ponytail result: no implementation change is requested by this status notice. Its reported-no-action outcome is not being used as a substitute for the focused regressions and repository validation. |
|
Regarding the skills-review completion notice: the actionable slug, lock, sampling and environment findings are addressed individually below. The compiled clone and push steps both use branch |
|
Regarding the specification-review completion notice: the substantive inherited-environment and raw-output finding is addressed in the security thread with explicit child isolation and bounded, sanitized evidence. No specification text was changed to conceal that defect. |
|
Regarding the test-quality completion notice: no code change is requested by the reported-no-action status. The new behavioral regressions cover the concrete review findings rather than treating this notice as evidence that coverage was complete. |
|
Regarding the saved comment-memory summary: its evidence-read concern duplicates the inline finding, which is addressed in that thread. No separate code change or edit to automation-owned comment memory is needed. |
Keep exact Go formatting and focused-test permission assertions for the Formal Copilot and Sergo Claude workflows after the Formal contract changed to argument-prefix syntax. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| xargs -a /tmp/gh-aw/agent/validation-sample.txt cat > /tmp/gh-aw/agent/validation-sample-content.txt 2>/dev/null || echo "(no validation sample found)" > /tmp/gh-aw/agent/validation-sample-content.txt | ||
| for sample in doc-samples workflow-samples validation-sample; do | ||
| while IFS= read -r file; do | ||
| cat "$file" |
| status = run("compile", koka, [`--builddir=${path.join(results, "build")}`, "-o", executable, model], 120000); | ||
| if (status === 0) { | ||
| confinedPath(results, "model"); | ||
| status = run("model", executable, [], 30000); |
Stage a checksum-verified read-only checker, reject unsupported model dependencies and execute hashed snapshots, classify SANY diagnostics, and conservatively recover interrupted budget ownership. Precollect Delight help and load the history files actually produced. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Regarding this repeated completion notice: no additional implementation change is requested. Its actionable evidence-access finding was answered and resolved in the earlier batch; the new Copilot findings are handled in their own threads. |
|
Regarding this repeated design-gate notice: no code change is needed for the reported-no-action status. It is not being treated as proof that the new review findings are satisfied. |
|
Regarding this repeated Ponytail notice: there is no new requested implementation change. Focused validation, rather than the no-action notification, determines whether this batch is ready. |
|
Regarding this repeated skills-review notice: the earlier concrete findings were answered individually. The newly identified interruption-accounting requirement is being handled separately from the earlier lock-diagnostic alternative. |
|
Regarding this repeated specification-review notice: the earlier inherited-environment/raw-output concern was fixed and regression-tested. No further code change is requested by this completion message itself. |
|
Regarding this repeated test-quality notice: no new code change is requested by the reported-no-action status. The new dependency, validation, interruption and prepared-input requirements have their own targeted regressions. |
|
Regarding this repeated comment-memory record: its evidence-read concern was already addressed in the corresponding inline thread. No separate implementation or automation-memory edit is needed. |
|
Confirmed for the earlier acknowledgement: exact native evidence-file inspection remains the intended contract. This acknowledgement itself introduces no additional implementation requirement. |
|
Confirmed for the earlier acknowledgement: no-action design status is not a validation or authorization result. No code change is needed for that statement. |
|
Confirmed for the earlier acknowledgement: the completion notice does not replace focused regressions or repository checks. There is no new implementation request in this comment. |
|
Confirmed for the earlier acknowledgement: branch |
|
Confirmed for the earlier acknowledgement: explicit child-environment isolation and bounded, redacted evidence remain in place. New dependency and helper-trust findings are separate requirements, not reasons to weaken those protections. |
|
Confirmed for the earlier acknowledgement: concrete behavioral regressions are required, not just successful automation notifications. No additional code change follows from this acknowledgement itself. |
|
Confirmed for the earlier acknowledgement: the saved memory duplicates an already-addressed evidence-access comment. No further code change or edit to automation-owned memory is needed. |
| GH_AW_COPILOT_SDK_DRIVER: 1 | ||
| GH_AW_COPILOT_SDK_SERVER_ARGS: '["--headless","--no-auto-update","--port","3002","--add-dir","/tmp/gh-aw/","--log-level","all","--log-dir","/tmp/gh-aw/sandbox/agent/logs/","--disable-builtin-mcps","--no-ask-user","--allow-tool","github","--allow-tool","safeoutputs","--allow-tool","shell(./gh-aw * --help)","--allow-tool","shell(./gh-aw --help)","--allow-tool","shell(awk)","--allow-tool","shell(cat .github/workflows/*.md)","--allow-tool","shell(cat /tmp/gh-aw/agent/*)","--allow-tool","shell(cat docs/src/content/docs/*.md)","--allow-tool","shell(cat docs/src/content/docs/*.mdx)","--allow-tool","shell(cat pkg/*/*.go)","--allow-tool","shell(cat)","--allow-tool","shell(date)","--allow-tool","shell(echo)","--allow-tool","shell(find .github/workflows -name \"*.md\")","--allow-tool","shell(find docs/src/content/docs -name \"*.md\" -o -name \"*.mdx\")","--allow-tool","shell(gh:*)","--allow-tool","shell(grep)","--allow-tool","shell(head)","--allow-tool","shell(ls)","--allow-tool","shell(printf)","--allow-tool","shell(pwd)","--allow-tool","shell(safeoutputs:*)","--allow-tool","shell(sed)","--allow-tool","shell(shuf)","--allow-tool","shell(sort)","--allow-tool","shell(tail)","--allow-tool","shell(uniq)","--allow-tool","shell(wc)","--allow-tool","shell(yq)","--allow-tool","write","--deny-tool","workflow","--allow-all-paths"]' | ||
| GH_AW_COPILOT_SDK_TOOL_CONFIG: '{"version":1,"capabilities":{"bash":true,"edit":true,"webFetch":false,"webSearch":false,"dynamicWorkflows":false,"mcp":true,"cliProxy":true},"permissions":{"allowedTools":["github","read","safeoutputs","shell(./gh-aw * --help)","shell(./gh-aw --help)","shell(awk)","shell(cat .github/workflows/*.md)","shell(cat /tmp/gh-aw/agent/*)","shell(cat docs/src/content/docs/*.md)","shell(cat docs/src/content/docs/*.mdx)","shell(cat pkg/*/*.go)","shell(cat)","shell(date)","shell(echo)","shell(find .github/workflows -name \"*.md\")","shell(find docs/src/content/docs -name \"*.md\" -o -name \"*.mdx\")","shell(gh:*)","shell(grep)","shell(head)","shell(ls)","shell(printf)","shell(pwd)","shell(safeoutputs:*)","shell(sed)","shell(shuf)","shell(sort)","shell(tail)","shell(uniq)","shell(wc)","shell(yq)","write"]}}' | ||
| GH_AW_COPILOT_SDK_SERVER_ARGS: '["--headless","--no-auto-update","--port","3002","--add-dir","/tmp/gh-aw/","--log-level","all","--log-dir","/tmp/gh-aw/sandbox/agent/logs/","--disable-builtin-mcps","--no-ask-user","--allow-tool","github","--allow-tool","safeoutputs","--allow-tool","shell(awk)","--allow-tool","shell(cat .github/workflows/*.md)","--allow-tool","shell(cat /tmp/gh-aw/agent/*)","--allow-tool","shell(cat /tmp/gh-aw/agent/help-output/*)","--allow-tool","shell(cat docs/src/content/docs/*.md)","--allow-tool","shell(cat docs/src/content/docs/*.mdx)","--allow-tool","shell(cat pkg/*/*.go)","--allow-tool","shell(cat)","--allow-tool","shell(date)","--allow-tool","shell(echo)","--allow-tool","shell(find .github/workflows -name \"*.md\")","--allow-tool","shell(find docs/src/content/docs -name \"*.md\" -o -name \"*.mdx\")","--allow-tool","shell(gh:*)","--allow-tool","shell(grep)","--allow-tool","shell(head)","--allow-tool","shell(ls)","--allow-tool","shell(printf)","--allow-tool","shell(pwd)","--allow-tool","shell(safeoutputs:*)","--allow-tool","shell(sed)","--allow-tool","shell(shuf)","--allow-tool","shell(sort)","--allow-tool","shell(tail)","--allow-tool","shell(uniq)","--allow-tool","shell(wc)","--allow-tool","shell(yq)","--allow-tool","write","--deny-tool","workflow","--allow-all-paths"]' |
|
🎉 This pull request is included in a new release. Release: |



Why
Formal Spec Verifier and Delight exhausted their three-denial budgets in runs 42844018496 and 42836767636. Each rejected call contained an ungranted operation; compound syntax alone was not the cause, and these were not GitHub authentication failures. Required command patterns also compiled to strings the SDK callback matched exactly rather than as the intended prefixes/wildcards.
Approach
go test:*andgofmt -w:*contracts and finite exact Delight help commands without changing global SDK matching.evidence.json, including sanitized errors; do not persist raw output logs.No blanket shell, Go, Git, Python, directory-change or workflow grant is added. Credentials, firewall configuration, safe-output limits and denial thresholds are unchanged. Existing models with unsupported layouts or flags are reported incompatible rather than executed through an unrestricted wrapper. Environment cleanup and known-value redaction do not replace filesystem isolation or sanitize arbitrary sensitive file contents.
Validation
make agent-report-progresspassed: typecheck, changed-file lint, impacted tests and workflow drift across all 365 workflows.make recompilepassed; existing repository compiler warnings remain.Review and execution limits
The feedback batch in commit
161788dcbe8received a hash-bound independent security review of all eight changed files, generated lock deltas and required unchanged enforcement: PASS; no confirmed vulnerabilities found. This is a new review-comment batch and does not retroactively label the initially unavailable pre-PR follow-up as completed.Diagnostic dry-run coverage remains incomplete: Formal emitted a diagnostic lock but failed its gate on an existing imported-installer command warning; Delight's pre-agent steps are rejected by dry-run policy. These restrictions were not bypassed. No workflow dispatch or rerun was performed.