Rust SDK
Use veriproof-sdk for application-owned actions. Add the Enforce adapter for each framework your application uses.
Govern one action
In the customer portal, open Tools and SDKs. Select your language and adapters, then follow the installation instructions shown there.
VeriProof SDKs are distributed through customer-gated GitLab packages, not public registries. See SDK access for workstation and CI guidance.
VeriProof packages used here: veriproof-sdk, veriproof-sdk-adapter-rig.
Store the application SDK key as VERIPROOF_API_KEY, then create one client:
use veriproof_sdk::{GovernOptions, Veriproof};
let veriproof = Veriproof::from_env()?;
let result = veriproof.govern(
"grid.plan",
request,
|context| async move {
context.throw_if_stopped()?;
Ok(build_plan(context.input))
},
GovernOptions::default(),
).await;
if result.completed() {
publish(result.value);
}The core SDK checks the input before it calls build_plan. It checks output before release through the typed result.value boundary.
Only completed, completed-with-warning, and transformed results can contain a released value. Reconcile uncertain execution 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 (review_context_required): Policy asked for human review, but the call didn’t include review options, so no review was opened and the action didn’t run. VeriProof recorded the attempt, and evidence_reference identifies it. Set GovernOptions::review with an active review profile and run the action again. Retrying unchanged records the same stop.
Handle a stop
Pass the governed action context into child work. Call context.throw_if_stopped() immediately before each protected side effect.
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 Rust process. Reconcile the side effect when completion is uncertain.
Use typed industry values for shared business terms and facts for application-specific rule data. The active field contract checks required fields, types, and allowed values before protected work begins.
Continue after human review
Save the review checkpoint in the provided SqliteReviewStore, the SDK’s protected workflow store. Pass the unchanged callback bytes and headers to receive, which verifies the signature before parsing. A worker can then resume the saved checkpoint with a rebuilt protected callback.
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.
The hosted Server Ingest path is the default. Set VERIPROOF_EDGE_ENDPOINT for a licensed Edge Gateway.
See Core Human Review, the runnable Rust receiver guide, and the Rust Human Review guide.
Test without an account
VeriproofTestHarness runs the real client against an in-memory runtime. Read Test a Rust integration.
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 |
|---|---|---|---|
| async-openai | veriproof-sdk-adapter-async-openai | Model requests and complete bounded streams | Provider-hosted tools, opaque application tool loops, and agent handoffs and direct client calls. |
| Rig | veriproof-sdk-adapter-rig | Model calls and local tool calls | Incremental streaming is not covered because the adapter cannot withhold already emitted deltas; the hook stops streaming before release. Provider-hosted tools, opaque custom tool loops, and handoffs outside the governed action path are not covered. |
For framework-specific setup, see the Rig and async-openai guides. See the package catalog and Rust release notes.