SentinelAI.Extensions.AI 0.2.0-preview.1

This is a prerelease version of SentinelAI.Extensions.AI.
dotnet add package SentinelAI.Extensions.AI --version 0.2.0-preview.1
                    
NuGet\Install-Package SentinelAI.Extensions.AI -Version 0.2.0-preview.1
                    
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="SentinelAI.Extensions.AI" Version="0.2.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SentinelAI.Extensions.AI" Version="0.2.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="SentinelAI.Extensions.AI" />
                    
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 SentinelAI.Extensions.AI --version 0.2.0-preview.1
                    
#r "nuget: SentinelAI.Extensions.AI, 0.2.0-preview.1"
                    
#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 SentinelAI.Extensions.AI@0.2.0-preview.1
                    
#: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=SentinelAI.Extensions.AI&version=0.2.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SentinelAI.Extensions.AI&version=0.2.0-preview.1&prerelease
                    
Install as a Cake Tool

SentinelAI.Extensions.AI

Runtime security for any IChatClient (Azure OpenAI, OpenAI, Ollama, the Microsoft Agent Framework and anything else built on Microsoft.Extensions.AI).

Preview. The API may change before 1.0.

Install

dotnet add package SentinelAI.Extensions.AI --prerelease

Use

builder.Services.AddSentinelAI();                 // loads sentinel.yaml from the content root

builder.Services.AddChatClient(innerChatClient)
    .UseSentinel()                                // before UseFunctionInvocation()
    .UseFunctionInvocation();

Then tell SentinelAI who is calling, so tool calls can be authorized:

var options = new ChatOptions { Tools = [lookupOrder, issueRefund] }
    .WithSentinelCaller(new SentinelCaller(UserId: user.Id, OwnerId: user.CustomerId));

var response = await chatClient.GetResponseAsync(messages, options);

In ASP.NET Core you can take the caller from the signed-in user instead. See SentinelAI.AspNetCore.

What it does

Stage What happens
User input Scanned before the model is called. If it's blocked, the model never sees it.
Tool calls Every AIFunction is wrapped. Each call is checked against the policy as it runs: unknown tools are denied, and there are ownership checks, amount limits, user-intent checks, destination allowlists and human approval.
Tool results Scanned for instructions aimed at the assistant before the model reads them.
Model output Secrets and personal data are redacted. Replies that would leak data through image URLs are withheld.
Telemetry Every decision is an OpenTelemetry event on the request's trace (source SentinelAI).

Streaming responses are buffered so the full reply can be checked before any of it is shown.

response.AdditionalProperties["sentinel.action"] holds the strongest action taken.

Policy

Put sentinel.yaml in your app (copy it to the output folder). List every tool the agent may call, since tools that aren't listed are blocked:

tools:
  LookupOrder: { action: allow, ownership_arg: customerId }
  IssueRefund:
    action: allow
    ownership_arg: customerId
    require_user_intent: [refund]
    amount_arg: amount
    approval_above: 150
    max_amount: 500
  DeleteAccount: { action: require_approval, ownership_arg: customerId }

Calls that need approval go to your IToolApprovalHandler: services.AddSentinelAI().AddApprovalHandler<MyHandler>(). Without a handler, they aren't executed.

Limits

The built-in prompt-injection rules are regex signatures. They catch obvious attacks, not reworded ones. For real coverage, add an ML classifier under http_scanners in the policy. The tool firewall, redaction and exfiltration blocking are deterministic and don't depend on detecting the attack.

More: https://sentinelaidotnet.com · https://github.com/surya3524/sentinelai-net

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-preview.1 78 10/19/2026
0.1.0-preview.1 68 10/17/2026