Broaden strict Copilot read allowlists for SPDD and Formal Spec workflows#40902
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix allowlists for Copilot workflows to prevent tool denials
Broaden strict Copilot read allowlists for SPDD and Formal Spec workflows
Jun 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates two strict Copilot-based spec-analysis workflows to reduce early failures from tool denials during routine read operations by widening the declared read surface (built-in file inspection + broader sed usage) and adding regression tests to keep those declarations stable.
Changes:
- Enable Copilot’s built-in file inspection path by adding
tools.edit: nulltodaily-spdd-spec-planneranddaily-formal-spec-verifier. - Broaden the restricted bash allowlist from
sed -ntosed *, and add prompt guidance emphasizing read-only usage. - Add prompt-surface regression tests ensuring both workflows keep declaring
edit: nullandsed *.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/prompts_test.go | Adds regression tests asserting edit: null and sed * are present for the two workflows. |
| .github/workflows/daily-spdd-spec-planner.md | Adds edit: null, widens sed allowlist, and adds read-only guidance text. |
| .github/workflows/daily-spdd-spec-planner.lock.yml | Regenerates compiled workflow to reflect updated tool allowlist (notably sed). |
| .github/workflows/daily-formal-spec-verifier.md | Adds edit: null, widens sed allowlist, and adds read-only guidance text. |
| .github/workflows/daily-formal-spec-verifier.lock.yml | Regenerates compiled workflow to reflect updated tool allowlist (notably sed). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 6
Comment on lines
+351
to
+370
| func TestDailyFormalSpecVerifierAllowsReadOnlyFileInspection(t *testing.T) { | ||
| repoRoot, err := findRepoRoot() | ||
| if err != nil { | ||
| t.Fatalf("Failed to find repo root: %v", err) | ||
| } | ||
|
|
||
| workflowFile := filepath.Join(repoRoot, ".github", "workflows", "daily-formal-spec-verifier.md") | ||
| content, err := os.ReadFile(workflowFile) | ||
| if err != nil { | ||
| t.Fatalf("Failed to read workflow file: %v", err) | ||
| } | ||
|
|
||
| workflow := string(content) | ||
| if !strings.Contains(workflow, "edit: null") { | ||
| t.Fatal("Expected daily-formal-spec-verifier workflow to enable built-in file inspection tools") | ||
| } | ||
| if !strings.Contains(workflow, `- "sed *"`) { | ||
| t.Fatal("Expected daily-formal-spec-verifier workflow to allow ranged sed reads") | ||
| } | ||
| } |
Comment on lines
+372
to
+391
| func TestDailySPDDSpecPlannerAllowsReadOnlyFileInspection(t *testing.T) { | ||
| repoRoot, err := findRepoRoot() | ||
| if err != nil { | ||
| t.Fatalf("Failed to find repo root: %v", err) | ||
| } | ||
|
|
||
| workflowFile := filepath.Join(repoRoot, ".github", "workflows", "daily-spdd-spec-planner.md") | ||
| content, err := os.ReadFile(workflowFile) | ||
| if err != nil { | ||
| t.Fatalf("Failed to read workflow file: %v", err) | ||
| } | ||
|
|
||
| workflow := string(content) | ||
| if !strings.Contains(workflow, "edit: null") { | ||
| t.Fatal("Expected daily-spdd-spec-planner workflow to enable built-in file inspection tools") | ||
| } | ||
| if !strings.Contains(workflow, `- "sed *"`) { | ||
| t.Fatal("Expected daily-spdd-spec-planner workflow to allow ranged sed reads") | ||
| } | ||
| } |
Comment on lines
39
to
+44
| - "find specs docs scratchpad -type f -name \"*.md\"" | ||
| - "cat specs/*.md" | ||
| - "cat docs/src/content/docs/reference/*specification*.md" | ||
| - "cat scratchpad/*specification*.md" | ||
| - "git log --oneline --since=\"14 days ago\" -- specs docs/src/content/docs/reference scratchpad" | ||
| - "sed -n" | ||
| - "sed *" |
Comment on lines
92
to
+94
|
|
||
| Use the allowed shell commands above or built-in file inspection tools only for read-only analysis. Do not modify repository files. | ||
|
|
Comment on lines
45
to
52
| bash: | ||
| - "find specs -type f -name \"*.md\" | sort" | ||
| - "cat specs/*.md" | ||
| - "find . -name \"*_test.go\" -path \"*/pkg/*\" | head -20" | ||
| - "cat pkg/workflow/*.go | head -200" | ||
| - "cat pkg/cli/*.go" | ||
| - "sed -n" | ||
| - "sed *" | ||
|
|
Comment on lines
125
to
+128
| Read the selected spec file in full with `bash`. | ||
|
|
||
| Use built-in file inspection tools only for read-only analysis when bash output is insufficient. Do not modify repository files. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two strict Copilot workflows were failing early after repeated tool denials on routine read-only operations (
sedline-range reads and built-in file inspection), exhausting the SDK denial threshold before producing any output. This change widens the allowed read surface for the affected spec-analysis workflows without changing their write behavior.Allow read-only file inspection
edit: nullin:daily-spdd-spec-plannerdaily-formal-spec-verifierread(...).Widen
sedallowlists from exact form to ranged readssed -nentry withsed *in both workflows.Keep the workflows read-oriented
Lock in the contract with focused tests
edit: nullsed *Example of the frontmatter change: