Skip to content

Pin agentic engine CLIs to fixed versions for supply chain security#25111

Merged
pelikhan merged 1 commit intomainfrom
copilot/update-agentic-versions
Apr 7, 2026
Merged

Pin agentic engine CLIs to fixed versions for supply chain security#25111
pelikhan merged 1 commit intomainfrom
copilot/update-agentic-versions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Summary

Pins all agentic engine CLIs from "latest" to specific fixed versions, adds a compiler warning when a user explicitly sets engine.version: latest, and ensures engine CLI npm installs always use --ignore-scripts.

Changes

  • pkg/constants/version_constants.go: Pin DefaultCopilotVersion=1.0.20, DefaultClaudeCodeVersion=2.1.92, DefaultCodexVersion=0.118.0, DefaultGeminiVersion=0.36.0
  • pkg/workflow/engine_validation.go: Add validateEngineVersion() that warns (non-strict) or errors (strict) when engine.version: latest is explicitly set in a workflow
  • pkg/workflow/compiler_orchestrator_workflow.go: Wire validateEngineVersion into the compilation pipeline
  • pkg/workflow/engine_helpers.go: BuildStandardNpmEngineInstallSteps now always passes false for runInstallScripts, ensuring engine CLI installs always use --ignore-scripts regardless of the workflow's run-install-scripts setting
  • pkg/workflow/copilot_installer.go: Update stale comment
  • pkg/workflow/engine_validation_test.go: Add tests for validateEngineVersion
  • Golden test data and all 182 compiled lock files updated with pinned versions

Security

  • Unpinned latest versions can change unpredictably and introduce vulnerabilities or breaking changes
  • Engine CLI installs are now always hardened with --ignore-scripts even when run-install-scripts: true is set for user packages
  • The new validateEngineVersion validator surfaces explicit engine.version: latest usage as a supply chain security warning at compile time

…rity

- Pin DefaultCopilotVersion=1.0.20, DefaultClaudeCodeVersion=2.1.92,
  DefaultCodexVersion=0.118.0, DefaultGeminiVersion=0.36.0
- Add validateEngineVersion() warning when engine.version: latest is set
- Always use --ignore-scripts for engine CLI npm installs
- Update golden test data and all compiled lock files

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6febda3c-ad27-41a8-9d4f-553aa6b045fa

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 7, 2026 15:14
Copilot AI review requested due to automatic review settings April 7, 2026 15:14
@pelikhan pelikhan merged commit fdc8611 into main Apr 7, 2026
49 of 58 checks passed
@pelikhan pelikhan deleted the copilot/update-agentic-versions branch April 7, 2026 15:15
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

Pins agentic engine CLI versions to fixed releases and hardens installation behavior to improve supply chain security and reproducibility, while surfacing explicit engine.version: latest usage during compilation.

Changes:

  • Pin default engine CLI versions in constants (Copilot/Claude/Codex/Gemini) instead of using "latest".
  • Add a compiler validation that warns (or errors in strict mode) when engine.version: latest is explicitly set.
  • Force engine CLI npm installs to always use --ignore-scripts, independent of the workflow’s run-install-scripts setting, and update golden/lock artifacts accordingly.
Show a summary per file
File Description
pkg/constants/version_constants.go Replaces "latest" defaults with pinned engine CLI versions.
pkg/workflow/engine_validation.go Adds validateEngineVersion() to warn/error on explicit engine.version: latest.
pkg/workflow/compiler_orchestrator_workflow.go Wires validateEngineVersion() into the workflow parse/compile pipeline.
pkg/workflow/engine_helpers.go Forces GenerateNpmInstallSteps(..., runInstallScripts=false) for engine CLI installs (always --ignore-scripts).
pkg/workflow/copilot_installer.go Updates installer comment to reflect pinned default behavior.
pkg/workflow/engine_validation_test.go Adds tests for validateEngineVersion().
pkg/workflow/testdata/**.golden Updates wasm golden outputs to reflect pinned versions.
.github/workflows/.lock.yml and pkg/workflow/.lock.yml Bulk updates compiled/locked workflows to use pinned engine versions instead of latest.

Copilot's findings

Tip

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

  • Files reviewed: 195/195 changed files
  • Comments generated: 2

Comment on lines +53 to +60
if workflowData.EngineConfig == nil || workflowData.EngineConfig.Version == "" {
// No explicit version set; the compiler uses its own pinned default.
return nil
}

if !strings.EqualFold(workflowData.EngineConfig.Version, "latest") {
return nil
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

validateEngineVersion compares workflowData.EngineConfig.Version to "latest" without trimming whitespace. Because version values come from YAML via stringutil.ParseVersionValue (which preserves quoted whitespace), a workflow could set engine.version: "latest " and bypass this validation. Consider normalizing with strings.TrimSpace (or trimming at parse time) before the EqualFold check.

Copilot uses AI. Check for mistakes.
Comment on lines +218 to +224
tests := []struct {
name string
engineCfg *EngineConfig
strictMode bool
expectWarn bool
expectError bool
}{
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

TestValidateEngineVersion defines expectWarn in the table but never asserts it, so the test won’t fail if the warning path stops incrementing the warning counter. Mirror TestValidateRunInstallScripts_Warning by resetting/asserting compiler.GetWarningCount() (and/or capturing stderr) for the non-strict "latest" cases, or remove the unused expectWarn field.

Copilot uses AI. Check for mistakes.
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.

3 participants