SDK Outcomes API
Use the Outcomes API to attach a quality rating to a session before you close it. Ratings power outcome correlation charts in Analytics and surface ground-truth signals in the Decisions Explorer.
Recording a rating:
Call set_outcome_rating() (Python), setOutcomeRating() (TypeScript), or
activity.SetOutcomeRating() (.NET) within your session before calling
complete().
Rating values:
EXEMPLAR— golden reference example, ideal for evaluation datasetsGOOD— clearly positive outcomeACCEPTABLE— within normal tolerancesMARGINAL— borderline, worth a second lookBAD— clearly negative outcomeHARMFUL— caused or risked harmUNKNOWN— not yet rated (default)
Access control: Developers instrument outcome ratings in code. Governance Engineers and Compliance Officers can override ratings through the portal.
Outcome Recording
Developers record outcome ratings in code using the SDK. Governance Engineers and Compliance Officers can override ratings and add notes through the portal.
Outcome ratings let you tell VeriProof whether a session went well. You attach a rating from inside the running session — before calling complete(). Ratings surface in:
- The Decisions Explorer — outcome column and detail drawer
- The Time Machine — Governance Context panel
- Analytics → Trends — outcome correlation charts
- Compliance Center — post-decision accuracy evidence for audit frameworks
Availability
| Role | Permission |
|---|---|
| Administrator | Read, write |
| Developer | Write |
| Platform Engineer | Read, write |
| Compliance Officer | Read |
| Business Owner | Read |
| Auditor | Read |
Outcome Model
An outcome record is attached to a session and contains the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
rating | OutcomeRating | ✅ | Quality judgement for the session — see values below |
note | string | — | Free-text justification for the rating |
ground_truth_labels | key-value map | — | Named numeric scores (e.g. accuracy: 0.92) |
Outcome Types
Use the OutcomeRating enum to classify the quality of a session:
| Python value | TypeScript value | .NET value | Description |
|---|---|---|---|
OutcomeRating.EXEMPLAR | OutcomeRating.Exemplar | OutcomeRating.exemplar | Golden reference — ideal session to learn from |
OutcomeRating.GOOD | OutcomeRating.Good | OutcomeRating.good | Clearly positive outcome |
OutcomeRating.ACCEPTABLE | OutcomeRating.Acceptable | OutcomeRating.acceptable | Within normal tolerances |
OutcomeRating.MARGINAL | OutcomeRating.Marginal | OutcomeRating.marginal | Borderline — acceptable but warrants review |
OutcomeRating.BAD | OutcomeRating.Bad | OutcomeRating.bad | Clearly negative outcome |
OutcomeRating.HARMFUL | OutcomeRating.Harmful | OutcomeRating.harmful | Caused or risked harm |
OutcomeRating.UNKNOWN | OutcomeRating.Unknown | OutcomeRating.unknown | Not yet rated (default) |
Recording Outcome Ratings via the SDK
Call set_outcome_rating() within your session before calling complete().
Python
import os
from veriproof_sdk import VeriproofClient, VeriproofClientOptions, VeriproofSession, StartSessionOptions
from veriproof_sdk.enums import SessionOutcome, OutcomeRating
client = VeriproofClient(
VeriproofClientOptions(api_key=os.environ["VERIPROOF_API_KEY"])
)
async with VeriproofSession(
client,
"loan-assessment",
StartSessionOptions(session_id="loan-app-98765"),
) as session:
# ... AI reasoning steps ...
session.set_outcome(SessionOutcome.SUCCESS)
session.set_outcome_rating(
OutcomeRating.GOOD,
note="All eligibility criteria met. Decision matches policy.",
)You can also record a rating without an explicit outcome. If you only know the quality of the session, set the rating and omit set_outcome().
Viewing Outcomes in the Portal
Navigate to Decisions in the main navigation. The Outcome column shows the session outcome for each session, or – if none has been recorded. Select any row to open the detail drawer, which includes:
- The original decision and governance score
- The outcome rating and any attached note
- Links to the Time Machine trace