Skip to content

Add compiler support for dynamic repository enclave policies - #58880

Merged
lpcox merged 4 commits into
mainfrom
copilot/add-compiler-support-dynamic-repo-policies
Sep 6, 2026
Merged

Add compiler support for dynamic repository enclave policies#58880
lpcox merged 4 commits into
mainfrom
copilot/add-compiler-support-dynamic-repo-policies

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Dynamic repository admission lets agent enclaves accept bounded runtime repository selectors without enumerating every repo at compile time. Static repos support remains unchanged; dynamic mode is agent-only and fail-closed behind AWF/mcpg version gates.

  • Workflow syntax and schemas
    • Add enclaves[].dynamic for agent enclave entries.
    • Enforce exactly one of repos or dynamic per entry.
    • Reject dynamic script enclaves, unknown policy versions, unknown fields, and non-canonical selectors.
enclaves:
  - agent:
      model: gpt-5
      max-task-bytes: 4096
      max-model-requests: 8
      max-model-tokens: 1024
    dynamic:
      allowed-owners: [octo-org]
      sensitivity: confidential
      github-policy: github-repository-read-v1
      max-repositories: 4
      quotas:
        max-invocations: 8
        max-output-bytes: 32768
        max-execution-seconds: 900
      audit-labels: [dynamic-enclave]
      expires-at: "2999-01-01T00:00:00Z"
    timeout: 120
    memory-limit: 512m
    cpu-limit: "1"
    pids-limit: 128
    tmpfs-limit: 64m
    max-output-bytes: 8192
    max-invocations: 8
  • Policy and runtime config

    • Emit the closed AWF dynamic policy envelope for github-repository-read-v1.
    • Configure mcpg with github-repository-delegation-v1.
    • Keep the existing single static awf-enclave MCP backend.
  • Credential isolation

    • Generate an AWF-only delegation control capability.
    • Exclude enclave and delegation capability environment variables from the primary agent.
    • Avoid issuing a job-lifetime enclave GitHub identity for dynamic-only policies.
  • Version gates and defaults

    • Require AWF dynamic enclave support and mcpg v0.4.16 for dynamic admission.
    • Bump the default mcpg image to v0.4.16 and refresh generated workflow locks.
  • Docs and coverage

    • Document dynamic enclave syntax, selector rules, policy closure, and version requirements.
    • Add focused parser, validation, config emission, gateway, and secret-isolation tests.

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

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 12.2 AIC · ⌖ 8.69 AIC · ⊞ 9.2K ·
Comment /souschef to run again


pr-sous-chef
run: https://github.com/github/gh-aw/actions/runs/34025311508

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 16.8 AIC · ⌖ 8.78 AIC · ⊞ 9.2K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 42.9 AIC · ⌖ 8.76 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Add compiler support for dynamic repository enclave policies Add compiler support for dynamic repository enclave policies Sep 6, 2026
Copilot AI requested a review from lpcox September 6, 2026 00:05
@lpcox
lpcox marked this pull request as ready for review September 6, 2026 00:12
Copilot AI balanced review requested due to automatic review settings September 6, 2026 00: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.

🟡 Changes recommended

Dynamic-only policies lack a registered GitHub backend, and several security bounds and generated container pins remain incomplete.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds compiler support for bounded, dynamic repository admission in agent enclaves while preserving static enclave behavior.

Changes:

  • Adds dynamic policy schemas, validation, documentation, and tests.
  • Configures AWF/MCPG delegation and credential isolation.
  • Bumps MCPG to v0.4.16 and regenerates workflow locks.
File summaries
File Description
pkg/workflow/tools_types.go Adds delegation-controller configuration types.
pkg/workflow/schemas/mcp-gateway-config.schema.json Defines the MCPG delegation contract.
pkg/workflow/schemas/awf-config.schema.json Defines emitted dynamic enclave policies.
pkg/workflow/mcp_setup_gateway.go Generates the delegation capability.
pkg/workflow/mcp_renderer.go Emits delegation controllers into MCPG JSON.
pkg/workflow/mcp_gateway_config.go Builds dynamic delegation configuration.
pkg/workflow/enclaves_test.go Tests parsing, validation, emission, and isolation.
pkg/workflow/awf_env.go Excludes the control capability from agents.
pkg/parser/schemas/main_workflow_schema.json Adds dynamic frontmatter syntax.
pkg/parser/schema_test.go Tests schema acceptance and rejection paths.
pkg/constants/version_constants.go Adds version gates and bumps MCPG.
pkg/constants/version_constants_test.go Updates expected MCPG default.
docs/src/content/docs/experimental/enclaves.md Documents dynamic policies.
.github/aw/enclaves.md Updates enclave authoring guidance.
.github/workflows/schema-feature-coverage.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/github-remote-mcp-auth-test.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/feature-grower.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-team-status.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-spec-coverage-kiro.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-schema-audit-cursor.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-regression-audit-kiro.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-max-ai-credits-test.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-github-docs-seo-optimizer.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-community-attribution.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-byok-ollama-test.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/daily-action-setup-security-audit.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/copilot-pr-merged-report.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/codex-github-remote-mcp-test.lock.yml Regenerates for MCPG v0.4.16.
.github/workflows/breaking-change-checker.lock.yml Regenerates for MCPG v0.4.16.
Review details
  • Files reviewed: 68/314 changed files
  • Comments generated: 4
  • Review effort level: Balanced

@@ -201,7 +206,7 @@ const CopilotNoAskUserMinVersion Version = "1.0.19"
//
// The first recompile regenerates all lock files using the new version; the second recompile
// refreshes the container SHA pins that were resolved during the first pass.
const DefaultMCPGatewayVersion Version = "v0.4.15"
const DefaultMCPGatewayVersion Version = "v0.4.16"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in commit 6df4114: added the v0.4.16 mcpg digest/pinned_image to the action pin data and regenerated workflow locks twice.

if enclaveDynamicRepositoryPolicyEnabled(workflowData) {
config.DelegationControllers = map[string]MCPGatewayDelegationController{
enclaveDynamicController: {
Server: "github",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in commit 6df4114: dynamic delegation now registers the GitHub MCP backend for collection, Docker image setup, and the primary gateway policy without issuing the static enclave identity.

"properties": {
"timeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 4740 },
"memoryLimit": { "type": "string", "pattern": "^[1-9][0-9]*[bkmgBKMG]$" },
"cpuLimit": { "type": "string", "pattern": "^(?:[0-9]{1,2})(?:\\.[0-9]{1,3})?$" },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in commit 6df4114: CPU limits now reject zero in frontmatter and emitted AWF schemas, with Go validation requiring a positive finite value.

Comment on lines +1180 to +1182
"expiresAt": {
"type": "string",
"format": "date-time"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in commit 6df4114: dynamic expiry is parsed and rejected when it exceeds the enclave timeout/job lifetime, with focused validation coverage and updated documentation.

@lpcox

lpcox commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the s...

Addressed all review-thread findings in commit c7e4f1a: dynamic policies now register the GitHub backend without a primary enclave identity, CPU limits reject zero, expiry is bounded by enclave lifetime, and the mcpg v0.4.16 digest is pinned with regenerated locks.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please take the next forward-progress step on this PR. Refresh the branch if needed, address unresolved review feedback and checks, and finish with the pr-finisher skill.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 12.2 AIC · ⌖ 8.69 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please take the next forward-progress step on this PR. Refresh the branch if needed, address unresolved review feedback and checks, and finish with the pr-finisher skill.

[!WARNING]...

Completed the forward-progress pass: reviewed the PR state, replied to each Copilot review thread, ran formatting/lint/unit/full tests and recompile successfully, and pushed commit 6df4114. CI on this HEAD still needs a maintainer-triggered run.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress step on PR #58880: refresh the branch if needed, address any remaining review feedback/checks, and finish with the pr-finisher skill.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34019782918

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.8 AIC · ⌖ 8.71 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Completed the requested forward-progress pass on PR #58880. The branch is clean at 6df4114; all prior review feedback has replies, and make fmt, make lint, make test-unit, make test, and make recompile pass. No additional code changes were needed.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on PR #58880.

  • Refresh the branch with the latest base changes if GitHub still allows it.
  • Re-check open review feedback and unresolved conversations.
  • Re-run the pr-finisher skill and push any remaining implementation or fixup commits needed to move this PR toward merge readiness.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 16.8 AIC · ⌖ 8.78 AIC · ⊞ 9.2K ·
Comment /souschef to run again

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

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Completed the forward-progress pass and pushed merge commit 9d254d7, bringing the branch up to date with main. Final formatting, lint, unit/full tests, and recompile validation passed; no uncommitted changes remain. Existing review feedback is addressed in prior replies. CI must be re-triggered by a maintainer for the new HEAD before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress step on PR #58880: refresh the branch if needed, address any remaining review feedback/checks, and finish with the pr-finisher skill.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34033151442

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

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Completed this forward-progress pass. The branch is already up to date with main at merge commit 9d254d7, review feedback remains addressed, and final local validation is running with no source changes needed. The current GitHub Actions run for this HEAD has completed build and recompile successfully and is still processing the request.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on PR #58880.

  • Re-check the latest branch and CI state on current HEAD.
  • If no code changes are needed, state the remaining maintainer-side blocker clearly.
  • Then run the pr-finisher skill and hand the PR back concisely.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34036123492

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 42.9 AIC · ⌖ 8.76 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

No code changes are needed. The branch is clean and up to date with main at 9d254d7; review feedback remains addressed. Build, lint, formatting, impacted tests, and workflow recompile passed. The remaining blocker is maintainer-side: GitHub reports the PR as blocked while required review/check state is pending, and the current validation workflow is still in progress.

@lpcox
lpcox merged commit f345d09 into main Sep 6, 2026
5 checks passed
@lpcox
lpcox deleted the copilot/add-compiler-support-dynamic-repo-policies branch September 6, 2026 14:00
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.5

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.

Add compiler support for dynamic repository enclave policies

4 participants