Confidence Scoring: Quantifying Certainty in Agent Outputs
Building a confidence score from agent outputs. Four signal sources, a four-zone scoring rubric, and a confidence ledger that makes routing decisions systematic rather than intuitive. The goal: replace 'I think this is right' with a number you can act on.
"I think this is right" is not a confidence score. It is an opinion. Opinions are not actionable in automated pipelines.
The question your autonomous system must answer at every decision point is: does this output have enough verified confidence to proceed without human review? That question requires a number, not a feeling. The confidence scoring system is the mechanism that produces the number.
Building this system correctly requires understanding what actually provides signal about whether an agent output is correct — and what only provides the appearance of signal.
The Four Signal Sources
Confidence scoring builds from four sources, weighted by their reliability. The weights should be calibrated empirically against your specific system, but the ordering by signal strength holds broadly.
Signal 1: Self-reported certainty (weakest). The model expresses confidence in its output. Hedges, qualifications, and uncertainty expressions. This signal has value only as a negative indicator — when a model explicitly expresses uncertainty, that should reduce the confidence score. When a model expresses confidence, that provides minimal positive evidence. Models express confidence routinely regardless of accuracy.
Signal 2: Validation agent agreement (strong). An independent validation agent, given the output to review, passes it. This is a meaningful signal because it represents an independent computation reaching the same conclusion. The strength of this signal depends entirely on how adversarial and rigorous the validation agent is. A rubber-stamp validator produces no confidence signal. An adversarial validator whose explicit mandate is to find failure — when that validator passes — produces strong positive evidence.
Signal 3: Cross-source confirmation (strong). Multiple independent sources — retrieved documents, external APIs, other agents — agree on the relevant facts in the output. This is strongest when the sources were not used as inputs to the primary agent, because source agreement that does not come from source-to-answer copying is independent corroboration.
Signal 4: Historical accuracy rate (strongest). The system has empirically measured how accurate this specific agent is on this specific task type. If the research synthesis agent has been measured at 89% accuracy on the last 200 research synthesis tasks, that empirical rate provides the strongest prior for confidence. This is the signal source that requires the most infrastructure to build — you need the measurement system, the task type classification, and the accuracy ground truth evaluation — but it is the most reliable.
Building the Composite Score
The composite confidence score combines available signals into a single number. The computation should be explicit, versioned, and logged with every score it produces.
A practical starting formula:
def compute_confidence_score(
self_reported_certainty: float, # 0.0–1.0 from model
validation_pass: bool,
cross_source_agreement: float, # 0.0–1.0 based on N sources
historical_accuracy: float | None, # None if no history yet
task_novelty: float # 0.0–1.0 where 1.0 = novel
) -> float:
base = 50.0 # start at midpoint
# Self-reported certainty: weak signal, max 10 point contribution
base += self_reported_certainty * 10
# Validation pass: strong signal
if validation_pass:
base += 25
else:
base -= 30 # failure is a strong negative signal
# Cross-source agreement: strong positive signal
base += cross_source_agreement * 20
# Historical accuracy: strongest signal, overrides base when available
if historical_accuracy is not None:
base = (base * 0.3) + (historical_accuracy * 100 * 0.7)
# Task novelty penalty: novel tasks get penalized
base -= task_novelty * 20
return max(0, min(100, base))
This formula is a starting point, not a prescription. The weights should be calibrated against your specific system using measured accuracy data. What matters is that the formula is explicit — every routing decision can be traced back to the specific signals that produced the confidence score.
The confidence score is not the bare fact. It is the conclusion drawn from the signals. The quality of the conclusion depends on the quality of the signals and the rigor of the formula.
The Four-Zone Rubric
The confidence score maps to four action zones. The zone determines what the pipeline does next.
Zone 1: 0–40 (Reject). The system does not have enough confidence to proceed. The output is rejected. Depending on the failure source, the routing options are: retry with a revised prompt, escalate to human review, or mark the task as requiring human completion. Do not proceed on Zone 1 output.
Zone 2: 41–70 (Human Review). The system has some confidence but not enough for autonomous action. The output, the confidence score breakdown, and the specific signals that drove the score into this zone are surfaced to a human reviewer. The human makes the final call. This zone is the escalation path, not the failure path — the output may be completely correct, but the confidence is insufficient for the system to make that determination autonomously.
Zone 3: 71–90 (Log and Proceed). The system has sufficient confidence for autonomous action. The output proceeds, the score and signals are logged to the confidence ledger, and the pipeline continues. Human review is not required but the output is sampled (at a configured percentage) for quality monitoring.
Zone 4: 91–100 (Auto-Approve). High confidence. The output proceeds without logging beyond the standard audit trail. Quality monitoring sampling applies at a lower rate than Zone 3.
The Confidence Ledger
The confidence ledger is the persistent state that makes confidence scoring a learning system rather than a static formula.
Every scored output is stored in the ledger with:
- Task type (classified automatically from the prompt)
- Confidence score at time of output
- Human review result (if the output was reviewed)
- Production outcome (if measurable: did the decision based on this output turn out to be correct?)
The ledger enables:
Historical accuracy computation. For each task type, compute the accuracy rate from ledger entries where outcome is known. Feed this back into the confidence formula as the historical accuracy signal.
Threshold calibration. Analyze the distribution of outcomes at each score zone. If Zone 2 (Human Review) outputs are being approved by humans 95% of the time, the threshold between Zone 2 and Zone 3 may be too conservative and should be lowered.
Drift detection. If historical accuracy on a task type drops significantly over time, something has changed. The model may have drifted, the task distribution may have shifted, or a dependency may have changed. Detect it in the ledger before it manifests as a production incident.
Agent comparison. If you are running multiple models or agent configurations, the ledger makes it possible to compare their accuracy rates by task type and route tasks to the agents with the best measured performance for each type.
Bootstrapping Without Historical Data
Every new agent and new task type starts with no historical accuracy data. The ledger is empty. The confidence formula falls back entirely on the three weaker signals.
This is expected. The appropriate response is:
- Start with a conservative threshold — treat all Zone 2 and Zone 3 scores as requiring human review until you have sufficient ledger data
- Actively sample outputs for human review to build the accuracy baseline quickly
- Target at minimum 50 measured outcomes per task type before enabling the historical accuracy signal
- Review and calibrate the formula after each 100-entry milestone
The system gets better as it runs. The cost of the initial conservative period is the price of starting with an uncalibrated system. Accept the cost, build the data, and unlock the accuracy improvement that comes with calibrated scoring.
Lesson 116 Drill
Implement a minimal confidence scoring system for one agent in your stack:
- Define the task types for that agent (5–10 categories based on the kinds of tasks it performs)
- Build the formula: start with the four-signal structure, use conservative weights
- Add logging: every run produces a logged confidence score with all four signal values
- Build the ledger schema: task_type, confidence_score, timestamp, human_review (nullable), outcome (nullable)
- Set zone thresholds — conservatively for a new system
- After 50 runs with logged outcomes, calibrate: did Zone 2 predictions match Zone 2 outcomes?
The first version will be wrong. That is fine. The goal is not a perfect formula — it is a feedback loop. Measure, calibrate, improve.
Bottom Line
"I think this is right" is not an action signal. A confidence score with a clear zone rubric and measurable calibration is.
Build the four signal sources. Combine them explicitly. Map the result to action zones with calibrated thresholds. Log everything to the confidence ledger. Calibrate over time as outcomes are measured.
The result is a system that routes decisions based on measured confidence rather than intuition — and gets more accurate as it runs.