ControlAgentNet.Guards.Policies 0.1.5

dotnet add package ControlAgentNet.Guards.Policies --version 0.1.5
                    
NuGet\Install-Package ControlAgentNet.Guards.Policies -Version 0.1.5
                    
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="ControlAgentNet.Guards.Policies" Version="0.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ControlAgentNet.Guards.Policies" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="ControlAgentNet.Guards.Policies" />
                    
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 ControlAgentNet.Guards.Policies --version 0.1.5
                    
#r "nuget: ControlAgentNet.Guards.Policies, 0.1.5"
                    
#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 ControlAgentNet.Guards.Policies@0.1.5
                    
#: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=ControlAgentNet.Guards.Policies&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=ControlAgentNet.Guards.Policies&version=0.1.5
                    
Install as a Cake Tool

ControlAgentNet.Guards.Policies

Policy-aware guards that integrate with the ControlAgentNet policy system.

Features

  • PolicyEnforcementGuard - Enforces runtime policies
  • Reads from IToolPolicyStore
  • Respects Disabled, Enabled, ApprovalRequired

Installation

dotnet add package ControlAgentNet.Guards.Policies
dotnet add package ControlAgentNet.Policies.Sqlite

Usage

using ControlAgentNet.Guards.Policies;
using ControlAgentNet.Policies.Sqlite;

builder.Services
    .AddSqlitePolicyStore("policies.db")
    .AddPolicyEnforcementGuard();

// Configure policies
var policyStore = services.GetRequiredService<IToolPolicyStore>();
await policyStore.SetToolPolicyAsync("admin_tool", PolicyValue.Disabled);
await policyStore.SetToolPolicyAsync("send_money", PolicyValue.ApprovalRequired);

Scope Support

PolicyEnforcementGuard now evaluates policies using the scope data available on ToolExecutionRequest:

  • TenantId
  • AgentId
  • ChannelId
  • UserId

If only UserId is present, it still enforces user-specific and global policies correctly.

Build

dotnet restore ControlAgentNet.Guards.Policies.slnx
dotnet build ControlAgentNet.Guards.Policies.slnx -c Release
dotnet test ControlAgentNet.Guards.Policies.slnx -c Release --no-build
dotnet pack ControlAgentNet.Guards.Policies.slnx -c Release -o artifacts/nuget

Versioning

  • local builds: 0.1.5-dev
  • pull requests: 0.1.5-preview.<run_number>
  • pushes to main: 0.1.5-alpha.<run_number>
  • tags like v0.1.5: exact stable package version 0.1.5

See VERSIONING.md for the release flow.

How It Works

User tries to use tool
  ↓
PolicyEnforcementGuard checks policy
  ├─ Disabled → DENY
  ├─ ApprovalRequired → REQUIRE_APPROVAL
  └─ Enabled/Inherit → ALLOW
Product Compatible and additional computed target framework versions.
.NET 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

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.1.5 106 4/15/2026