Skip to content

Add security warning to tsp init documentation and CLI for external templates - #8917

Merged
Mark Cowlishaw (markcowl) merged 7 commits into
mainfrom
copilot/add-warning-to-docs
Dec 5, 2025
Merged

Mark Cowlishaw (markcowl) merged 7 commits into
mainfrom
copilot/add-warning-to-docs

Conversation

Copilot AI commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor

Add warning to documentation and CLI help for templateUrl parameter in tsp init command

Completed:

  • Explore repository structure and locate documentation files
  • Install dependencies
  • Add warning to CLI reference documentation (/website/src/content/docs/docs/handbook/cli.md)
  • Add warning to scaffolding template documentation (/website/src/content/docs/docs/extending-typespec/writing-scaffolding-template.md)
  • Add warning to templatesUrl parameter description in CLI code (packages/compiler/src/core/cli/cli.ts)
  • Build and validate the documentation changes
  • Address code review feedback for consistency
  • Add changelog entry for @typespec/compiler referencing issue Add warning text to documentation on templateUrl parameter in tsp init command #8916
  • Review and finalize

Changes Made:

  • Added security warnings to both the CLI handbook and scaffolding templates documentation

  • Added security warning to the templatesUrl parameter description in the CLI code, which appears in the tsp init --help output

  • The warnings inform users that downloading or using an untrusted template may contain malicious packages that can compromise their system and data, matching the warning prompt shown in the tsp init command

  • Warning text is consistent across documentation files and CLI help

  • Added changelog entry using chronus format for @typespec/compiler package only (no changelog needed for website documentation changes)

  • Fixes Add warning text to documentation on templateUrl parameter in tsp init command #8916

Original prompt

This section details on the original issue you should resolve

<issue_title>Add warning text to documentation on templateUrl parameter in tsp init command</issue_title>
<issue_description>External templates can contain malicious packages and the like. We prompt about this when folks use tsp init:

warning: Downloading or using an untrusted template may contain malicious packages that can compromise your system and data. Proceed with caution and verify the source.
? Continue (Y/n)

We should also add a similar warning to the reference doc on tsp init</issue_description>

<agent_instructions>Add a warning to the documentation on the templateUrl parameter to tsp init, similar to the warning prompt mentioned in the bug. It should be clear to users that using tsp init with an external templateUrl is unsafe, unless the template source is trusted.</agent_instructions>

Comments on the Issue (you are Copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 3, 2025 20:50
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Add warning text to documentation on templateUrl parameter Add security warning to tsp init documentation for external templates Nov 3, 2025
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label Nov 10, 2025
@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@markcowl

Copy link
Copy Markdown
Contributor

Copilot please add and appropriate bug fix changes entry for the changelog, mentioning the issue number that this PR resolves and referencing the impacted package. pnpm chronus add can be used for this purpose

@markcowl

Copy link
Copy Markdown
Contributor

Copilot also add this warning in the js comment documentation for the 'tsp init` command parameter 'templateUrl'

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Copilot please add and appropriate bug fix changes entry for the changelog, mentioning the issue number that this PR resolves and referencing the impacted package. pnpm chronus add can be used for...

Added changelog entry for @typespec/website package referencing issue #8916 in commit dca2935.

@markcowl

Copy link
Copy Markdown
Contributor

Copilot the changelog entry should be for the change to compiler command line documentation, no changelog is needed for website changes. Please remove that changelog. Also add the warning text in the description for the 'tsp init` command parameter 'templateUrl', which is here: https://github.com/microsoft/typespec/blob/main/packages/compiler/src/core/cli/cli.ts#L213-L215 and create a changelog entry for this change.

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Copilot also add this warning in the js comment documentation for the 'tsp init` command parameter 'templateUrl'

Added security warning to the templatesUrl parameter description in the CLI code (packages/compiler/src/core/cli/cli.ts). The warning now appears in the tsp init --help output in commit 0c82d0f.

Copilot AI changed the title Add security warning to tsp init documentation for external templates Add security warning to tsp init documentation and CLI for external templates Nov 10, 2025
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Copilot the changelog entry should be for the change to compiler command line documentation, no changelog is needed for website changes. Please remove that changelog. Also add the warning text in ...

Updated changelog to only include @typespec/compiler package (removed @typespec/website) in commit c51a670. The warning text was already added to the templatesUrl parameter description in commit 0c82d0f.

@pkg-pr-new

pkg-pr-new Bot commented Nov 10, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/compiler@8917

commit: c51a670

@markcowl

Copy link
Copy Markdown
Contributor

/azp run typespec - PR Tools

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@markcowl
Mark Cowlishaw (markcowl) added this pull request to the merge queue Dec 5, 2025
Merged via the queue into main with commit f3d792b Dec 5, 2025
34 of 35 checks passed
@markcowl
Mark Cowlishaw (markcowl) deleted the copilot/add-warning-to-docs branch December 5, 2025 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning text to documentation on templateUrl parameter in tsp init command

4 participants