Vectra.Client.Net
1.0.0
dotnet add package Vectra.Client.Net --version 1.0.0
NuGet\Install-Package Vectra.Client.Net -Version 1.0.0
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="Vectra.Client.Net" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vectra.Client.Net" Version="1.0.0" />
<PackageReference Include="Vectra.Client.Net" />
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 Vectra.Client.Net --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vectra.Client.Net, 1.0.0"
#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 Vectra.Client.Net@1.0.0
#: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=Vectra.Client.Net&version=1.0.0
#tool nuget:?package=Vectra.Client.Net&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Vectra SDK for .NET
Official .NET client library for Vectra — the Intent-Aware Governance Gateway for Autonomous AI Agents.
Vectra sits between your AI agents and the outside world, enforcing governance policies, intercepting high-risk actions, and routing requests through Human-in-the-Loop (HITL) review when needed.
Installation
dotnet add package Vectra.Client.Net
Quick Start
// Register with the DI container (ASP.NET Core / Generic Host)
builder.Services.AddVectraClient(options =>
{
options.BaseUrl = "http://localhost:7080";
options.BearerToken = "your-jwt-token"; // optional — see Token Authentication
});
// Inject and use
public class MyService(IVectraClient vectra)
{
public async Task RunAsync(CancellationToken ct)
{
var agents = await vectra.Agents.ListAsync(page: 1, pageSize: 10, ct);
var policies = await vectra.Policies.ListAsync(cancellationToken: ct);
var pending = await vectra.Hitl.GetAllPendingAsync(cancellationToken: ct);
}
}
Features
- Agent Management — Register, list, assign policies to, and delete AI agents
- JWT Authentication — Exchange agent credentials for a scoped Bearer token with a single call
- Policy Inspection — List and inspect the governance policies configured in your gateway
- HITL Review Workflows — Retrieve pending review requests and approve or deny them programmatically
- First-class DI support —
AddVectraClient(...)wires up all typed HTTP clients in one line - Automatic Bearer token injection — Set
BearerTokenonce; every outgoing request carries the header - Structured exceptions —
VectraApiExceptionandVectraAuthenticationExceptionexpose the HTTP status code and the server error payload - Full cancellation support — Every async method accepts a
CancellationToken - Pagination — All list operations accept
pageandpageSizeparameters
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
BaseUrl |
string |
(required) | Base URL of the Vectra gateway |
BearerToken |
string? |
null |
Static JWT injected as Authorization: Bearer <token> |
Timeout |
TimeSpan |
00:00:30 |
Per-request HTTP timeout |
ThrowOnError |
bool |
true |
Throw VectraApiException on non-2xx responses |
API Reference
IVectraClient
├── .Agents → IVectraAgentClient
├── .Policies → IVectraPolicyClient
├── .Hitl → IVectraHitlClient
└── .Tokens → IVectraTokenClient
Agent Management
var agents = await vectra.Agents.ListAsync(page: 1, pageSize: 25, ct);
var result = await vectra.Agents.RegisterAsync(new RegisterAgentRequest
{
Name = "my-research-agent",
OwnerId = "team-backend",
ClientSecret = "super-secret-value"
}, ct);
await vectra.Agents.AssignPolicyAsync(result.AgentId, new AssignPolicyRequest
{
PolicyName = "strict-outbound"
}, ct);
await vectra.Agents.DeleteAsync(result.AgentId, ct);
Token Authentication
GenerateTokenResult token = await vectra.Tokens.GenerateAsync(new GenerateTokenRequest
{
AgentId = agentId,
ClientSecret = "super-secret-value"
}, ct);
Policy Inspection
var policies = await vectra.Policies.ListAsync(page: 1, pageSize: 25, ct);
var details = await vectra.Policies.GetAsync("strict-outbound", ct);
HITL Workflows
var queue = await vectra.Hitl.GetAllPendingAsync(page: 1, pageSize: 25, ct);
// Approve
await vectra.Hitl.ApproveAsync(queue[0].Id, new ReviewDecisionRequest
{
Comment = "Verified safe by on-call engineer."
}, ct);
// Deny
await vectra.Hitl.DenyAsync(queue[0].Id, new ReviewDecisionRequest
{
Comment = "Blocked: unexpected data-exfiltration attempt."
}, ct);
Error Handling
try
{
var policy = await vectra.Policies.GetAsync("unknown-policy", ct);
}
catch (VectraAuthenticationException ex)
{
// 401 or 403
}
catch (VectraApiException ex) when (ex.StatusCode == 404)
{
// Not found
}
catch (VectraApiException ex)
{
// All other non-2xx responses
}
Links
© Cortexium Labs. All rights reserved.
| Product | Versions 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.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
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 |
|---|---|---|
| 1.0.0 | 186 | 5/18/2026 |