.NET SDK
Use Veriproof.Sdk.Core for application-owned actions. Add the Enforce adapter for each framework your application uses.
Try it without an account
using Veriproof.Sdk.Core;
using Veriproof.Sdk.Core.Testing;
await using var local = new VeriproofTestHarness()
.RespondWith(new TestPolicyDecision(PolicyAction.Allow));
var result = await local.Veriproof.GovernAsync(
"claims.pay",
claim,
(context, cancellationToken) =>
claims.PayAsync(context.Input, context.IdempotencyKey, cancellationToken));Govern one action
In the customer portal, open Tools and SDKs. Select your language and adapters, then follow the installation instructions shown there.
The package registry instructions use VeriProof's public GitLab feeds. Installs require no GitLab account or package credential. See SDK access for workstation and CI guidance.
VeriProof packages used here: Veriproof.Sdk.Core, Veriproof.Sdk.Adapter.AgentFramework.
using Veriproof.Sdk.Core;
using Veriproof.Sdk.Core.Industries.Insurance;
await using var veriproof = Veriproof.FromEnvironment();
var result = await veriproof.GovernAsync(
"claims.pay",
claim,
(context, cancellationToken) =>
claims.PayAsync(context.Input, context.IdempotencyKey, cancellationToken),
new GovernOptions
{
Facts = new Dictionary<string, object?> { ["claim_amount"] = claim.Amount },
Industry = [ClaimStatus.PendingPaymentAuthorization.Fact()],
});The core SDK checks the input before it calls claims.PayAsync. It checks output before release through the typed result.Value boundary.
Only Completed, CompletedWithWarning, and Transformed can contain a released value. Reconcile CompletionUnknown before retrying an external side effect.
Never release a value from a blocked result, which the portal shows as Stopped by policy. Use the typed status, safe message, reason code, and evidence reference to handle results without a value.
ReviewContextRequired means policy asked for human review, but the call didn’t set GovernOptions.Review, so no review was opened and the action didn’t run. VeriProof recorded the attempt, and EvidenceReference identifies it. Set GovernOptions.Review with an active review profile and run the action again. Retrying unchanged records the same stop.
Derive facts once
Register a FactExtractor on the client when the same facts can be read from every call, so call sites stop building Facts by hand. It receives the action name, the original input, the session and invocation IDs, the adapter name, the ToolName when an adapter governs a tool call, and GovernOptions.RunMetadata:
await using var veriproof = Veriproof.FromEnvironment(new VeriproofOptions
{
FactExtractor = (context, cancellationToken) =>
ValueTask.FromResult<IReadOnlyDictionary<string, object?>?>(
context.ToolName == "payments.Pay"
? new Dictionary<string, object?> { ["payment"] = context.Input }
: null),
});Entries in GovernOptions.Facts win over extracted facts with the same name. Extracted facts go through the same sensitive data policy, field-contract checks, and review checkpoint as facts you pass yourself. A resumed review reuses the saved facts without calling the extractor.
If the extractor throws or returns something other than a JSON object, the action doesn’t run and the result fails with fact_extraction_failed. RunMetadata reaches VeriProof only through the facts your extractor returns. A ToolName also adds a tool check after the input check.
Report token usage
Declare the model call with ExecutionDescriptor, then report the counts the provider returned from inside the action. VeriProof prices the call from those counts and the call’s Model.
var result = await veriproof.GovernAsync(
"support.reply",
request,
async (context, cancellationToken) =>
{
var response = await chatClient.CompleteChatAsync(context.Input.Messages, cancellationToken: cancellationToken);
context.ReportTokenUsage(response.Value.Usage.InputTokenCount, response.Value.Usage.OutputTokenCount);
return new Reply(response.Value.Content[0].Text);
},
new GovernOptions
{
Model = new GovernModel("gpt-4.1-mini", "openai"),
ExecutionDescriptor = new(GovernedExecutionKind.ModelInvocation, "chat"),
});The counts are metadata, so VeriProof records them even when content capture is off. The last report wins, and a call that throws records no counts. ReportTokenUsage throws ArgumentOutOfRangeException for a negative count and InvalidOperationException when the call declared no model invocation. TryReportTokenUsage records valid counts and returns false instead of throwing. GovernedOpenAIChat reports the provider’s counts for you.
Handle a stop
Pass the supplied CancellationToken to child work. Call context.ThrowIfStopped() immediately before a protected side effect when the child API cannot accept that token.
A live Stop directive applies only to its matching run or application. The SDK signals the action before it acknowledges the directive. It does not terminate the .NET process. Reconcile the side effect when the result reports CompletionUnknown.
Continue after human review
Create one review runtime with an atomic protected workflow store. Save ReviewRequired checkpoints. Pass exact callback bytes and headers to ReceiveAsync, then let a worker call ResumeAsync with the saved checkpoint.
The runtime checks each callback against the signing keys VeriProof publishes at your endpoint. If your host can’t reach VeriProof, set WebhookKeys = new PinnedWebhookKeySet(keySetJson) in the review options. To check review event webhooks, call WebhookVerifier.VerifyAsync with the key set, your whsec_ subscription secret, or both.
Core Human Review uses a 12-field bounded brief and a response and resume-mode matrix. route_to_revision starts application-owned revision work and never runs the superseded payload. Private-note content remains in VeriProof and is excluded from the callback.
Your application owns the protected side effect and its idempotency key. Do not treat callback receipt as completed business work.
The hosted Server Ingest path is the default. Set VERIPROOF_EDGE_ENDPOINT to use the Edge API of your VeriProof Agent Gateway.
See Core Human Review for the lifecycle contract and the runnable .NET receiver guide for callback hosting.
Framework adapters
Add the Enforce adapter for each framework your application uses. Checks names the operation the adapter controls. Put the core SDK’s governed action around anything under Not covered.
| Framework | Package | Checks | Not covered |
|---|---|---|---|
| AutoGen | Veriproof.Sdk.Adapter.AutoGen | Model calls and complete bounded streams | Opaque tool loops and handoffs outside the adapter. |
| Microsoft Agent Framework | Veriproof.Sdk.Adapter.AgentFramework | Model calls, local tool calls, and streamed output | Local tool calls are enforced when functions are passed through AsVeriproofAgent(...); a pre-wrapped FunctionInvokingChatClient anywhere in a DelegatingChatClient-conformant pipeline is rejected before agent construction. Non-delegating custom clients that execute tools internally, provider-hosted tools, and handoffs are not covered. |
| OpenAI .NET | Veriproof.Sdk.Adapter.OpenAI | Text-only non-streaming completions | Tool messages, hosted tools, and streaming. |
| Prompty | Veriproof.Sdk.Adapter.Kernel.Prompty | Bounded template load, render, and model delegate | External tools and work outside the rendered delegate. |
| Semantic Kernel | Veriproof.Sdk.Adapter.SemanticKernel | Explicit function invocation, including prompt functions that offer functions to the model, opt-in kernel function filter calls, and opt-in automatic function calling | Provider-hosted tools, code that bypasses the kernel, and streaming invocation of selected functions. |
See the package catalog and .NET release notes.