Skip to content

fix: use COPILOT_DUMMY_BYOK indirection to suppress secret-scanner false positives on lock files#33116

Merged
lpcox merged 5 commits into
mainfrom
copilot/fix-generated-locks-copilot-api-key
May 18, 2026
Merged

fix: use COPILOT_DUMMY_BYOK indirection to suppress secret-scanner false positives on lock files#33116
lpcox merged 5 commits into
mainfrom
copilot/fix-generated-locks-copilot-api-key

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Generated .lock.yml files emitted COPILOT_API_KEY: dummy-byok-key-for-offline-mode — a literal token-shaped value next to an *_API_KEY key — causing secret scanners to flag committed lock files as containing credentials.

Changes

  • New constant CopilotBYOKDummyAPIKeyEnvVar = "COPILOT_DUMMY_BYOK" in pkg/constants/engine_constants.go — a non-*_API_KEY-shaped name to hold the sentinel
  • Indirection in lock file emission (copilot_engine_execution.go): instead of COPILOT_API_KEY: dummy-byok-key-for-offline-mode, the compiler now emits two variables:
COPILOT_API_KEY: $COPILOT_DUMMY_BYOK
COPILOT_DUMMY_BYOK: dummy-byok-key-for-offline-mode

COPILOT_DUMMY_BYOK carries the literal but has no *_API_KEY suffix; COPILOT_API_KEY holds a variable reference rather than a token-shaped literal — neither form triggers scanner rules.

  • Updated tests to assert the new two-variable pattern and that the literal never appears inline with COPILOT_API_KEY
  • Updated golden fixtures and all committed .lock.yml workflow files

Changeset\n\n- Type: patch\n- Description: Fix generated lock files to avoid secret-scanner false positives by routing the dummy Copilot API key through indirection instead of emitting the literal token-shaped value inline.

Generated by 📋 Changeset Generator for issue #33116 ·



✨ PR Review Safe Output Test - Run 26056780378

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · ● 6M ·

Copilot AI and others added 2 commits May 18, 2026 17:56
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
…YOK indirection

Secret scanners flag generated lock files when COPILOT_API_KEY contains a
token-shaped literal value. Instead, introduce a new COPILOT_DUMMY_BYOK env
var that holds the sentinel, and set COPILOT_API_KEY to reference it via
$COPILOT_DUMMY_BYOK. COPILOT_DUMMY_BYOK has no *_API_KEY suffix so scanners
won't flag it; the COPILOT_API_KEY line holds a variable reference rather
than a literal, which also avoids triggering pattern-based scanners.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix dummy COPILOT_API_KEY value in generated locks fix: use COPILOT_DUMMY_BYOK indirection to suppress secret-scanner false positives on lock files May 18, 2026
Copilot finished work on behalf of lpcox May 18, 2026 18:03
Copilot AI requested a review from lpcox May 18, 2026 18:03
@pelikhan pelikhan marked this pull request as ready for review May 18, 2026 18:21
Copilot AI review requested due to automatic review settings May 18, 2026 18:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts Copilot lock-file emission to avoid secret-scanner false positives caused by writing a token-shaped literal next to COPILOT_API_KEY in generated .lock.yml workflows.

Changes:

  • Adds CopilotBYOKDummyAPIKeyEnvVar constant (COPILOT_DUMMY_BYOK) to carry the dummy sentinel under a non-*_API_KEY name.
  • Updates Copilot engine step env generation to emit COPILOT_API_KEY: $COPILOT_DUMMY_BYOK and COPILOT_DUMMY_BYOK: dummy-byok-key-for-offline-mode.
  • Updates unit tests, golden fixtures, and committed workflow lock files to match the new pattern.
Show a summary per file
File Description
pkg/constants/engine_constants.go Adds a new constant for the dummy BYOK env var indirection.
pkg/workflow/copilot_engine_execution.go Changes Copilot step env emission to use an indirection variable.
pkg/workflow/copilot_engine_test.go Updates tests to assert the new two-variable pattern.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden Updates golden output to include COPILOT_DUMMY_BYOK and reference it from COPILOT_API_KEY.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden Same golden fixture update for Playwright CLI mode.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden Same golden fixture update for smoke Copilot compile fixture.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden Same golden fixture update for import-based fixture.
.github/workflows/ab-testing-advisor.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/ace-editor.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/agent-performance-analyzer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/agent-persona-explorer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/archie.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/architecture-guardian.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/artifacts-summary.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/auto-triage-issues.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/aw-portfolio-yield.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection (and includes additional unrelated lock-output changes).
.github/workflows/bot-detection.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/brave.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/breaking-change-checker.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/chaos-pr-bundle-fuzzer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/ci-coach.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/cli-consistency-checker.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/code-scanning-fixer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/code-simplifier.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/constraint-solving-potd.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/contribution-check.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-cli-deep-research.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-opt.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-pr-merged-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-token-audit.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/copilot-token-optimizer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/craft.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-agent-of-the-day-blog-writer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-architecture-diagram.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-assign-issue-to-user.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-cli-performance.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-cli-tools-tester.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-community-attribution.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-compiler-quality.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-experiment-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-file-diet.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-firewall-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-geo-optimizer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-hippo-learn.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-issues-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-malicious-code-scan.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-model-inventory.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-news.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-performance-summary.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-regulatory.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-repo-chronicle.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-safe-output-integrator.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-secrets-analysis.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-security-observability.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-semgrep-scan.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-sentrux-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-skill-optimizer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-spdd-spec-planner.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-syntax-error-quality.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-team-status.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-testify-uber-super-expert.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/daily-workflow-updater.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dead-code-remover.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/delight.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dependabot-burner.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dependabot-campaign.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dependabot-go-checker.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dependabot-repair.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dependabot-worker.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/deployment-incident-monitor.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dev-hawk.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/dictation-prompt.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/discussion-task-miner.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/docs-noob-tester.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/draft-pr-cleanup.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/example-permissions-warning.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/firewall-escape.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/firewall.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/functional-pragmatist.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/github-remote-mcp-auth-test.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/glossary-maintainer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/gpclean.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/hippo-embed.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/issue-monster.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/issue-triage-agent.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/jsweep.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/layout-spec-maintainer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/lint-monster.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/linter-miner.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/mattpocock-skills-reviewer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/mcp-inspector.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/mergefest.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/metrics-collector.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/notion-issue-summary.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/org-health-report.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/outcome-collector.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pdf-summary.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/plan.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/poem-bot.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pr-code-quality-reviewer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pr-description-caveman.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pr-nitpick-reviewer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pr-sous-chef.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/pr-triage-agent.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/python-data-charts.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/q.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/refactoring-cadence.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/refiner.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/release.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/repo-audit-analyzer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/repo-tree-map.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/repository-quality-improver.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/research.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/security-compliance.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/security-review.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/slide-deck-maintainer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-ci.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-copilot-arm.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-copilot.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-create-cross-repo-pr.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-multi-pr.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-otel-backends.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-project.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-service-ports.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-temporary-id.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-test-tools.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-update-cross-repo-pr.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-workflow-call-with-inputs.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/smoke-workflow-call.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/spec-extractor.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/spec-librarian.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/stale-pr-cleanup.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/stale-repo-identifier.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/sub-issue-closer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/super-linter.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/technical-doc-writer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/terminal-stylist.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/test-dispatcher.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/test-project-url-default.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/test-quality-sentinel.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/test-workflow.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/tidy.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/ubuntu-image-analyzer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/uk-ai-operational-resilience.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/update-astro.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/video-analyzer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/visual-regression-checker.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/weekly-blog-post-writer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/weekly-editors-health-check.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/weekly-issue-summary.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/weekly-safe-outputs-spec-review.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/workflow-generator.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/workflow-health-manager.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/workflow-normalizer.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.
.github/workflows/workflow-skill-extractor.lock.yml Updates generated env to use COPILOT_DUMMY_BYOK indirection.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 159/159 changed files
  • Comments generated: 4

Comment on lines 459 to 463
if sandboxEnabled {
env["COPILOT_API_KEY"] = constants.CopilotBYOKDummyAPIKey
env[constants.CopilotBYOKDummyAPIKeyEnvVar] = constants.CopilotBYOKDummyAPIKey
env["COPILOT_API_KEY"] = "$" + constants.CopilotBYOKDummyAPIKeyEnvVar
env["AWF_REFLECT_ENABLED"] = "1"
}
Comment thread pkg/workflow/copilot_engine_test.go Outdated
Comment on lines +1858 to +1865
// COPILOT_API_KEY must reference the variable, not the literal value.
expectedAPIKey := "COPILOT_API_KEY: $" + constants.CopilotBYOKDummyAPIKeyEnvVar
if !strings.Contains(stepContent, expectedAPIKey) {
t.Errorf("Expected COPILOT_API_KEY to reference $%s (not the literal), got:\n%s", constants.CopilotBYOKDummyAPIKeyEnvVar, stepContent)
}
// Sanity-check: the literal dummy key must NOT appear next to COPILOT_API_KEY.
if strings.Contains(stepContent, "COPILOT_API_KEY: "+constants.CopilotBYOKDummyAPIKey) {
t.Errorf("COPILOT_API_KEY must not contain the literal dummy key value; got:\n%s", stepContent)
Comment thread pkg/constants/engine_constants.go Outdated
Comment on lines +256 to +260
// CopilotBYOKDummyAPIKeyEnvVar is the environment variable that holds the
// CopilotBYOKDummyAPIKey sentinel value in generated lock files. Using a
// non-_API_KEY-shaped name for the literal value prevents secret scanners from
// flagging the generated artifact. COPILOT_API_KEY is then set to reference
// this variable (e.g. $COPILOT_DUMMY_BYOK) so the value is never written
Comment on lines 83 to +88
env:
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}
OTEL_SERVICE_NAME: gh-aw
OTEL_EXPORTER_OTLP_HEADERS: Authorization=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}
GH_AW_OTLP_ALL_HEADERS: Authorization=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }},Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }}
GH_AW_OTLP_ENDPOINTS: '[{"url":"${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}","headers":"Authorization=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}"},{"url":"${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }}","headers":"Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }}"}]'
OTEL_SERVICE_NAME: gh-aw.aw-portfolio-yield
OTEL_EXPORTER_OTLP_HEADERS: x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}
GH_AW_OTLP_ALL_HEADERS: x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }},Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }}
GH_AW_OTLP_ENDPOINTS: '[{"url":"${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}","headers":"x-sentry-auth=${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}"},{"url":"${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }}","headers":"Authorization=${{ secrets.GH_AW_OTEL_GRAFANA_AUTHORIZATION }}"}]'
@github-actions github-actions Bot mentioned this pull request May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100

Excellent test quality

Metric Value
New/modified tests analyzed 1
✅ Design tests (behavioral contracts) 1 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 1 (100%)
Duplicate test clusters 0
Test inflation detected No
🚨 Coding-guideline violations None

Test Classification Details

View Test Classification Table
Test File Classification Issues Detected
TestCopilotEngineSetsDummyAPIKey pkg/workflow/copilot_engine_test.go:1834 ✅ Design

Analysis

The PR modifies TestCopilotEngineSetsDummyAPIKey to reflect the new indirection strategy: instead of placing the dummy key literal directly in COPILOT_API_KEY, the compiled workflow now sets COPILOT_DUMMY_BYOK to the literal value and has COPILOT_API_KEY reference $COPILOT_DUMMY_BYOK. The test changes precisely verify this behavioral contract:

  1. COPILOT_DUMMY_BYOK: <literal> is present in the step — verifies the indirection variable is set.
  2. COPILOT_API_KEY: $COPILOT_DUMMY_BYOK is present — verifies the API key references the variable (not the literal).
  3. COPILOT_API_KEY: <literal> is absent — sanity-check that the old (scanner-triggering) form is eliminated.
  4. COPILOT_DUMMY_BYOK is absent when sandbox.agent: false — verifies the indirection variable is not emitted unnecessarily.

All assertions use t.Errorf with descriptive messages including the relevant variable names and step content for context. No mock libraries are used. The test is an existing file with //go:build !integration on line 1 (requirement satisfied).

Minor note: The assertions use t.Errorf (stdlib) rather than testify. This is fine and consistent with the surrounding test code. The guideline for descriptive messages applies to testify-style assertions; t.Errorf format strings here already include sufficient context.

Test inflation: +17 test lines vs +16 production lines — ratio ≈ 1:1. No inflation.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 1 test function — unit (//go:build !integration)
  • 🟨 JavaScript: 0 tests

Verdict

Check passed. 0% of new/modified tests are implementation tests (threshold: 30%). The updated test enforces the behavioral contract that COPILOT_API_KEY must never contain the literal dummy key value in compiled lock files, preventing secret-scanner false positives.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

🧪 Test quality analysis by Test Quality Sentinel · ● 8M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnose — this is a targeted bug fix for secret-scanner false positives on generated lock files.

Key Themes

  • Root cause addressed: The fix correctly identifies that scanners flag literal token-shaped values adjacent to *_API_KEY keys, and resolves it by introducing an indirection variable with a non-sensitive-looking name.
  • Runtime semantics gap: GitHub Actions env: blocks do not perform shell variable expansion, so COPILOT_API_KEY receives the literal string $COPILOT_DUMMY_BYOK at runtime — not the sentinel value. This is functionally correct (the AWF proxy intercepts before key validation), but it's subtle and undocumented in the code itself.
  • Heuristic brittleness: The fix is correct today but future scanner updates could catch COPILOT_DUMMY_BYOK: dummy-byok-key-for-offline-mode too — worth a comment on the constant naming constraint.

Positive Highlights

  • ✅ Clear, well-documented PR description explaining the before/after
  • ✅ Tests updated with three distinct assertions: literal in indirection var, reference in API_KEY, and negative check that literal is never adjacent to API_KEY
  • ✅ Constant is properly named and placed in engine_constants.go
  • ✅ All 159 generated lock files regenerated mechanically — no manual edits
  • ✅ Golden fixtures updated alongside tests

Verdict

No blocking issues — both inline comments are observations/suggestions, not correctness problems. The fix does what it says and the test coverage is solid.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · ● 6.5M

if sandboxEnabled {
env["COPILOT_API_KEY"] = constants.CopilotBYOKDummyAPIKey
env[constants.CopilotBYOKDummyAPIKeyEnvVar] = constants.CopilotBYOKDummyAPIKey
env["COPILOT_API_KEY"] = "$" + constants.CopilotBYOKDummyAPIKeyEnvVar
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.

[/diagnose] The comment explains the intent but not the actual runtime semantics: because GitHub Actions does not perform shell variable expansion inside env: blocks, COPILOT_API_KEY will receive the literal string $COPILOT_DUMMY_BYOK in the process environment — not the value dummy-byok-key-for-offline-mode.\n\nThis still works because the AWF API proxy intercepts all Copilot CLI requests before any real key validation, so any non-empty placeholder is fine. But a future reader might be surprised. A one-line comment would prevent well-meaning fixes:\n\ngo\n// Note: GitHub Actions env: blocks do not expand $VAR references, so the process\n// receives the literal string "$COPILOT_DUMMY_BYOK". Any non-empty placeholder\n// works here because the AWF proxy intercepts before any real key check.\n

// this variable (e.g. $COPILOT_DUMMY_BYOK) so the value is never written
// inline next to a *_API_KEY key.
CopilotBYOKDummyAPIKeyEnvVar = "COPILOT_DUMMY_BYOK"

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.

[/diagnose] Minor resilience note: the fix works against today's scanner heuristics (literal token-shaped value adjacent to a *_API_KEY key), but it's a cat-and-mouse approach. If a scanner is later updated to also flag COPILOT_DUMMY_BYOK: dummy-byok-key-for-offline-mode as suspicious, the false positive returns. This is worth noting in a comment alongside the constant so future maintainers know the constraint driving the naming choice — specifically that the variable name must not end in _API_KEY, _SECRET, or similar patterns.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of new/modified tests are implementation tests (threshold: 30%). The updated assertions enforce the behavioral contract that COPILOT_API_KEY must reference the indirection variable rather than the literal dummy key value.

@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 18, 2026

@copilot address the review feedback

…ntime expansion

GitHub Actions env: blocks are NOT shell-expanded, so setting
COPILOT_API_KEY: $COPILOT_DUMMY_BYOK would pass the literal string
"$COPILOT_DUMMY_BYOK" to the process instead of the sentinel value.

Instead, add 'export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK"' to pathSetup
(the host-side shell script that runs before sudo -E awf). Shell variable
expansion runs correctly there, and sudo -E preserves COPILOT_API_KEY for
the AWF container. COPILOT_DUMMY_BYOK remains in the env: block (no
*_API_KEY suffix), and COPILOT_API_KEY never appears as a YAML env: key.

Also fix CopilotBYOKDummyAPIKeyEnvVar comment wording:
"non-_API_KEY-shaped" -> "non-*_API_KEY-shaped"

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot address the review feedback

Addressed in the latest commit. The approach is now:

  • COPILOT_DUMMY_BYOK: dummy-byok-key-for-offline-mode stays in the env: block (not *_API_KEY-shaped, so scanners ignore it)
  • COPILOT_API_KEY is never a key in the env: block
  • Instead, export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK" is emitted in pathSetup — the host-side shell script that runs before sudo -E awf. Shell variable expansion works correctly there, and sudo -E preserves COPILOT_API_KEY=dummy-byok-key-for-offline-mode for the AWF container.

Also fixed the non-_API_KEY-shapednon-*_API_KEY-shaped comment wording.

Copilot finished work on behalf of lpcox May 18, 2026 19:28
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 18, 2026

@pelikhan make sure this looks ok to you

@lpcox lpcox added the smoke label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Smoke OTEL completed successfully!

@github-actions github-actions Bot removed the smoke label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection results could not be parsed.

Review the workflow run logs for details.

Smoke test completed with some failures.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

@github-actions
Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.54.0
jq 1.7
yq 4.53.2
curl 8.5.0
gh 2.92.0
node 22.22.2
python3 3.14.5
go 1.24.13
java 10.0.300
dotnet NOT FOUND

Result: 11/12 tools available ⚠️ FAILdotnet is missing

🔧 Tool validation by Agent Container Smoke Test · ● 1.2M ·

@github-actions
Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection results could not be parsed.

Review the workflow run logs for details.

Smoke Test Results

  • GitHub MCP Testing: ✅
  • Web Fetch Testing: ✅
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅
  • Build gh-aw: ❌

Overall Status: FAIL

Warning

Firewall blocked 1 domain

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

  • localhost

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

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

Smoke Gemini — Powered by Gemini ·

@github-actions
Copy link
Copy Markdown
Contributor

Commit pushed: 561d749

Generated by Changeset Generator

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Codex 26056780277 — FAIL
PRs: #33089 Match agent failure issues by stored metadata instead of title alone; #33130 Align CLI help/docs consistency for outcomes, project setup, URLs, and wording
✅ GitHub MCP, Serena MCP, file writing, bash readback, build, cache write
❌ Playwright requested commands, Web Fetch MCP unavailable, comment-memory files missing, issue-field discovery unavailable
Run: https://github.com/github/gh-aw/actions/runs/26056780277

Warning

Firewall blocked 4 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex ·

@github-actions
Copy link
Copy Markdown
Contributor

💥 Smoke Test: Claude — Run 26056780378

Core #1-12: ✅ all pass · PR review #13-15,17,18: ✅ · #16,19: ⚠️ skipped · Overall: PASS

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · ● 6M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal!

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · ● 6M

@github-actions
Copy link
Copy Markdown
Contributor

🦴 UGH! Caveman smoke test agent was HERE! Me run tests. Tests PASS. Tools WORK. Very good! 🔥

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · ● 20.2M ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test 26056780184 — Results for @lpcox @Copilot

  • ✅ GitHub MCP (merged PRs)
  • ✅ MCP Scripts GH CLI
  • ✅ Serena CLI (16+ symbols found)
  • ✅ Playwright CLI
  • ❌ Web Fetch (tool unavailable)
  • ✅ File Write/Read
  • ✅ Discussion Interaction
  • ✅ Build gh-aw
  • ✅ Upload Artifact
  • ✅ Discussion Creation
  • ✅ Workflow Dispatch (haiku-printer)
  • ✅ PR Review
  • ✅ Comment Memory
  • ✅ Sub-Agent (README summary)

Overall: ⚠️ PASS (14/15)

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · ● 20.2M ·

@github-actions
Copy link
Copy Markdown
Contributor

Comment Memory

# Smoke Test Notes

Tests pass, build compiles,
Caveman agent runs all checks,
GitHub tools work well.

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

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · ● 20.2M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Two inline comments left on pkg/constants/engine_constants.go. The approach of using COPILOT_DUMMY_BYOK indirection is sound and cleanly avoids secret-scanner false positives. The test and fixture updates look complete.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · ● 20.2M

// flagging the generated artifact. COPILOT_API_KEY is then exported in the run:
// shell script via shell variable expansion so the value is never written
// inline next to a *_API_KEY key in the YAML env: block.
CopilotBYOKDummyAPIKeyEnvVar = "COPILOT_DUMMY_BYOK"
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.

Good use of indirection! COPILOT_DUMMY_BYOK avoids the *_API_KEY suffix that triggers secret scanners — clean fix.

// isolated in the AWF API proxy sidecar.
CopilotBYOKDummyAPIKey = "dummy-byok-key-for-offline-mode"

// CopilotBYOKDummyAPIKeyEnvVar is the environment variable that holds the
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.

The comment block clearly explains the two-variable pattern. Consider also noting that this is a build-time constant so the env var name is stable.

@github-actions
Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

@copilot confirm the passing smoke test and merge when ready.

Generated by 👨‍🍳 PR Sous Chef ·

@lpcox lpcox merged commit 76939a4 into main May 18, 2026
1 check passed
@lpcox lpcox deleted the copilot/fix-generated-locks-copilot-api-key branch May 18, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated locks emit secret-shaped dummy COPILOT_API_KEY value

3 participants