Docs navigation

Outcome verification

Move from “what happened?” to “what happened, did it work, and was it worth it?” Every agent run can record an outcome — its status, HOW it was verified, and the business value it produced. Verified outcomes feed the agent's trust score and the cost-to-value analytics.

Record an outcome

record-outcome.ts
await run.recordOutcome({
  taskType: "supplier-analysis",
  status: "success",
  verificationMethod: "human_approval",  // REQUIRED — never self-declared
  businessValueEstimate: 1200,           // optional, in valueCurrency (USD)
  // costUsd defaults to the run's recorded model executions
});

Warning

verificationMethod is required. An agent may never silently self-declare success — the API rejects outcomes that don't record how they were verified.

Outcome statuses

StatusMeaning
pendingRecorded, not yet verified
successVerified successful
partial_successPartially achieved the expected outcome
failureVerified failed
disputedVerification contested
awaiting_human_reviewQueued for a human decision
unverifiableNo verification path exists

Verification methods

MethodMeaning
deterministicProgrammatic check with a known expected result
api_confirmationExternal API confirmed the effect
db_stateDatabase state matches the expected outcome
human_approvalA human reviewer signed off
secondary_agentAn independent agent verified the result
rules_engineA rules engine validated the outcome
external_verifierA third-party verifier attested
webhookA customer-defined webhook confirmed

Human review

Outcomes flagged for review appear on the Outcomes dashboard. Approval confirms a verified success; rejection marks failure. Both decisions append a hash-chained audit event and move the agent's trust score (approval +2, rejection −8).

human-review.ts
// Ask for review at record time:
await run.recordOutcome({
  taskType: "financial-transfer",
  humanReviewRequired: true,             // → status: awaiting_human_review
  verificationMethod: "human_approval",
});

// A reviewer approves or rejects in the dashboard (or via API):
// PATCH /api/outcomes/:id/review  { "decision": "approved" }

Cost-to-value analytics

Because outcomes carry both cost (auto-derived from the run's model executions) and estimated business value, ProofLedger can answer: cost per successful outcome, cost per failed outcome, and value-to-cost ratio — per agent, per model, per task type.