AI support copilot Phase 2: gated artisan changes over SSH#3581
Merged
Conversation
Lets the support copilot run server maintenance commands through the same dry-run -> APPROVE -> execute -> report pipeline as other write actions. Disabled by default (SUPPORT_AI_ARTISAN_ENABLED=false). - ArtisanActionRegistry: allowlist of permitted commands with per-argument type validation (email/token/name). Seeded with support:user-audit, support:event-audit, support:user-restore, support:user-update-profile. - ArtisanCommandRunner: builds/validates a plan, dry-runs (write commands get --dry-run; read-only run as-is; raw is never auto-simulated), and executes via the Process array form so values can't be shell-interpreted. Re-validates at execution time rather than trusting the stored approval payload. - Guarded raw fallback (SUPPORT_AI_ARTISAN_ALLOW_RAW): AI-proposed artisan commands are rejected on shell metacharacters and a destructive deny-list (migrate:fresh, db:wipe, tinker, down, ...), treated as writes, APPROVE-gated. - Triage gains the artisan_command case type (only offered when enabled) plus artisan_command_name/artisan_args/artisan_raw_command fields. - Wired into diagnostics (dry-run preview), the approval email (exact command + preview), execute job, and completion email (command + output). setup-check now reports artisan status; allowed_write_actions includes artisan_command. - Tests for registry validation and the raw-command guard; docs updated. Co-authored-by: Cursor <cursoragent@cursor.com>
Add AI support copilot Phase 2: gated artisan changes over SSH
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.