You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(workflows): require consent before loading custom steps - #5182
Require explicit, per-invocation consent before importing project custom workflow step Python. Discovered packages and project installation records no longer implicitly authorize execution.
Interactive commands prompt with a default of No; --trust-steps explicitly authorizes all custom step packages for the current invocation, including unattended use. This applies to workflow add, update, run, and resume. Approval is not persisted, and projects without custom steps need no approval.
Preserve JSON failure reporting, add regression coverage, and document the trust boundary and option.
Testing
Tested locally with uv run specify --help
Ran existing tests with uv sync && uv run pytest
Tested with a sample project (if applicable)
Actual commands used the worktree-local environment as recommended in CONTRIBUTING.md:
Sample-project coverage was automated through temporary CLI test projects, covering approval, refusal, noninteractive invocation, explicit opt-in, and JSON output. No manual human testing is claimed.
AI Disclosure
I did not use AI assistance for this contribution
I did use AI assistance (fill in the disclosure below)
AI disclosure: Authored with GitHub Copilot using GPT-6.1 Sol, default configured reasoning settings, and autonomous agent execution under user-directed scope. Assistance included code, test, documentation, and PR-text generation, plus automated validation. The initial assessment also used a security-review subagent whose model was not reported.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unattended bundle operations fail in projects with custom steps because required consent cannot be passed through, and a warning assertion is vulnerable to Rich line wrapping.
Adds an explicit trust boundary before Spec Kit imports project custom workflow-step Python. Discovered packages and installation records no longer imply permission to execute code.
Changes:
Adds per-invocation --trust-steps and default-No interactive approval for workflow add, update, run, and resume.
Preserves JSON failure reporting and prevents approval reuse.
Adds consent regression coverage and updates trust documentation.
Validation was limited to source inspection; tests and before/after comparisons were not run.
AI assistance: GitHub Copilot for the requesting reviewer; model/settings unavailable; autonomous code review.
Expose --trust-steps on bundle add, install, update, and init and forward it through bundled and catalog workflow delegates without granting implicit approval. Cover refusal and opt-in for both sources, and normalize wrapped warning assertions with narrow-console regression coverage.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Bundle-wide trust approval is not reused by later workflow delegates, causing repeated prompts whose refusal or end of input can fail the bundle and roll back newly installed components.
Reuse bundle-local trust approval across workflow delegates
src/specify_cli/bundles/primitives.py:546
For a bundle with multiple workflows, accepting “Trust all custom workflow step code for this invocation?” still leaves later delegates receiving False, so they prompt again. A later refusal or end of input fails the bundle and can roll back newly installed components. Carry approval in bundle-invocation-local state and reuse it for both workflow delegate paths (also line 574), without carrying it into later commands.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Both workflow delegates re-resolve relative SPECIFY_INIT_DIR after changing directories, allowing a nested project's custom Python to be imported using approval granted to a different project.
Canonicalize workflow manager roots and pin SPECIFY_INIT_DIR to the selected absolute root during delegated commands, restoring the caller's override and working directory afterward. Cover nested-project imports for bundled and catalog workflows, explicit and interactive consent, and relative manager roots.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because multi-bundle updates can reuse prior approval to import newly installed step-package code without renewed user consent.
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
triage-must-haveVerdict: high-value, important work for Spec Kit — do first
2 participants
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.
Description
Require explicit, per-invocation consent before importing project custom workflow step Python. Discovered packages and project installation records no longer implicitly authorize execution.
Interactive commands prompt with a default of No;
--trust-stepsexplicitly authorizes all custom step packages for the current invocation, including unattended use. This applies toworkflow add,update,run, andresume. Approval is not persisted, and projects without custom steps need no approval.Preserve JSON failure reporting, add regression coverage, and document the trust boundary and option.
Testing
uv run specify --helpuv sync && uv run pytestActual commands used the worktree-local environment as recommended in CONTRIBUTING.md:
uv sync --extra test --quietuv run --no-sync specify --helpLC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests -q -n 4Sample-project coverage was automated through temporary CLI test projects, covering approval, refusal, noninteractive invocation, explicit opt-in, and JSON output. No manual human testing is claimed.
AI Disclosure
AI disclosure: Authored with GitHub Copilot using GPT-6.1 Sol, default configured reasoning settings, and autonomous agent execution under user-directed scope. Assistance included code, test, documentation, and PR-text generation, plus automated validation. The initial assessment also used a security-review subagent whose model was not reported.