System.InvalidOperationException: AuthorizationPolicy must have at least one requirement. means a policy was added with an empty builder: AddPolicy("Staff", policy => { }). Give the policy at least one requirement; with RequireAuthenticatedUser(), the one tested here, the app starts.

In this test the app did not start at all. With policy.RequireAuthenticatedUser() inside the same AddPolicy call it started, and a request without a token got the expected 401.

The error

The server console printed it at Critical level as an application startup exception, then the host stopped; the curl.exe request after it got no answer. The long scratch path before \lab\Program.cs is shortened:

crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.InvalidOperationException: AuthorizationPolicy must have at least one requirement.
         at Microsoft.AspNetCore.Authorization.AuthorizationPolicy..ctor(IEnumerable`1 requirements, IEnumerable`1 authenticationSchemes)
         at Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder.Build()
         at Microsoft.AspNetCore.Authorization.AuthorizationOptions.AddPolicy(String name, Action`1 configurePolicy)
         at Program.<>c.<<Main>$>b__0_0(AuthorizationOptions options) in ...\lab\Program.cs:line 8
...
         at Microsoft.AspNetCore.Authorization.DefaultAuthorizationPolicyProvider..ctor(IOptions`1 options)
...
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
...

Why it happens

The code that produced it:

...
builder.Services.AddAuthorization(options =>
{
    options.AddPolicy("Staff", policy => { });
});
...
app.MapGet("/reports", () => "Monthly report").RequireAuthorization("Staff");
...

The stack trace reads from the bottom up: building the middleware pipeline created the default policy provider, which read the options, which ran the AddPolicy lambda on line 8, whose Build() threw because the builder held no requirement. An empty lambda is easy to leave behind while sketching policies, and it compiles without a warning. The trace shows the failure during startup, so it did not wait for a request to the endpoint that uses the policy.

The fix

...
builder.Services.AddAuthorization(options =>
{
    options.AddPolicy("Staff", policy => policy.RequireAuthenticatedUser());
});
...
PS> curl.exe -s -i http://127.0.0.1:15630/reports
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Sat, 14 Nov 2026 01:26:47 GMT
Server: Kestrel
WWW-Authenticate: Bearer

Pick the requirement the policy is meant to enforce. RequireAuthenticatedUser() lets every signed-in user through, so a policy named Staff built this way does not check that the user is staff at all; it is weaker than a role or claim check and is the right choice only when any signed-in user should pass. Do not remove the policy while /reports still calls RequireAuthorization("Staff"): a name with no policy behind it gives the "AuthorizationPolicy named ... was not found" error linked below.

How it was reproduced

A minimal API made with dotnet new web -f net10.0 on SDK 11.0.100, with Microsoft.AspNetCore.Authentication.JwtBearer 10.0.0, running on Microsoft.AspNetCore.App 10.0.15 in the Development environment, built and started by a small script, start.ps1, which runs dotnet build -nologo -v q in the project folder and then bin\Debug\net10.0\FixLab.exe --urls http://127.0.0.1:15630. The template's log levels were unchanged; the startup exception is logged at Critical, above them. FixLab, port 15630, the route /reports and the policy name Staff are the test's own.

Frequently asked

What does 'AuthorizationPolicy must have at least one requirement' mean?
A policy was added with an empty builder, for example AddPolicy("Staff", policy => { }). In the test the app threw this at startup and never listened for requests.
How do I fix an empty authorization policy in ASP.NET Core?
Add at least one requirement in the AddPolicy lambda. The test used policy.RequireAuthenticatedUser(); the app then started and answered 401 to a request without a token.
Is the empty policy error thrown at startup or on a request?
At startup in the test. The host logged 'Application startup exception' at Critical level and 'Hosting failed to start'.

More decoded errors in the Fixes category. A policy name with no policy behind it gives a different error, covered in 'The AuthorizationPolicy named ... was not found'.