Skip to main content

.NET

The Adjudon .NET SDK is the integration path for ASP.NET Core backends and Microsoft-shop deployments — the dominant stack at large insurers and the public-sector tenants that shape Adjudon's Frankfurt eu-central-1 footprint. The package targets .NET 8 and .NET 9 and ships as Adjudon on NuGet, with a Adjudon.AspNetCore companion that registers the client into the dependency-injection container and a Adjudon.HostedService extension for background workers. Runtime dependencies are limited to System.Text.Json and HttpClient; no Newtonsoft, no RestSharp, no transitive surprises in a regulated build.

Status: Public roadmap

The .NET SDK is on the published roadmap with a NuGet release target of Q3 2026. Until then, .NET integrations call the Traces API directly with HttpClient

  • System.Text.Json; the wire contract is identical and a hand-rolled client ports cleanly to the SDK once it ships. This page documents the SDK shape as it will land.

Install

dotnet CLI (target Q3 2026)
dotnet add package Adjudon
dotnet add package Adjudon.AspNetCore
.csproj
<PackageReference Include="Adjudon" Version="0.1.0" />
<PackageReference Include="Adjudon.AspNetCore" Version="0.1.0" />

First call

Plain C#
using Adjudon;

var adjudon = new AdjudonClient(new AdjudonOptions {
ApiKey = Environment.GetEnvironmentVariable("ADJUDON_API_KEY")!, // adj_agent_<48-hex>
AgentId = "customer-support-bot"
});

var trace = await adjudon.TraceAsync(new TraceRequest {
InputContext = new { prompt = "Can I get a refund for order #1234?" },
OutputDecision = new { action = "initiate_refund", confidence = 0.91 }
});

if (trace.Status == TraceStatus.Blocked)
{
return Results.StatusCode(403);
}
ASP.NET Core — auto-wired
// Program.cs
builder.Services.AddAdjudon(opts => {
opts.ApiKey = builder.Configuration["Adjudon:ApiKey"]!;
opts.AgentId = "customer-support-bot";
});

// RefundEndpoint.cs
public static async Task<IResult> Refund(
RefundRequest req,
IAdjudonClient adjudon)
{
var trace = await adjudon.TraceAsync(new TraceRequest {
InputContext = req.ToInputContext(),
OutputDecision = new { action = "initiate_refund", amount = req.Amount }
});

return trace.Status switch {
TraceStatus.Blocked => Results.StatusCode(403),
TraceStatus.Flagged => Results.Accepted(value: trace),
_ => Results.Ok(trace)
};
}

AddAdjudon() registers IAdjudonClient as a singleton, configures the underlying HttpClient via IHttpClientFactory (so a Polly policy or mTLS handler can be layered), and wires the standard configuration binding from appsettings.json.

Versions

RuntimeSupported
.NET 8 LTS✓ (minimum)
.NET 9✓ (current)
ASP.NET Core 8 / 9
.NET 6 / 7— (out of upstream support)
.NET Framework 4.x— (use the HTTP API directly)

Configuration

appsettings.json
{
"Adjudon": {
"ApiKey": "${ADJUDON_API_KEY}",
"AgentId": "customer-support-bot",
"FailMode": "Open",
"Timeout": "00:00:10",
"MaxRetries": 3
}
}
FieldDefaultDescription
ApiKey(required)adj_agent_<48-hex>
AgentId(required)Stable agent identifier
BaseUrlhttps://api.adjudon.comOverride for self-hosted Adjudon
FailModeOpenOpen returns Passthrough on failure; Closed raises
TimeoutTimeSpan.FromSeconds(10)HTTP timeout
MaxRetries3Retry attempts on 429 / 5xx

The .NET configuration system binds Adjudon:* from appsettings.json, environment variables (with __ separator), Azure Key Vault, or any IConfigurationProvider — the SDK does not care which.

Idempotency

adjudon.TraceAsync(req, idempotencyKey) accepts a string. If omitted, the SDK generates a Guid per call. Duplicate keys within the 24-hour window return the cached response, so retry storms during a transient network hiccup never inflate the org's metered trace count.

Errors

ExceptionCause
AdjudonAuthExceptionInvalid API key; never retried
AdjudonRateLimitExceptionRetries exhausted on 429 (only when FailMode = Closed)
AdjudonTimeoutExceptionRetries exhausted on timeout (only when FailMode = Closed)
AdjudonBlockedExceptionPolicy returned block; always propagated as a compliance signal
AdjudonConfigExceptionOptions invalid at registration

FailMode = Open returns TraceResponse.Passthrough() for every exception except AdjudonBlockedException and AdjudonAuthException — the first is a compliance signal you must not swallow, the second is a configuration bug.

Native AOT & trimming

The package targets .NET 8's Native AOT compilation path: every public type is annotated with DynamicallyAccessedMembers where the JSON serialiser needs reflection, and the source generators in System.Text.Json produce trim-safe contexts at build time. A PublishAot=true ASP.NET Core deployment links the Adjudon SDK without trim warnings; the resulting single-file binary runs on Azure Container Apps and AWS Lambda with cold-start times measured in milliseconds.

Resources

  • Quickstart — first trace in 60 seconds
  • Authentication — API key formats and rotation
  • Traces API — the underlying HTTP surface this SDK calls (use this directly until the NuGet release lands)
  • Error Codes — HTTP-level errors this SDK raises
  • GitHub: github.com/adjudon/adjudon-dotnet (target repository for source, issues, and releases when the SDK ships)