Devolutions.Now.Policy.Api 2026.9.3

Prefix Reserved
dotnet add package Devolutions.Now.Policy.Api --version 2026.9.3
                    
NuGet\Install-Package Devolutions.Now.Policy.Api -Version 2026.9.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Devolutions.Now.Policy.Api" Version="2026.9.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Devolutions.Now.Policy.Api" Version="2026.9.3" />
                    
Directory.Packages.props
<PackageReference Include="Devolutions.Now.Policy.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Devolutions.Now.Policy.Api --version 2026.9.3
                    
#r "nuget: Devolutions.Now.Policy.Api, 2026.9.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Devolutions.Now.Policy.Api@2026.9.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Devolutions.Now.Policy.Api&version=2026.9.3
                    
Install as a Cake Addin
#tool nuget:?package=Devolutions.Now.Policy.Api&version=2026.9.3
                    
Install as a Cake Tool

Devolutions NOW package broker API for .NET

Devolutions.Now.Policy.Api contains the .NET DTOs for the Devolutions NOW package broker API. It is the C# mirror of the Rust now-policy-api model crate and is validated against the OpenAPI schema generated from Rust.

Purpose

This package contains request, response, status, health, capabilities, active-policy inspection and management, and error DTOs for package broker clients and implementations. It does not perform HTTP transport, named-pipe I/O, policy validation/evaluation, persistence, or package-manager execution.

Top-level request DTOs carry RequestKind and RequestVersion; top-level response DTOs carry ResponseKind and ResponseVersion. Kind properties are fixed discriminators that serialize automatically and reject mismatched values on deserialization. This is required for further protocol evolution and allows the client to switch transport from HTTP to other mechanisms without changing the wire schema.

The DTOs are used to:

  • serialize package broker requests from .NET clients;
  • deserialize broker health, capability, active-policy, evaluation, execution, status, and error responses;
  • share the same JSON wire shape as the Rust source-of-truth model;
  • provide compatibility conversions between package broker API enums and the Devolutions.Now.Policy.Model policy enums.

Architecture

  • RequestModels.cs defines PackageRequest and request context/options.
  • ResponseModels.cs defines active-policy, evaluation, and execution responses plus shared response context, summaries, decisions, policy info, diagnostics, and operation submission. PolicyResponse embeds the canonical Devolutions.Now.Policy.Model.PolicyDocument.
  • PolicyManagementModels.cs defines atomic management snapshots, raw JSON draft requests, versioned validation findings/receipts, optimistic replacement intents, and management responses.
  • StatusModels.cs defines status query request/response DTOs.
  • MetaModels.cs defines health, capabilities, manager capability, and error DTOs.
  • Enums.cs defines package broker API enums and JSON string enum converters.
  • BrokerSerializer.cs defines source-generated serializer options for the broker wire format. Public BrokerSerializer.Options and BrokerSerializer.PrettyOptions support every broker DTO, including the embedded policy model, without reflection and reject JSON null for non-nullable contract members.
  • PolicyCompatibility.cs maps compatible API enums to and from Devolutions.Now.Policy.Model enums.

Opaque policy store tokens and validation receipts are restricted to safe printable ASCII (A-Z, a-z, 0-9, ., _, ~, :, -) beginning with an ASCII alphanumeric character, so Rust and .NET enforce identical bounds.

BrokerApi.MaxPolicyManagementBodyBytes exposes the fixed 16 MiB limit for the complete serialized HTTP body of policy validation and replacement requests. It is separate from the package-operation limit advertised by broker capabilities.

Because policy documents are JSON-only, configured .yaml, .yml, extensionless, and other non-JSON paths use PolicyReadOnlyReason.UnsupportedFormat in management snapshots and ErrorCode.UnsupportedPolicyFormat for structured HTTP 422 errors.

OpenAPI relationship

The OpenAPI document is generated by the Rust server template and published under:

policies\rust\now-policy-api\openapi\now-policy-api.yaml

Regenerate it with:

cargo run -p now-policy-server-template --bin generate-now-policy-api-openapi --locked

After schema changes, run the .NET client tests to verify these DTOs still match the Rust contract.

Validation

Useful targeted checks:

dotnet test policies\dotnet\Devolutions.Now.Policy.Client.Tests\Devolutions.Now.Policy.Client.Tests.csproj
dotnet format policies\dotnet\Devolutions.Now.Policy.slnx --verify-no-changes

Run the Rust now-policy-api and now-policy-server-template tests when changing shared API semantics.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Devolutions.Now.Policy.Api:

Package Downloads
Devolutions.Now.Policy.Client

Client logic for communicating with the Devolutions NOW package broker API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.9.3 74 9/3/2026
2026.8.13 986 8/13/2026
2026.8.5 234 8/5/2026
2026.7.28 636 7/28/2026
2026.7.13 519 7/13/2026