Skip to main content

Fixed: MEAI001 'Microsoft.Extensions.AI.ToolApprovalRequestContent.RequiresConfirmation' is for evaluation purposes only

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

I wanted my Microsoft Agent Framework approval loop to skip the person for calls that don't need one, and the build failed: error MEAI001: 'Microsoft.Extensions.AI.ToolApprovalRequestContent.RequiresConfirmation' is for evaluation purposes only and is subject to change or removal in future updates. The property is experimental. Suppressing MEAI001 around the one line that reads it fixes the build.

What I Was Doing​

I was writing the approval loop for the Tool Approval tutorial: an agent with a tool that needs approval, place_order, and one that doesn't, get_stock. When a run ends with ToolApprovalRequestContent items, the loop asks a person about each one.

The reference for ToolApprovalRequestContent.RequiresConfirmation suggested that a request can arrive for a tool that needs no person: When false, the underlying tool does not require a confirmation and the consumer may proceed without prompting; a corresponding ToolApprovalResponseContent still has to be supplied so the originating tool call can be invoked. So I approved those without asking:

Program.cs (the loop, before)
foreach (ToolApprovalRequestContent request in requests)
{
// A call to a tool that doesn't need approval can arrive here too: approve it without asking.
if (!request.RequiresConfirmation)
{
answers.Add(request.CreateResponse(approved: true));
continue;
}

// ...ask the person about the call
}

What I Expected​

A successful build. The project uses only the Agent Framework packages from the tutorials before it, and the property is a public part of Microsoft.Extensions.AI.Abstractions 10.11.0, the version Agent Framework 1.28 brings in.

What I Got​

Output
Restore complete (0.3s)
OfficeSupplies net10.0 failed with 1 error(s) (1.2s)
/Users/you/source/OfficeSupplies/Program.cs(35,14): error MEAI001: 'Microsoft.Extensions.AI.ToolApprovalRequestContent.RequiresConfirmation' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. (https://aka.ms/dotnet-extensions-warnings/MEAI001)

Build failed with 1 error(s) in 1.8s

macOS-style terminal window titled Terminal — OfficeSupplies showing dotnet build failing with error MEAI001 in Program.cs line 35: Microsoft.Extensions.AI.ToolApprovalRequestContent.RequiresConfirmation is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed, with the link aka.ms/dotnet-extensions-warnings/MEAI001

What I Checked​

The link in the message. https://aka.ms/dotnet-extensions-warnings/MEAI001 redirected to the Bing home page when I opened it: there was no page about the diagnostic behind it.

What the compiler's documentation says about experimental APIs. The C# documentation on these errors: If you're consuming an API marked with System.Diagnostics.CodeAnalysis.ExperimentalAttribute, suppress a valid reported diagnostic ID only when you accept that the API can change or be removed. Use #pragma warning disable or add the ID to <NoWarn> in your project file.

Who else reports MEAI001. Not only this property: other experimental Microsoft.Extensions.AI APIs report the same ID (Fixed). A <NoWarn> for the project would agree to all of them at once.

Whether my loop needed the property. I ran the agent with a question that made the model call both tools in one turn. Only place_order came back as an approval request; get_stock ran on its own after I approved the order. In my runs, a request with RequiresConfirmation set to false never arrived. Microsoft's own tool-approval sample doesn't read the property either.

Why It Happens​

RequiresConfirmation is marked experimental in Microsoft.Extensions.AI.Abstractions 10.11.0, with the diagnostic ID MEAI001. Code that uses an experimental API doesn't compile until you agree, by suppressing the diagnostic, that the API can change or be removed.

The Fix​

Suppress MEAI001 around the one line that reads the property, and say why:

Program.cs (the loop, after)
foreach (ToolApprovalRequestContent request in requests)
{
// A call to a tool that doesn't need approval can arrive here too: approve it without asking.
// RequiresConfirmation is experimental in Microsoft.Extensions.AI 10.11 (MEAI001): I accept that it can change.
#pragma warning disable MEAI001
bool needsPerson = request.RequiresConfirmation;
#pragma warning restore MEAI001
if (!needsPerson)
{
answers.Add(request.CreateResponse(approved: true));
continue;
}

// ...ask the person about the call
}

#pragma warning disable and #pragma warning restore agree to the experimental API for the lines between them only, so a different experimental API used later in the file still gets the error.

Or leave the property out​

If your loop answers every request, asking the person each time, it works without the property: a request that needed no confirmation would just get an approval from the person. That's what the Tool Approval tutorial does, with no suppression at all.

After the Fix​

Output
Restore complete (0.3s)
OfficeSupplies net10.0 succeeded (1.4s) → bin/Debug/net10.0/OfficeSupplies.dll

Build succeeded in 2.0s

macOS-style terminal window titled Terminal — OfficeSupplies showing dotnet build succeeding after the pragma: OfficeSupplies net10.0 succeeded and Build succeeded in 2.0s

Common Mistakes​

MistakeWhat happensDo this instead
Adding MEAI001 to <NoWarn> for the whole projectEvery experimental Microsoft.Extensions.AI API compiles without a wordSuppress it around the line that needs it
#pragma warning disable without an IDReal warnings in the rest of the file disappearName the ID, and restore it after the line
Skipping the person for every request in a hurryCalls that needed a decision run without oneSkip only requests whose RequiresConfirmation is false

Troubleshooting​

SymptomLikely causeFix
error MEAI001: 'Microsoft.Extensions.AI.ToolApprovalRequestContent.RequiresConfirmation' is for evaluation purposes onlyThe code reads an experimental property#pragma warning disable MEAI001 around it, or leave the property out
The same error for another member, such as AIFunctionNameAttributeAnother experimental API with the same IDSuppress it where that API is used

FAQ​

Is it safe to use an experimental property?​

It works, and it can change in a later version: that's what suppressing the diagnostic agrees to. Keep the use in one place, as the single line in the fix does, so a change touches one line.

Will the error go away by itself?​

When Microsoft removes the experimental mark in a later version, the property stops reporting MEAI001, and the suppression has nothing left to do.

Conclusion​

MEAI001 on ToolApprovalRequestContent.RequiresConfirmation means the property is experimental in Microsoft.Extensions.AI 10.11. Suppress MEAI001 with #pragma warning disable and restore around the line that reads it, with a comment that says why, or leave the property out when your loop answers every request anyway.

Additional Resources​