guide·6 min read

How to evaluate coding-agent sessions

Capture the complete session, evaluate what the agent did, find recurring failure patterns across runs and turn proven risks into policies. Failproof AI was built to make that loop practical for coding agents.

the short answer

Connect the coding agent to Failproof AI, then evaluate the complete session rather than only its final message or diff. Use code-based checks for facts such as whether tests ran after the last edit, and LLM-based checks for contextual questions such as whether the task was completed. Run audits across sessions to discover recurring failure modes, inspect the supporting traces, alert the owner and use a tested policy only when a known high-risk action should be stopped before execution.

Setup
A one-line install starts setup for supported coding-agent harnesses.
Evaluation
Run code-based and LLM-based checks against complete session traces in the cloud.
Failure discovery
Audits group recurring and previously unknown failures into evidence-backed findings.
Follow-through
Alert an owner, fix the agent and add a tested policy for actions that must not recur.

Why the Whole Coding-Agent Session Matters

The goal is not only to catch a bad coding-agent session. It is to improve the agent and the software factory around it. You need to know where agents lose context, choose the wrong tool, repeat work, weaken tests, make unnecessary edits or stop before the task is actually complete. Those patterns show whether the next improvement belongs in the prompt, model, repository context, tool design, test suite or workflow.

A final diff cannot provide that evidence on its own. Coding-agent evaluation needs the prompt, commands, edits, tool results, errors and final response in one trace, followed by analysis across many sessions. Failproof AI was built for this workflow: it evaluates complete coding-agent sessions, finds recurring and previously unknown failure patterns, and gives teams the evidence they need to make agents more reliable, efficient and capable over time.

1. Connect the Coding Agent

Install Failproof AI in one line, then connect it to Cloud and wire the hooks for the coding agent you use. New sessions are captured without adding tracing calls throughout the agent code.

npm install -g failproofai
The one-line install for the Failproof AI CLI.
failproofai config --token <key>
failproofai policies --install
Connect Cloud and install the supported harness hooks.

Failproof AI supports coding-agent harnesses including Claude Code, Codex, GitHub Copilot CLI, Cursor, OpenCode, Pi, Factory Droid and Devin. Give each agent and environment a stable name so production, staging and different agents remain separable in evaluations, queries, dashboards and audits.

2. Evaluate Outcomes and Behavior

Start with questions tied to real engineering failures. Use code-based evaluations when the answer can be read exactly from the trace. Use LLM-based evaluations when the check requires understanding the task, code change or surrounding context.

QuestionBest evaluation
Did a test command run after the last edit?Code-based
Did the session touch files outside the intended scope?Code-based when allowed paths are known
Did commands or tool calls repeatedly fail?Code-based
Did the agent complete the task it was given?LLM-based, supported by test or CI evidence
Did it hide a failure by weakening tests or changing the requirement?LLM-based

Keep the results separate. A session that completed the task but changed unrelated infrastructure should not average into one harmless-looking quality score. Each failure should lead back to the exact trace evidence that explains it.

Evaluations run in Failproof AI Cloud and appear with the session under Observe → evaluations. Re-evaluate an individual session, backfill recent sessions after adding a check, or aggregate results by agent and environment.

fp evals --since 24h --aggregate
fp evals --agent-id coding-agent --aggregate
fp --json evals --aggregate --env production

3. Find Failures You Did Not Write a Check For

Evaluations measure failure modes you already know to ask about. Audits look across session traces, evaluation results and policy decisions to find recurring behavior you may not have named yet. For a coding agent, an audit might reveal that it repeatedly edits generated files, abandons tasks after authentication errors or changes tests whenever an implementation becomes difficult.

Create an audit with a goal such as “find coding sessions that report success without enough evidence.” Set the agent, environment and time window, then run it on a cadence. Each finding contains analysis, severity, affected sessions, trace evidence and a recommended fix.

fp audits list
fp audits findings --status open --limit 20

Open several affected sessions before changing the agent. The same failed score can come from a missing tool, an ambiguous task, a bad model choice, insufficient repository context or a prompt that rewards finishing over verifying. The evidence tells you which part to fix.

4. Track the Behavior and Alert the Owner

Use Analyze → Queries for questions that cut across sessions, then save useful queries to a dashboard. Compare failure rates by agent, environment or time period; count sessions with tool errors; or list the repositories where verification most often goes missing.

fp agent ask "Which production coding agents skipped verification most often this week?"
fp query run <query-id>

Create alerts for evaluation-score drops, compound conditions, metric thresholds or saved SQL conditions. Route them to email, Slack, a webhook or the Failproof dashboard, and assign the issue to the person who owns the prompt, tool or workflow.

5. Fix the Cause and Verify the Recovery

A finding should lead to a concrete change: clarify the task template, expose a missing tool, improve repository context, change the model, require CI evidence or narrow the workflow. Keep the evaluation and audit running after the change. A sustained score recovery and the disappearance of the original pattern are stronger evidence than one successful replay.

For a known high-risk action, Failproof AI can close the loop with a policy. Its maintained coding-agent pack includes protections for pushes to the main branch, environment files, sudo and curl-pipe-shell commands, plus secret redaction. Custom policies can enforce repository-specific boundaries.

Do not turn every failed evaluation into a block. Use a policy only when the action is unambiguously unsafe, backtest it against past sessions, run it in observe mode and review false positives before enforcement. Keep the evaluation after enforcement to see whether the agent learned a better path or simply keeps attempting the denied action.

What a Useful Coding-Agent Evaluation Setup Looks Like

  • Complete traces: prompts, tool calls, tool results, edits, errors and the final response are connected in one session.
  • Known checks: code-based and LLM-based evaluations cover failures the team already understands.
  • Automatic discovery: recurring failures are grouped into findings instead of waiting for manual review.
  • Operational ownership: dashboards show trends, alerts reach the right channel and issues have an assignee.
  • Verified fixes: the same evaluations and audits prove whether a change worked.
  • Selective policies: only tested, high-confidence rules interrupt an action before it runs.

If one developer reviews every diff and CI gates every merge, that may be enough for a small workload. Session evaluation becomes valuable when agents work unattended, run across several repositories or produce enough sessions that nobody can inspect each trajectory by hand.

FAQ

What should I evaluate in a coding-agent session?

Evaluate task completion, verification after the last edit, repeated or failed tool calls, unexpected file changes and risky actions. Add criteria from real incidents rather than trying to create one universal coding-agent score.

Can Failproof AI evaluate Claude Code and Codex sessions?

Yes. Failproof AI connects to supported coding-agent harnesses including Claude Code and Codex, captures complete sessions and runs code-based and LLM-based evaluations in the cloud. Audits then analyze sessions together to find recurring failure patterns.

Should a coding-agent evaluation block commands?

Usually no. Evaluations measure behavior and help find failures. Use a policy only for a known action that should not run, and backtest and observe the policy before enforcing it.

Is CI enough to evaluate a coding agent?

CI is the strongest signal that the resulting code builds and passes its tests, but it does not explain the session path. Trace evaluation can reveal skipped verification, unnecessary retries, scope creep, secret exposure and recurring behavior that a green build does not show.

Get Started

Failproof AI is free to start. It finds recurring failure modes across agent sessions using code-based and LLM-based evaluations, groups the evidence into findings, and recommends fixes. Bring the eval suite you already have, alert the right owner when behavior drifts, and turn a tested fix into a policy that prevents the failure from recurring. See pricing for the tiers.

Sources

Products change; if a detail here is out of date, tell us at support@befailproof.ai.

  1. Failproof AI docs: Supported harnesses
  2. Failproof AI docs: Evaluations overview
  3. Failproof AI docs: Audits
  4. Failproof AI docs: Policy packs