Defensive Behavior in Large Language Models: Causes and Fixes

    This article explains why large language models often turn defensive—producing overly cautious wording or refusing to execute tasks—and breaks down the causes: asymmetric rewards, missing acceptance criteria, risk aversion in long tool-call chains, and self-doubt from insufficient context. It then presents a reusable framework for fixing the issue, including rewriting prompts around deliverables, staged confirmation, engineering controls such as sandboxing and rollback, and post-mortem rules. Developers will learn how to turn vague expectations into clear delivery contracts so models focus on execution instead of stalling.

    1. The Symptom: From Cautious Wording to Refusing to Act

    When developers use AI coding tools or general-purpose large language models for real work, many encounter a similar experience: the model becomes extremely conservative in its language, frequently stressing that it needs to be “careful” and that “manual review is recommended.” This conservatism then spreads from text to behavior—the model confirms the task scope but delays producing actual output, treating “this needs careful checking” as a reason to pause execution.

    Both behaviors can be abstracted as defensive behavior: in the face of uncertainty and potential risk, the model prioritizes reducing its own chance of error over completing the user’s goal. The first is defensive writing; the second is defensive work. The latter does far more damage to productivity, because it turns the deliverable into a “task description.”

    2. Root Causes: Why Models Would Rather Not Act

    Understanding the causes is a prerequisite for designing countermeasures. Defensive behavior is not a single defect but the result of multiple mechanisms stacking together.

    1. Asymmetric rewards. In most training and alignment pipelines, the cost of “saying something wrong” is significantly higher than the cost of “saying nothing.” Models are encouraged to express uncertainty and avoid overstepping—an advantage in factual Q&A, but one that degrades into stalling in execution tasks.
    2. Missing task granularity and acceptance criteria. An instruction like “try doing part of it” carries implicit acceptance conditions (produce a file, mark the scope). If the user does not state them explicitly, the model fills in a stricter internal standard of its own and gets blocked by it.
    3. Risk aversion in long tool-call chains. When file reads and writes or batch modifications are involved, the model is naturally conservative about irreversible operations; without sandboxing and rollback mechanisms, this conservatism is amplified.
    4. Self-doubt from insufficient context. When file structure, field meanings, and existing conventions are not in context, the model tends to substitute “I cannot confirm” for “let me produce a first version.”

    3. A Reusable Framework for Fixes

    3.1 Rewrite Instructions Around the Deliverable

    State the action, the artifact, and the acceptance conditions clearly to compress the space for the model’s free interpretation.

    1. Goal: Complete a trial labeling pass on Sheet1 of data.xlsx
    2. Artifact: Generate data_trial.xlsx (do not overwrite the original file)
    3. Scope: Process only rows 2–11, 10 rows total
    4. Labeling rule: If field C matches the keyword, fill "Y"; otherwise fill "N"
    5. Acceptance: Before output, self-check that all 10 rows have values; fill any missing ones before delivering
    6. Constraint: For rows you cannot judge, fill the default value first and mark review=1 in the last column

    The key point is to allow imperfect delivery: by explicitly specifying a fallback strategy, the model no longer needs to use stopping to avoid risk.

    3.2 Introduce Staged Confirmation Instead of a One-Time Green Light

    Split the task into four stages—explore, trial, spot-check, full run—each with its own artifact. This satisfies risk control while preventing the model from oscillating between “checking” and “executing.”

    3.3 Replace Verbal Constraints with Engineering Controls

    Prompts can only influence tendencies; processes constrain outcomes. Common practices include: enabling file operations in a container platform or isolated environment, turning on versioning and snapshot rollback for write operations, using a logging service to record every change for auditing, and using monitoring alerts to provide a fallback reminder for “zero-output” tasks.

    1. # Example: turn "completeness" into a decidable condition with a verification function
    2. def verify_trial(path, expect_rows=10):
    3. rows = read_rows(path)
    4. filled = [r for r in rows if r.get("label")]
    5. return len(filled) == expect_rows, len(filled)

    3.4 Post-Mortem Prompt Rules

    When the model reports “misjudgment, stopped too early,” the most valuable action is not to ask why, but to solidify the conclusion into a rule: add a line stating “do not delay output on the grounds of checking; deliver a usable version first.” Such rules should be accumulated as team templates rather than one-off conversations.

    4. Conclusion

    The essence of defensive behavior is an imbalance between goals and risk. For developers, the way to address it is to turn vague expectations into explicit delivery contracts and to absorb uncertainty with engineering-based verification and rollback mechanisms. When the cost of “producing a first version” is low enough, both the model and the human can more easily return their attention to the judgments that truly matter.