![]() |
VOOZH | about |
dotnet add package Pervaxis.Core.AI --version 1.6.0
NuGet\Install-Package Pervaxis.Core.AI -Version 1.6.0
<PackageReference Include="Pervaxis.Core.AI" Version="1.6.0" />
<PackageVersion Include="Pervaxis.Core.AI" Version="1.6.0" />Directory.Packages.props
<PackageReference Include="Pervaxis.Core.AI" />Project file
paket add Pervaxis.Core.AI --version 1.6.0
#r "nuget: Pervaxis.Core.AI, 1.6.0"
#:package Pervaxis.Core.AI@1.6.0
#addin nuget:?package=Pervaxis.Core.AI&version=1.6.0Install as a Cake Addin
#tool nuget:?package=Pervaxis.Core.AI&version=1.6.0Install as a Cake Tool
AWS Bedrock Converse API integration with guardrail evaluation, human approval gating, versioned prompt registry, and fully traceable AI invocation results. Implements Section 18 of the Pervaxis Platform Spec.
dotnet add package Pervaxis.Core.AI
builder.Services.AddPervaxisAI(options =>
{
options.Bedrock.DefaultModelId = BedrockModelIds.ClaudeSonnet46;
options.Bedrock.Region = "us-east-1";
});
Configuration via appsettings.json:
{
"Pervaxis": {
"AI": {
"Bedrock": {
"DefaultModelId": "us.anthropic.claude-sonnet-4-6-20251101-v1:0",
"Region": "us-east-1",
"MaxTokens": 2048,
"Temperature": 0.3
}
}
}
}
BedrockModelIds.ClaudeSonnet46 // us.anthropic.claude-sonnet-4-6-20251101-v1:0
BedrockModelIds.ClaudeOpus46 // us.anthropic.claude-opus-4-6-20251101-v1:0
BedrockModelIds.ClaudeHaiku45 // us.anthropic.claude-haiku-4-5-20251001-v1:0
BedrockModelIds.NovaProV1 // us.amazon.nova-pro-v1:0
BedrockModelIds.TitanEmbeddingsV2 // amazon.titan-embed-text-v2:0
public class TriageService(IBedrockClient bedrock, IPromptRegistry prompts)
{
public async Task<string> AnalyseAsync(string incidentDetail, CancellationToken ct)
{
var prompt = prompts.GetLatest("triage.root-cause-analysis");
var result = await bedrock.InvokeAsync(new AiInvocationRequest
{
SystemPrompt = prompt.Render(new Dictionary<string, string>
{
["serviceName"] = "order-service"
}),
UserMessage = incidentDetail,
PromptKey = prompt.Key,
PromptVersion = prompt.Version,
RiskLevel = AiRiskLevel.Low,
CorrelationId = correlationId
}, ct);
return result.Output;
}
}
Every invocation flows through:
Request → GuardrailPolicy.EvaluateAsync()
↓ Blocked → throw
→ ApprovalGate.RequiresApproval(riskLevel)?
↓ Yes → ApprovalGate.RequestApprovalAsync()
→ BedrockRuntime.ConverseAsync()
→ AiInvocationResult<string> (fully traceable)
// Register prompts at startup
registry.Register(new PromptDefinition
{
Key = "triage.root-cause-analysis",
Version = "1.0.0",
Content = "You are a {serviceName} expert. Analyse: {incident}",
RiskLevel = AiRiskLevel.Low
});
// Retrieve by exact version or latest
var prompt = registry.Get("triage.root-cause-analysis", "1.0.0");
var latest = registry.GetLatest("triage.root-cause-analysis");
// Render with variables
var rendered = prompt.Render(new Dictionary<string, string>
{
["serviceName"] = "order-service",
["incident"] = "DB connection timeout"
});
| Risk Level | AutoApprovalGate Behaviour |
|---|---|
Low |
Auto-approved |
Medium |
Auto-approved |
High |
Throws InvalidOperationException — replace with real gate |
Critical |
Throws InvalidOperationException — replace with real gate |
For production, register a real IAiActionApprovalGate (ServiceNow, Slack workflow, etc.):
builder.Services.AddScoped<IAiActionApprovalGate, ServiceNowApprovalGate>();
public sealed class ContentFilterPolicy : IAiGuardrailPolicy
{
public string PolicyName => "content-filter";
public Task<GuardrailResult> EvaluateAsync(
AiInvocationRequest request, CancellationToken ct = default)
{
if (request.UserMessage.Contains("DROP TABLE"))
return Task.FromResult(GuardrailResult.Block(PolicyName, "SQL injection attempt"));
return Task.FromResult(GuardrailResult.Pass());
}
}
// Register
builder.Services.AddAiGuardrailPolicy<ContentFilterPolicy>();
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:Converse"],
"Resource": "arn:aws:bedrock:us-east-1::foundation-model/*"
}
Pervaxis Platform · Clarivex Technologies · https://clarivex.tech
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.0 | 95 | 6/6/2026 |