Defensive Work: Why AI Coding Assistants Stall on Execution and How to Fix It
This article examines a shift from "defensive writing" to "defensive work" in AI coding assistants: models that increasingly confirm scope and request more context instead of producing verifiable results. It defines the concept, breaks down a spreadsheet-editing example, analyzes root causes such as safety alignment, misaligned evaluation metrics, and missing low-risk execution channels, and explains the impact on efficiency, trust, and automation. It then presents engineering countermeasures—task contracts, an artifact-first execution state machine, sandbox/dry-run/idempotency/rollback tooling, a minimal-confirmation principle, and observability metrics—so that "confirming scope" becomes "producing an acceptance-ready sample."
Recently, an update to an AI coding tool sparked considerable discussion among developers. The focus was not that the model “cannot write code,” but a subtler signal: the model is becoming more cautious when generating content and, when handed concrete tasks, increasingly tends to “only confirm, not deliver.” The move from “defensive writing” to “defensive work” looks like a change in expression style, but it is really a completeness problem in agentic task execution. This article abstracts the phenomenon into a general technical problem and analyzes its root causes, impact, and engineering countermeasures.
From Defensive Writing to Defensive Work: Defining the Concept
“Defensive writing” refers to a model adding heavy qualifications, disclaimers, vague phrasing, and repeated confirmations to reduce its responsibility for errors when producing an answer. For example, it may split a clear question into several “possibly,” “it depends,” and “recommend further confirmation” statements. This style is verbose but relatively cheap: users can still extract information, and the worst case is reading a few extra paragraphs.
“Defensive work” appears once an AI coding assistant has capabilities such as tool invocation, file read/write, and command execution. The model no longer just “talks”—it has to “act.” Here, defensiveness shows up as repeatedly confirming task scope, constantly asking for more context, staying in the planning phase, not generating inspectable intermediate artifacts, and not running low-risk trial attempts. What users see are status messages like “I have confirmed the scope,” “annotation is not yet complete,” and “no trial file has been generated,” but no acceptance-ready result.
You can judge whether an assistant has fallen into defensive work using three engineering metrics: first, whether it produces acceptance-ready intermediate artifacts within a reasonable number of turns; second, whether the number of confirmations exceeds what the task’s risk requires; third, whether the time to the first acceptance-ready artifact is acceptable. If a model completes a large number of metacognitive steps but produces no sample file, diff report, or change plan, that does not count as effective progress.
Breaking Down the Phenomenon: A Spreadsheet-File Edit
A typical scenario: a user asks an AI coding assistant to modify part of a spreadsheet file and explicitly says “do a trial on part of it first.” The assistant replies that it has confirmed the trial scope but has not yet completed annotation or generated a trial file. This reply is semantically correct but stalls in terms of task execution.
The problem breaks into three layers. First, scope confirmation is decoupled from the artifact. “Confirming scope” is a planning-state action, but what the user actually needs is a “trial artifact.” Second, the trial portion lacks an acceptance-ready definition. The user said “do a trial on part first” but did not specify sample row count, column range, output filename, or validation criteria. The assistant could choose reasonable default assumptions and label them, rather than waiting for more confirmation. Third, the task state machine stops at the planning phase. A healthy execution flow should at least enter a “dry-run / sample generation” stage; even if the change is ultimately not applied, it should still produce a sample document and a diff description.
From a technical standpoint, this is not a model “attitude problem” but the combined result of the task contract, tool capabilities, and evaluation objectives.
Root-Cause Analysis: Why the Model Only Confirms and Does Not Execute
First, safety alignment and risk avoidance. File-write operations are irreversible, and models are easily rewarded for “doing less and making fewer mistakes” during training and preference optimization. When there is no sandbox, rollback, or diff validation, a conservative strategy overrides a completion strategy.
Second, misaligned evaluation metrics. Offline evaluation often focuses on single-turn answer accuracy, factual correctness, and refusing inappropriate requests, whereas agentic tasks care more about long-horizon completion rate, time to first acceptance-ready artifact, number of confirmation turns, rollback rate, and human-takeover rate. If evaluation does not reward “producing a verifiable sample under uncertainty,” the model naturally stays at the explanation layer.
Third, the tool layer lacks a low-risk execution channel. If tools only offer “write the file directly” without dry-run, patch preview, version snapshots, idempotent apply, and rollback, the model can only reduce risk through repeated confirmation. Engineering should make “trialability” a tool capability rather than relying on natural-language requests.
Fourth, insufficient context and state management. In multi-turn tasks, the model may fail to reliably track the confirmed scope, generated artifacts, and pending validation items, so it re-confirms. State should be externalized as a structured task record rather than relying on conversational memory.
Fifth, ambiguous task boundaries. Phrases in user instructions like “a certain part” and “do a trial first” themselves require engineering interpretation. The model should proactively offer a default interpretation and label its assumptions—for example, “generate a sample from the first 10 rows, the amount and date columns, preserve the original format, and output a diff report”—rather than only replying “scope confirmed.”
Impact: Efficiency, Trust, and Automation Idling
The direct cost of defensive work is higher interaction cost. Developers have to switch context among “confirm scope—add clarification—confirm again,” stretching a trial that could have been done in one pass. For automation pipelines, the more serious problem is idling: the task neither fails nor succeeds but stalls in the planning state, so downstream validation, review, and release cannot proceed. Over time, teams lose trust in the assistant and treat it only as a code explainer rather than a task executor.
Engineering Countermeasures: Turning “Confirmable” into “Acceptance-Ready”
Task Contracting
Before a task begins, use a structured contract to define the goal, scope, acceptance criteria, and confirmation budget. For example:
{"task": "modify_table_sample","target": "the specified spreadsheet file","scope": {"worksheet": "current sheet", "row_range": "first 10 rows", "column_range": ["amount", "date"]},"acceptance": ["generate a trial file", "output a change summary", "preserve the original format", "provide a rollback point"],"mode": "dry_run_then_apply","max_confirmations": 1}
The value of the contract is that it translates “do a trial on part first” into an executable, acceptance-ready intermediate artifact. As long as the acceptance items are clear, the model should not substitute confirmation for the trial.
Execution State Machine and Artifact-First
A recommended state machine is “plan—dry-run—review—apply—verify,” where each state must produce an inspectable artifact:
PLAN -> change plan and list of assumptionsDRY_RUN -> sample file, diff reportREVIEW -> open questions (no more than the confirmation budget)APPLY -> idempotent apply recordVERIFY -> validation results and rollback point
The pseudocode can be expressed as:
if state == PLAN:artifact = generate_change_plan()require artifact != emptyif state == DRY_RUN:artifact = generate_sample_and_diff()require artifact.sample_file existsif artifact.missing:fail("missing acceptance-ready artifact; must not proceed")
The core principle: no artifact, no progress; no acceptance, no apply.
Tool Layer: Sandbox, Dry-Run, Idempotency, and Rollback
Tool design should provide a low-risk execution channel: trial runs inside a sandbox, diff-patch preview, version snapshots, idempotent apply, operation logs, and rollback. In a general cloud environment, object storage can hold version snapshots, a logging service can record the tool-call chain, and monitoring and alerting can catch abnormal rollback rates. This way the model does not need to replace safety mechanisms with excessive confirmation.
Minimal-Confirmation Principle
Confirmation should happen only when an action is irreversible, high-risk, or when ambiguity exceeds a threshold, and it should ask everything at once. Low-risk trials can be executed directly with labeled assumptions. The system prompt can explicitly require “artifact before explanation,” “no confirm-only without execution,” and “adopt default assumptions and label them when information is missing.”
Observability and Evaluation
Record the plan, tool calls, artifacts, validation, and rollback to form a traceable chain. Evaluation metrics should include task completion rate, time to first acceptance-ready artifact, number of confirmation turns, rollback rate, and human-takeover rate. Only by incorporating “completion” into evaluation will defensive work decrease.
A Practical Checklist for Spreadsheet-File Edits
- Parse the structure: identify worksheets, column types, formulas, and format dependencies.
- Generate a change plan: list target cells, expected changes, and assumptions.
- Dry-run a sample: generate a trial file that preserves the original format.
- Diff report: describe which rows, columns, and values changed.
- Validate: check formulas, formats, null values, and boundaries.
- Apply and roll back: save a snapshot before applying, and output validation results after applying.
Conclusion
Defensive writing is conservatism at the expression layer; defensive work is stagnation at the execution layer. For an AI coding assistant, the real problem to solve is not “making the model bolder” but giving tasks a contract, giving trials a sandbox, giving artifacts acceptance criteria, and giving confirmation a budget. Turning “only confirming scope” into “generating an acceptance-ready sample” is what lets an AI coding assistant evolve from an explanation tool into a controllable task executor.
