Skip to content

Add read-only GitHub Issues access to agent enclaves - #55531

Draft
lpcox wants to merge 13 commits into
mainfrom
lpcox-enclave-cli-handoff
Draft

Add read-only GitHub Issues access to agent enclaves#55531
lpcox wants to merge 13 commits into
mainfrom
lpcox-enclave-cli-handoff

Conversation

@lpcox

@lpcox lpcox commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the closed enclaves[].agent.github.cli: issues-read-v1 syntax to the user and AWF schemas
  • generate the immutable mcpg enclave policy with inherited GitHub integrity, exact dotted Issues operations, repository sensitivities, and a deterministic run-bound proxy identity
  • start and clean up a dedicated bridge-mode mcpg proxy, handing AWF only the container, identity, CA certificate, and capability root key
  • exclude trusted handoff values from the primary agent and clear the root key after AWF execution
  • require and default to the first released interoperable versions: AWF v0.28.8 and mcpg v0.4.11
  • refresh generated workflow pins to the published AWF and mcpg image digests
  • document supported REST routes, repository-scoped DIFC behavior, isolation guarantees, and released dependency minimums

Smoke-run fix

The gh-aw-firewall smoke run 32928731346 exposed an ordering bug: the compiler's eager Start MCP Gateway functionality check treated the AWF-owned awf-enclave backend like an already-running required server. mcpg correctly returned retryable HTTP 503 until AWF attached the late backend, but the eager check failed before AWF could launch.

This PR now classifies only the compiler-owned exact server name awf-enclave as deferred for that eager check when enclaves are enabled. It remains required in mcpg configuration, the authenticated route remains fail-closed, arbitrary/user-selected server names cannot be deferred, and every ordinary required server failure remains fatal. AWF still owns bounded initialize plus tools/list readiness after attachment.

Validation

  • go test ./pkg/workflow -run 'TestGenerateEnclaveGatewayContract|TestCompileEnclaveStartupOrdering' -count=1
  • Linux bash actions/setup/sh/check_mcp_servers_test.sh: 30/30 passed
  • make shellcheck-setup-sh
  • make fmt
  • make build
  • make recompile
  • git diff --check
  • representative gh-aw-firewall smoke workflow compilation confirms deferred classification precedes gateway startup and AWF execution, without required:false

make agent-report-progress passes workflow drift, formatting, build, Go lint, action shell lint, schema freshness, and impacted Go tests. Its final aggregate result remains blocked by the repository's existing function-length custom-linter baseline. After merging current main, impacted setup-JS validation also requires newly added TypeScript dependencies; local restoration was blocked by the configured package feed/network (vite@8.2.2 unavailable), not by this change.

The external smoke-workflow compile also reports existing container_pin_not_found entries for the AWF v0.28.8 enclave-agent and enclave-mcp-server images; this does not affect the deferred-check behavior.

Dependencies

This is dependency layer 3. The required gh-aw-firewall/AWF and gh-aw-mcpg changes are merged and released as AWF v0.28.8 and mcpg v0.4.11; this PR consumes those published contracts and artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bcc38c7d-af99-4f49-8c17-b56cbb4515c5
Copilot AI balanced review requested due to automatic review settings August 24, 2026 22:12

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.

Pull request overview

Adds isolated, read-only GitHub Issues access for agent enclaves through a dedicated mcpg proxy.

Changes:

  • Adds issues-read-v1 schemas, validation, and version gates.
  • Generates proxy policy, lifecycle, credential isolation, and tests.
  • Documents routes, DIFC behavior, and dependency requirements.
Show a summary per file
File Description
.changeset/enclave-github-issues-profile.md Records the new profile.
.github/aw/enclaves.md Adds authoring guidance.
actions/setup/sh/start_enclave_github_proxy.sh Starts and configures the proxy.
actions/setup/sh/stop_enclave_github_proxy.sh Cleans up proxy resources.
docs/src/content/docs/reference/enclaves.md Documents profile behavior.
docs/src/content/docs/reference/glossary.md Updates enclave terminology.
pkg/constants/version_constants.go Defines dependency minimums.
pkg/parser/schema_test.go Tests frontmatter validation.
pkg/parser/schemas/main_workflow_schema.json Adds user-facing schema syntax.
pkg/workflow/awf_env.go Excludes proxy handoff variables.
pkg/workflow/compiler_yaml_ai_execution.go Adds proxy cleanup lifecycle.
pkg/workflow/enclave_github_proxy.go Builds policy and lifecycle steps.
pkg/workflow/enclave_github_proxy_test.go Tests proxy integration.
pkg/workflow/enclaves.go Adds configuration and validation.
pkg/workflow/enclaves_test.go Tests AWF configuration output.
pkg/workflow/mcp_setup_generator.go Starts the proxy during MCP setup.
pkg/workflow/schemas/awf-config.schema.json Adds AWF schema support.
schema-demos/schema-demo-enclaves.md Demonstrates the new syntax.

Review details

Suppressed comments (1)

actions/setup/sh/start_enclave_github_proxy.sh:66

  • A cancelled prior run can leave proxy-tls/ca.crt here. Because the readiness probe uses curl -k, it can accept the new proxy while retaining the stale CA, after which AWF receives a CA that cannot authenticate the proxy. Remove the previous container and log/TLS directory before recreating it.
mkdir -p "$MCP_LOG_DIR"
chmod 700 "$MCP_LOG_DIR"
docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
  • Files reviewed: 18/18 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread actions/setup/sh/start_enclave_github_proxy.sh Outdated
Comment thread docs/src/content/docs/reference/enclaves.md
@pelikhan

Copy link
Copy Markdown
Collaborator

/matt

@pelikhan

Copy link
Copy Markdown
Collaborator

/review

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-24T00:00:00Z
review_event: REQUEST_CHANGES
top_themes:
  - enclave GitHub repo-limit validation incorrectly spans mixed enclave types
  - proxy teardown can be skipped after downstream host-step failures
files_reviewed:
  - .github/aw/enclaves.md
  - actions/setup/sh/start_enclave_github_proxy.sh
  - actions/setup/sh/stop_enclave_github_proxy.sh
  - docs/src/content/docs/reference/enclaves.md
  - docs/src/content/docs/reference/glossary.md
  - pkg/constants/version_constants.go
  - pkg/parser/schema_test.go
  - pkg/parser/schemas/main_workflow_schema.json
  - pkg/workflow/awf_env.go
  - pkg/workflow/compiler_yaml_ai_execution.go
  - pkg/workflow/enclave_github_proxy.go
  - pkg/workflow/enclave_github_proxy_test.go
  - pkg/workflow/enclaves.go
  - pkg/workflow/enclaves_test.go
  - pkg/workflow/mcp_setup_generator.go
  - pkg/workflow/schemas/awf-config.schema.json
  - schema-demos/schema-demo-enclaves.md
comment_count: 2

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
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 · pi · gpt54 · 9.7 AIC · ⌖ 7.12 AIC · ⊞ 7K ·
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.

Request changes

This introduces two blocking regressions: the new repo-limit validation rejects valid mixed script + agent.github.cli enclave configs, and the enclave GitHub proxy teardown can be skipped when later host-side steps fail.

Blocking themes
  • The issues-read-v1 non-public repository limit is being enforced against the wrong scope, so existing mixed-enclave workflows break as soon as they opt into the new profile.
  • The proxy cleanup path is not robust against downstream failures, which leaves the capability handoff and proxy state alive longer than the design claims.

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 9.7 AIC · ⌖ 7.12 AIC · ⊞ 7K
Comment /review to run again

Comment thread pkg/workflow/enclaves.go
Comment thread pkg/workflow/compiler_yaml_ai_execution.go

@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.

Skills-Based Review 🧠

Applied /codebase-design and /tdd — overall LGTM with two minor observations (no blocking issues).

📋 Key Themes & Highlights

Key Themes

  • Architecture is clean and well-scoped: the PAT/capability key never reaches the AWF sandbox or agent, the proxy runs in bridge mode with no published host port, and the stop step always clears the key from GITHUB_ENV. The security boundary is deliberately layered and the test suite enforces the contract.
  • Version gating is conservative: provisional minimums (AWF v0.28.6, MCPG v0.4.11) are separated from global defaults until release artifacts exist. The validateEnclaveGitHubIssuesVersions function correctly uses the default MCPG version as the fallback when none is specified — meaning omitting sandbox.mcp.version fails validation.
  • Two minor observations posted as inline comments:
    1. enclaveGitHubIssuesOperations as a package-level slice makes profile-to-operations lookup implicit; worth a map when a second profile arrives.
    2. A test case for the nil-MCP-config rejection path would complete the version-gate coverage.

Positive Highlights

  • TestEnclaveGitHubProxyScriptsEnforceDedicatedBridgeContract is an excellent contract-enforcement test — it pins security-critical shell invariants (no -p host port, bridge mode, capability masking ordering) directly in Go.
  • TestCompileEnclaveGitHubProxyLifecycle verifies end-to-end compilation ordering and exclusion of all handoff vars from the AWF command line.
  • effectivePrimaryGitHubIntegrityFloor correctly prefers ParsedTools over raw map access and falls back to approved — the priority chain is explicit and tested.
  • ✅ Refactoring validateEnclavesConfig into validateEnclaveEntry / validateEnclaveRepositories / validateEnclaveGitHubIssuesVersions meaningfully improves testability and readability.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 78.7 AIC · ⌖ 10.2 AIC · ⊞ 7.6K
Comment /matt to run again

Comment thread pkg/workflow/enclave_github_proxy.go
Comment thread pkg/workflow/enclave_github_proxy_test.go
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • address the blocking github-actions review that flagged mixed-enclave repo-limit validation scope and proxy teardown robustness
  • respond in the existing review threads, push the fixes, and rerun the relevant checks
  • refresh the branch if needed and use the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32787277683

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 20.4 AIC · ⌖ 9.41 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Addressed in efa862c. I added focused regression coverage for mixed-enclave repository-limit scoping and for unconditional enclave GitHub proxy teardown (if: always() + continue-on-error) so these behaviors are now explicitly guarded.

Copilot AI requested a review from gh-aw-bot August 24, 2026 23:19
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • the prior sous-chef nudge has a follow-up from the PR author-side agent, but the PR still shows CHANGES_REQUESTED; please reply in the blocking github-actions review thread(s) with the concrete fix references and ensure the blocking review is fully addressed
  • refresh the branch if needed and use the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32795790586

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 14.8 AIC · ⌖ 9.31 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Follow-up done. I replied in the blocking github-actions review threads with concrete fix references to efa862c for both items (TestValidateEnclaveGitHubIssuesRepositoryLimitScopesToGitHubEntry and TestGenerateEnclaveGitHubProxyStopAlwaysRuns). The branch is refreshed at 5c0a988.

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:...

Follow-up complete on current head 600919c: the unresolved Copilot review items are already addressed in code/docs and replied in-thread (39d420a, efa862c, f6799e8). I re-checked the cited run (32897609333) and it has no failed jobs. At this point the remaining blocker is unresolved thread state, not missing fixes to push.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • the remaining blocker appears to be unresolved review-thread state; revisit the existing review threads, make the maintainer-ready follow-up explicit there, and resolve any threads that are now fully addressed
  • if any thread still points to missing work, push the follow-up fixes, refresh the branch if needed, and use the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32907942669

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 14.6 AIC · ⌖ 8.22 AIC · ⊞ 6.3K ·
Comment /souschef to run again

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Follow-up complete on head 600919c: I revisited the existing review threads and added explicit maintainer-ready confirmations directly on each remaining unresolved review comment (3847946103, 3847946132, 3848113185, 3848113193, 3848116535, 3848116544) with the concrete fix commits (39d420a, efa862c, f6799e8). I also re-checked the cited run (32907942669): no failed jobs.

Merge current main, set the first supported enclave GitHub Issues releases to AWF v0.28.8 and mcpg v0.4.11, and refresh generated workflow image pins.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bcc38c7d-af99-4f49-8c17-b56cbb4515c5
@lpcox

lpcox commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address all review feedback

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@copilot address all review feedback

Done on current head c71821d: all review threads are now addressed and marked resolved, including the prior Copilot and github-actions feedback items. I also rechecked recent PR runs on this head (32918097721, 32918097732, 32918097782, 32918111663), and they are completed/success with no failed jobs.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • review the current PR state, refresh the branch if needed, and make sure any missing maintainer-facing context is added
  • run the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32957620001

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 13.3 AIC · ⌖ 8.12 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Current PR state checked on head c71821d: review threads are resolved and prior feedback is addressed, and the cited run 32957620001 has no failed jobs. Maintainer-facing gap now appears to be mergeability (mergeable_state: dirty), so the branch likely needs a refresh/conflict resolution against main before final merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • this PR is currently merge-conflicting (DIRTY); run make merge-main to resolve conflicts against main, then rerun the relevant validation
  • after resolving conflicts, make sure maintainer-facing context stays explicit and use the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32962488926

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 18.5 AIC · ⌖ 8.2 AIC · ⊞ 6.3K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 26, 2026 11:32
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Completed. I ran make merge-main, resolved the resulting lockfile conflicts, and finalized the merge on this branch (e786f2f + lockfile recompile follow-up 8469fe9). I then reran relevant validation (go test ./pkg/workflow -run 'Enclave|enclave', go test ./pkg/parser -run 'Schema|Enclave|enclave', make shellcheck-setup-sh, make build, make check-stale-schema-binary, make recompile, make fmt). The cited run 32962488926 also shows no failed jobs.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts on this branch.

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Done — merge conflicts on this branch have been resolved. I merged main with make merge-main, resolved the lockfile conflicts, and finalized with e786f2f plus lockfile recompile commit 8469fe9. Current branch is clean with no in-progress merge state.

Copilot AI requested a review from pelikhan August 26, 2026 14:10
lpcox added 2 commits August 26, 2026 07:47
Classify the compiler-owned awf-enclave route as deferred during the eager gateway functionality check so AWF can attach its backend and perform bounded readiness without weakening ordinary required-server checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bcc38c7d-af99-4f49-8c17-b56cbb4515c5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bcc38c7d-af99-4f49-8c17-b56cbb4515c5
@pelikhan
pelikhan marked this pull request as draft August 26, 2026 18:09
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.

5 participants