Skip to content

feat(apply): require explicit scope to prevent accidental wide apply#32

Merged
syucream merged 3 commits intomainfrom
feat/apply-scope-guard
Apr 18, 2026
Merged

feat(apply): require explicit scope to prevent accidental wide apply#32
syucream merged 3 commits intomainfrom
feat/apply-scope-guard

Conversation

@syucream
Copy link
Copy Markdown
Contributor

@syucream syucream commented Apr 18, 2026

Summary

  • Require --dangerously-apply-all flag when no scope filter (--ids, --from-git-changes, APPLY_FILTER_BY_TAGS) is specified for the apply command
  • Error message intentionally omits the bypass flag, guiding users toward --ids or --from-git-changes to narrow scope
  • Prevents AI agents from accidentally overwriting all remote workflows with stale local state

Test plan

  • apply without scope flags → rejected with error
  • Error message does not contain dangerously
  • apply --ids <id> → passes validation
  • apply --dangerously-apply-all → passes validation
  • apply with APPLY_FILTER_BY_TAGS env → passes validation
  • All 669 existing tests pass

🤖 Generated with Claude Code

syucream and others added 2 commits April 18, 2026 18:52
Add --dangerously-apply-all flag that must be passed when no scope filter
(--ids, --from-git-changes, APPLY_FILTER_BY_TAGS) is specified. This
prevents AI agents from accidentally applying all workflows when they
intend to update only specific ones.

The error message intentionally does not mention the bypass flag, guiding
users toward --ids or --from-git-changes instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Breaking: apply command now requires explicit scope (--ids,
--from-git-changes, or --dangerously-apply-all).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@syucream syucream self-assigned this Apr 18, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@syucream syucream merged commit 9f6755f into main Apr 18, 2026
5 checks passed
@syucream syucream deleted the feat/apply-scope-guard branch April 18, 2026 12:26
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.

1 participant