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
Commit 33a3e55
Browse filesBrowse the repository at this point in the historyBrowse files
.Net: [BREAKING] Upgrade Prompty.Core to 2.0.0-beta.3 to resolve NU1903 vulnerability (#14169)
## Motivation and Context
CI (`dotnet-build-and-test`) currently fails repo-wide on **NU1903**:
`Prompty.Core` `0.2.3-beta` has a known high severity advisory
[GHSA-wxhm-2mq7-7697](GHSA-wxhm-2mq7-7697)
(path traversal in `${file:...}` reference expansion). The build treats
the audit as an error (`--warnaserror`), so this blocks every .NET PR.
The advisory is fixed in `Prompty.Core` **2.0.0-beta.2+**. That release
is a significant rewrite: it targets **net9.0 only** and ships a new
`.prompty` spec and API. There is no intermediate 0.x fix, so resolving
the advisory requires this upgrade.
## Description
Upgrades `Prompty.Core` `0.2.3-beta` → `2.0.0-beta.3` and adapts
Semantic Kernel to the 2.0 surface.
- **Package**: bump `Prompty.Core` in `Directory.Packages.props`; remove
the `Scriban` workaround reference (2.0 no longer depends on it).
- **Target frameworks**: retarget `Functions.Prompty` to `net10.0` only.
The fixed package is net9.0-only, so `net8.0` and `netstandard2.0` can
no longer be supported.
- **Loader migration** (`KernelFunctionPrompty`):
- Text input: `FrontmatterParser.Parse` + `Prompty.Load`.
- File input: secure `PromptyLoader.Load` with `AllowedFileRoots` scoped
to the prompty file's directory, so `${file:...}` references are
confined (the fix for the advisory).
- Parse failures are normalized to `ArgumentException` to preserve the
input-validation contract.
- **Test data + tests**: migrate the `.prompty` files to the 2.0 spec
(`apiType`, list-form `inputs`, renamed `options`) and update
`PromptyTests` accordingly.
- **Samples**: update the `Concepts` inline templates to the 2.0 spec.
## ⚠️ Breaking changes
`Microsoft.SemanticKernel.Prompty` is a preview (`-beta`) package. This
change:
- **Drops `net8.0` and `netstandard2.0`** support (now `net10.0` only).
- Requires `.prompty` files to use the **2.0 spec** (`model.apiType`,
`model.provider`, `connection.kind`, `inputs`/`outputs` as lists,
renamed `model.options`). v1 files are not auto-migrated. See the
[Prompty v1→v2 migration guide](https://www.prompty.ai/migration/).
- No longer surfaces the following, which are not part of the 2.0 model:
input/output `json_schema`, connection `service_id`, and arbitrary
`model.options` passthrough beyond the strongly typed set.
## Validation
- `Functions.Prompty.UnitTests`: **22/22 pass** (Release,
`--warnaserror`).
- `Functions.Prompty` and `Concepts` build clean, **no NU1903**.
- `dotnet format --verify-no-changes` clean on changed projects.
- Behavior coherence: rendered prompt output for the `Concepts` samples
is **byte-for-byte identical** to the previously published package, and
the samples were run end-to-end against a live model with the expected
results.
## Contribution Checklist
- [x] The code builds clean without errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] All unit tests pass, and I have added/updated tests where possible
- [x] I didn't break anyone 😄
<!-- Adding Scriban directly to use latest version number to avoid a vulnerability issue. Can be removed later once Prompty.Core references an updated version -->
0 commit comments