Skip to content

feat(site)!: add consent prompt for auto-creation with prefilled parameters#22011

Merged
kacpersaw merged 14 commits intomainfrom
kacpersaw/consent-prompt-auto-create
Feb 12, 2026
Merged

feat(site)!: add consent prompt for auto-creation with prefilled parameters#22011
kacpersaw merged 14 commits intomainfrom
kacpersaw/consent-prompt-auto-create

Conversation

@kacpersaw
Copy link
Contributor

@kacpersaw kacpersaw commented Feb 9, 2026

Summary

Workspace created via mode=auto links now require explicit user confirmation before provisioning. A warning dialog shows all prefilled param.* values from the URL and blocks creation until the user clicks Confirm and Create. Clicking Cancel falls back to the standard form view.

auto-create-consent-dialog

Breaking behavior change

Links using mode=auto (e.g., "Open in Coder" buttons) will no longer silently create workspaces. Users will now see a consent dialog and must explicitly confirm before the workspace is provisioned. Any existing integrations or automation relying on mode=auto for seamless workspace creation will now require manual user interaction.

@kacpersaw kacpersaw marked this pull request as ready for review February 9, 2026 14:45
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 9, 2026

Documentation Check

Updates Needed

  • docs/admin/templates/open-in-coder.md - Update section 4 (line 100-108, "Optional: pre-fill parameter values") to mention the new consent dialog that appears when using mode=auto with prefilled parameters. Users will see a warning dialog showing all param.* values and must click "Confirm and Create" before the workspace is created.

    ⚠️ No documentation changes found in this PR - still needs to be addressed

  • docs/admin/templates/extending-templates/parameters.md - Update "Create Autofill" section (lines 408-428) to document the security consent dialog that appears when URL param.* parameters are used with automatic workspace creation. The dialog warns users about running scripts from untrusted sources and displays all prefilled parameter values for review.

    ⚠️ No documentation changes found in this PR - still needs to be addressed

Context

This PR adds an important security feature: when a workspace creation link uses mode=auto with prefilled parameters, users now see a consent dialog before the workspace is automatically created. The dialog:

  • Shows a warning icon and "Warning: Automatic Workspace Creation" title
  • Warns that "Running scripts from untrusted sources can be dangerous"
  • Lists all prefilled parameter names and values in a scrollable code block
  • Requires explicit "Confirm and Create" action (or "Cancel" to fall back to form view)

This protects users from malicious workspace creation links that could execute arbitrary code via template parameters like dotfiles_uri or startup_script.

Latest update (2026-02-11): Added Storybook stories for the dialog component (including scenarios with many parameters and long values), updated E2E tests to handle the consent dialog flow, and addressed PR review feedback. The implementation is complete and tested, but documentation still needs to be updated.


Automated review via Coder Tasks

@jdomeracki-coder
Copy link
Contributor

Size of the dialog box should be set dynamically - currently it doesn't fit longer than usual params

Screenshot 2026-02-09 at 16 38 19

Copy link
Contributor

@jdomeracki-coder jdomeracki-coder left a comment

Choose a reason for hiding this comment

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

Works as intended 🧪

Copy link
Contributor

@jakehwll jakehwll left a comment

Choose a reason for hiding this comment

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

Left my nits about how the <Dialog /> is formed, fine otherwise 🙂

@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 11, 2026

Documentation Check

Updates Needed

  • docs/admin/templates/open-in-coder.md - Document the new security consent dialog that appears when using mode=auto with prefilled parameters
    • Explain that users must explicitly confirm workspace creation when parameters are prefilled via URL
    • Show what information is displayed (all param.* values from the URL)
    • Explain the security rationale (protecting against malicious URLs with untrusted configurations like dotfiles or startup scripts)
    • Consider adding a screenshot of the consent dialog

Automated review via Coder Tasks

@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 11, 2026

Documentation Check

Updates Needed

  • docs/admin/templates/open-in-coder.md - Document the new security consent dialog that appears when using mode=auto with prefilled parameters
    • ✅ Added comprehensive "Security: consent dialog for automatic creation" section
    • ✅ Explains user must explicitly confirm workspace creation
    • ✅ Lists what information is displayed in the dialog
    • ✅ Provides security rationale (protection against malicious links)
    • ✅ Includes screenshot of the consent dialog

All documentation requirements have been addressed in the latest commits.


Automated review via Coder Tasks

@kacpersaw kacpersaw requested a review from matifali February 12, 2026 10:22
@kacpersaw kacpersaw changed the title feat(site): add consent prompt for auto-creation with prefilled parameters feat(site)!: add consent prompt for auto-creation with prefilled parameters Feb 12, 2026
@github-actions github-actions bot added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Feb 12, 2026
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

Thanks. Can you also add a small note calling the breaking behaviour? Will help write changelog

@matifali
Copy link
Member

Another minor nit on the color of the button. Do we have another option, as red is usually used for destructive operations?
cc: @chrifro

@kacpersaw
Copy link
Contributor Author

Another minor nit on the color of the button. Do we have another option, as red is usually used for destructive operations? cc: @chrifro

@matifali
We can use our default variant for a button. WDYT?
image

@matifali
Copy link
Member

@kacpersaw, yes, this looks better to me.

@kacpersaw
Copy link
Contributor Author

@kacpersaw, yes, this looks better to me.

@matifali done! 👍

@kacpersaw kacpersaw merged commit 60e3ab7 into main Feb 12, 2026
36 of 39 checks passed
@kacpersaw kacpersaw deleted the kacpersaw/consent-prompt-auto-create branch February 12, 2026 14:39
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release/breaking This label is applied to PRs to detect breaking changes as part of the release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants