VeriProof SDKs
Choose the core SDK for your application’s language. Add a released Enforce adapter only for a framework boundary your application uses.
Tools and SDKs in the customer portal provides the packages and installation commands available to your organization.
Choose your language
| Language | Core package | Enforce adapters | Runtime |
|---|---|---|---|
| TypeScript | @veriproof/sdk-core | 11 | Node.js 22 |
| Python | veriproof-sdk | 8 | Python 3.11 or later |
| .NET | Veriproof.Sdk.Core | 5 | .NET 10 |
| Java | com.veriproof:veriproof-sdk-core | 6 | Java 21 |
| Go | veriproof.app/sdk/go | 3 | Go 1.26.6 or later |
| Rust | veriproof-sdk | 2 | Rust 1.96 or later |
Choose the right package category
| Category | Use it for | Enforcement |
|---|---|---|
| Core SDK | Application-owned model calls, tools, workflows, and business actions | Yes |
| Enforce adapter | One documented framework operation | Yes, within that boundary |
An Enforce adapter uses the same typed outcomes and fail-closed behavior as its core SDK. Tracing on its own doesn’t enforce anything.
Read SDK categories and framework coverage to see exactly what each adapter checks.
What every core SDK does
Every core SDK checks policy before protected work starts and before its result is released. Each SDK provides:
- typed allow, warning, transform, deny, review, stop, degraded, timeout, and cancellation results;
- signed, durable human-review continuation with structured responses;
- run-scoped and application-scoped stop delivery;
- application facts and generated industry vocabulary for policy rules;
- hosted Server Ingest and the Edge API of your VeriProof Agent Gateway;
- an account-free test harness for deterministic application tests;
- evidence references, diagnostics, flush, and graceful shutdown.
Only completed, completed-with-warning, and transformed results can contain a released value. Reconcile an uncertain execution before retrying an external side effect.
Govern one action
- Open your application in the customer portal.
- Copy its API key to
VERIPROOF_API_KEYin your secret store. - Copy the package install commands from Tools and SDKs.
- Create one SDK client when the application starts.
- Put the protected model, tool, or business side effect inside the SDK’s
governcallback. - Pass application facts and industry values that active rules need.
- Handle the typed result. Never release a denied or withheld value.
- Flush and close the client during graceful shutdown.
The hosted service is the default. Set the language’s Edge endpoint option when your application uses an Agent Gateway. The Edge API keeps policy checks off the central request path while its signed policy lease remains valid.
Continue after human review
A review_required result contains a durable checkpoint. Save it before returning control to the caller. Your callback must verify the signed raw request before parsing it. A worker then claims the checkpoint, revalidates current application state and policy, and resumes the protected action once.
Your application owns its checkpoint store, protected side effect, and idempotency key. The SDK fences uncertain execution until your application reconciles the durable effect.
Read the human-review lifecycle and your language guide before implementing a callback.
Add policy data
Use application facts for values specific to your workflow. Use generated industry values when a shared business term or external code improves consistency. The authenticated field contract tells the SDK which active-rule fields are required, their types, and any allowed values.
Read Provide data for policy rules for the exact payload shape.
Record the model and prompt version
In TypeScript, Python, and .NET, pass the model option on each governed call with the model ID and, optionally, its provider. Each call records its own model, so a session can show more than one. A model ID is 1 to 100 characters from letters, digits, and . _ : / @ + -, the same limit VeriProof applies when it receives the session. Each SDK exposes the check as a predicate (isRecordableModelId in TypeScript, is_recordable_model_id in Python and Rust, GovernModel.IsRecordableId in .NET, IsRecordableModelID in Go, GovernModel.isRecordableId in Java), so you can test an ID before you pass it.
| Language | Model option |
|---|---|
| TypeScript | model: { id: 'gpt-4.1-mini', provider: 'openai' } |
| Python | model=GovernModel(id="gpt-4.1-mini", provider="openai") |
| .NET | Model = new GovernModel("gpt-4.1-mini", "openai") |
Set the prompt version in the session context of each governed call. Use the name your team gives the prompt release, such as invoice-triage-v12, up to 128 characters. It is recorded even when content capture is off, so don’t include prompt text or personal data.
| Language | Session context field |
|---|---|
| TypeScript | sessionContext: { promptVersion } |
| Python | session_context=SessionContext(prompt_version=...) |
| .NET | SessionContext = new SessionContext { PromptVersion = ... } |
| Go | SessionContext: &SessionContext{PromptVersion: &version} |
| Java | SessionContext.builder().promptVersion(...) |
| Rust | SessionContext { prompt_version: Some(...), ..Default::default() } |
VeriProof compares the models and prompt versions each application reports. A value the application hasn’t used before is treated as a change and added to the Inbox. The first value an application reports becomes its baseline, and returning to an earlier value isn’t a change.
Report token usage
To see what a model call costs, declare it as a model invocation with an execution descriptor, such as operation chat. Then report the input and output token counts the provider returned from inside the action. VeriProof records them on the call’s model step and prices the step from the counts and the call’s model, so sessions and cost analytics show the spend.
| Language | Report from the action |
|---|---|
| TypeScript | reportTokenUsage({ inputTokens, outputTokens }) |
| Python | context.report_token_usage(input_tokens=..., output_tokens=...) |
| .NET | context.ReportTokenUsage(inputTokens, outputTokens) |
| Go | action.ReportTokenUsage(inputTokens, outputTokens) |
| Java | context.reportTokenUsage(inputTokens, outputTokens) |
| Rust | context.report_token_usage(input_tokens, output_tokens)? |
Token counts are metadata, so they’re recorded even when content capture is off. Your language guide shows how to declare the call.
The call above throws on a count it can’t record. Each SDK also has a variant that never throws: it records valid counts and returns false for anything else, which suits code that reads usage from a provider response you don’t control. These are tryReportTokenUsage in TypeScript, try_report_token_usage in Python and Rust, TryReportTokenUsage in .NET and Go, and tryReportTokenUsage in Java.
If a policy transform rewrites the model field of the input to your action, VeriProof records the model that ran, not the one you declared.