Module 4 • Lesson 1645 mins

Comprehensive Evaluation Frameworks for Agents

Separating security boundaries from evaluation, 5 measurement dimensions (Outcome, Trajectory, Safety, Latency, Cost), LLM-as-a-Judge, and Denial of Wallet defense.

Build multi-dimensional evaluation suites: Outcome, Trajectory, Safety, Latency, Cost
Combine deterministic assertions with LLM-as-a-Judge rubrics
Set strict budget caps and prevent Denial of Wallet vulnerabilities

Observe the trajectory and stop drift

An HTTP success code cannot explain why the agent acted. The product needs a chronological trace that connects user intent, retrieved context, model decisions, tool inputs and outputs, permission checks, latency, and final state.

Instrument one Vibe Trajectory from the opening request to the resulting code or and real-world tool effects. OpenTelemetry can represent the whole task as an agent.session span, reasoning and prompting cycles as protected agent.think spans, and each environmental interaction as an agent.tool span with arguments, result, latency, policy decision, and cost. Pair the trace with centralized content scanning for dynamic snippets retrieved or generated at runtime.

This makes Denial of Wallet (DoW) visible. A technically successful agent can enter an infinite reasoning or tool loop and exhaust token and cloud budgets. Set per-session token, tool-call, retry, latency, and spend limits; alert before the budget is exhausted and preserve the trace that explains the loop.

Observability supports both security and evaluation. It can reveal infinite retry loops, unexpected tools, excessive cost, repeated self-repair, or an action that drifted away from the original request. Version control checkpoints and stateful circuit breakers provide a safe stop. If trust falls below a defined threshold, the system can revoke tools, restore the last checkpoint, and preserve evidence for review.

Make intent drift and trust decay operational rather than rhetorical. At the beginning of a run, record a compact intent contract: objective, prohibited outcomes, allowed resources, budget, and expiry. Each new subgoal, tool, or data source is compared with that contract and the current AgBOM. Trust decays when the agent adds unapproved scope, retries beyond budget, changes the target, requests stronger credentials, or cannot explain a new dependency.

A stateful circuit breaker should define:

TriggerAutomatic responseRecovery evidence
Tool or destination absent from the AgBOMPause execution and revoke the tool tokenUpdated plan and explicit re-approval
Retry, token, latency, or spend budget exceededFreeze the loop at the last checkpointRoot cause and a smaller retry plan
Proposed action diverges from intent contractQuarantine the run without discarding memoryVibe Diff showing the mismatch
Security constraint or content scan failsBlock the action and preserve artifactsClean rescan plus Green Team patch review

Track drift-alert precision, false-stop rate, time to containment, successful checkpoint restoration, repeated circuit-breaker trips, and cost avoided. A breaker that always fires is unusable; one that fires after the external action is merely an incident logger.

Use an explicit dynamic Agent Trust Score only as a control input, never as an unexplained magic number. Version its features and thresholds, show operators which signal lowered trust, and test threshold changes against known safe and unsafe traces. Before every codebase modification, create a recoverable version-control checkpoint. can discard routine successful traces after completion while retaining failures, high cost, policy violations, and excessive self-repair; track sampled-trace coverage and storage cost so rare incidents remain reconstructable.

Do not expose private reasoning or secrets in user-facing logs. Instead, show useful operational evidence: what the agent is doing, which source or tool it used, what changed, and how the user can recover. Maintain a more detailed protected trace for authorized operators.