Research idea

Coding agent assurance mechanisms

Day · 2026-06-08 · Software Intelligence

Agentic software work has usable control points at three places: generated code can be scored before it moves to review or another agent, MCP agents can run with capped recent tool history plus short summaries, and AI-generated tests can carry candidate-level evidence through build, execution, coverage, mutation, and repair steps.

3 ideas

Confidence scoring before generated code enters review or another agent step

Teams using coding agents can add a pre-review score for each generated patch or function. Code Is More Than Text gives a concrete recipe: combine Top-K token entropy, agreement across sampled pseudo-code plans, and the pass rate on self-generated tests. Across five code LLMs and four benchmarks, that ensemble raised average AUROC for predicting hidden-test success from 0.696 to 0.776.

FASE gives a cheaper companion check when tests are missing or expensive. It samples 10 code solutions, embeds them with a model such as Qwen3-Embedding-8B, clusters them with a minimum-spanning-tree rule, and computes entropy over the clusters. On HumanEval and BigCodeBench-hard, it reports a 25% average gain in Spearman correlation with Pass@1 at about 0.3% of the cost of LLM-based semantic entropy.

A practical adoption test is a CI or agent-router step that records these scores for generated code, then compares score bands with real review outcomes, unit-test failures, and rollback data. Low-score outputs can be sent to retry, extra tests, or human review before another agent builds on them.

Capped recent tool history with summaries for MCP agents in verbose enterprise workflows

Enterprise MCP agents should have an explicit context policy that keeps recent tool state intact and stores the full trace outside the model context. In the D365 Finance and Operations hotel-expense benchmark, full conversation history completed 71.0% of tasks while using 1,480,996 tokens. Keeping the last five complete tool call and response pairs raised completion to 79.0% and cut tokens to 535,274. Adding a short summary of the three most recent evicted interactions raised completion to 91.6% with 553,374 tokens.

The build is small enough for a middleware layer around an MCP client: persist every call, pass only the last five complete interactions plus a short rolling summary to the model, and attach trace IDs to each tool result. The trace IDs matter because enterprise MCP practitioners named fast fault localization as the main troubleshooting obstacle in all 20 interviews. The same runtime layer should also enforce controls outside model obedience, such as tool allowlists, state checks, and stop conditions, matching the agent-harness requirement for control mechanisms independent of the model.

Candidate-level evidence records for AI-generated unit tests

Teams accepting AI-generated tests need a record for each candidate test, including failed and repaired candidates. TestMap shows the shape of that record for C#/.NET: repository and commit metadata, Roslyn project information, build results, TRX execution results, Cobertura coverage, Stryker.NET mutation data, xNose test-smell checks, prompts, model settings, repair attempts, and final outcome labels.

This is a practical workflow change for test-generation pilots. Each generated test can enter review with its target method, baseline coverage, coverage change, mutation signal, build and execution logs, repair count, and smell checks attached. Reviewers can reject tests that only compile, prioritize tests with coverage or mutation evidence, and inspect recurring failure modes by model, prompt, context mode, or repair budget. The useful first check is whether this record reduces reviewer time and catches low-value passing tests in one real repository.