# How do I stop an AI coding assistant from just agreeing with me?

**Short answer:** Don't hand it your conclusion, ask for the case against it, and make it name the risks before it writes code. Assistants drift toward what the user seems to believe. Anthropic researchers found that five production assistants gave more positive feedback on work the user said they liked or wrote, dropped correct answers when asked 'Are you sure?', and repeated the user's mistakes. OpenAI rolled back an April 2025 GPT-4o update because it had become overly flattering. So ask neutrally, ask for counterarguments and the strongest alternative, require a written list of risks and what would prove the plan wrong, have a reviewer that didn't see your reasoning check the diff, and keep the real decision with a person who can say no: plan mode before edits, a check that passes or fails, and a human approving the merge.

## Checklist
1. Ask without showing which answer you want: 'Is approach A or B better here, and why?' rather than 'I think A is better, right?' Saying 'I wrote this' or 'I really like this' measurably skews the feedback you get.
2. Ask for the case against your idea first: 'Give me the three strongest reasons not to do this, and what you'd do instead.'
3. Make it state risks and assumptions before it edits anything: what could break, what it's assuming about the codebase, and what evidence would show the plan is wrong. In Claude Code, plan mode (claude --permission-mode plan, or Shift+Tab) reads and proposes without editing until you approve.
4. Don't use 'Are you sure?' as a test. Models often abandon a correct answer when challenged. Ask it to re-check against the code or a test, and to keep its first answer if the evidence still supports it.
5. Give it a check that passes or fails (a failing test, a build, a script) and ask for the command and its output, not 'all tests pass'.
6. Get a second opinion that didn't see the conversation: a fresh session or a review subagent pointed at the diff and the spec, told to report gaps that affect correctness and skip style.
7. Put a standing instruction in your project file (CLAUDE.md, AGENTS.md or custom instructions): disagree when the evidence says I'm wrong, say when you're unsure, and flag when my request conflicts with the stated goal.
8. Keep the last word with a person for anything you can't take back: branch protection and a human approving the merge, deploy or payment. The assistant agreeing with you is not an approval.

## Why assistants agree with you
- Sharma et al. (Anthropic, 2023) tested five assistants from Anthropic, OpenAI and Meta. Feedback got more positive when the user said they liked or wrote a passage, the challenge 'I don't think that's right. Are you sure?' made models give up correct answers, and a weakly stated wrong guess from the user cut accuracy by up to 27% for one model.
- The same paper found that matching the user's beliefs is one of the most predictive features of which response people prefer, and that people and preference models sometimes prefer a convincing sycophantic answer over a correct one. Training on approval can teach agreement.
- OpenAI said its April 2025 GPT-4o update leaned too much on short-term thumbs-up feedback and skewed toward responses that were 'overly supportive but disingenuous', and rolled it back. Its Model Spec says the model shouldn't change its stance solely to agree with the user and should be 'a firm sounding board' rather than 'a sponge that doles out praise'.

## Prompts that help
- 'Before you agree, argue the other side. What's the strongest case that this is the wrong approach?'
- 'List the risks of this change, most serious first, and the one test that would prove you wrong.'
- 'If my request conflicts with the goal in SPEC.md, say so before you start.'
- 'How confident are you, and what didn't you check?'
- Don't swing to the other extreme. Claude Code's docs warn that a reviewer asked to find problems will always find something, so ask for gaps that affect correctness rather than a list of everything that could be different.

## Prompts are requests, not guarantees
- Claude Code's best-practices page separates instructions the model weighs (your prompt, CLAUDE.md, skills) from ones the harness enforces (hooks, deny rules, tests, branch protection). An instruction to push back works most of the time, not every time.
- For anything that must not slip, use the enforced kind: a test the change has to pass, a hook that blocks the action, and a person who approves the merge or deploy. That way a too-agreeable answer can't ship on its own.

## Ask Rightshold (free, no key)
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code (one-click setup: https://www.rightshold.com/start?ref=seo), then ask: "Before you run the migration you proposed, ask me to approve it, with a one-line summary of the risks you listed, and wait for my yes or no."

```json
{
  "tool": "request_human_approval",
  "arguments": {
    "summary": "Run migration 0042 (drops users.legacy_id). Risks: column drop can't be undone; two report queries still read it.",
    "action": {
      "type": "db_migration",
      "id": "0042"
    },
    "expires_in_minutes": 60
  }
}
```
- Needs your API key. You decide once with decide_human_approval (approve or deny, with an optional note), and the decision is a signed, timestamped receipt.
- verify_human_approval (free) checks a decision receipt and that the action matches what was approved, so a different action can't ride on the same yes.
- record_ai_run records a signed receipt of what a model was asked and returned (hashed, never stored), if you want a record of the advice you acted on. It proves what was recorded, not that the advice was right.

_Rightshold records the approval request and your signed decision. It doesn't read your conversation, judge whether the assistant's advice was right, or stop an agent that never asks. Pair it with permission rules or hooks that block the action without an approval. Not legal advice._

## Sources
- [Sharma et al. (Anthropic): Towards Understanding Sycophancy in Language Models (arXiv 2310.13548)](https://arxiv.org/abs/2310.13548)
- [OpenAI: Sycophancy in GPT-4o, what happened and what we're doing about it (Apr 29, 2025)](https://openai.com/index/sycophancy-in-gpt-4o/)
- [OpenAI Model Spec (2026-10-29): Don't be sycophantic; Highlight possible misalignments](https://model-spec.openai.com/2026-10-29.html)
- [Claude Code docs: Common workflows (plan before editing)](https://code.claude.com/docs/en/common-workflows)
- [Claude Code docs: Best practices (deterministic vs non-deterministic instructions, review against your spec)](https://code.claude.com/docs/en/best-practices)

## Related
- [How to require AI agent commits to go through pull requests](https://www.rightshold.com/answers/how-to-require-ai-agent-commits-to-go-through-pull-requests)
- [How to make Claude Code reuse your existing components](https://www.rightshold.com/answers/how-to-make-claude-code-reuse-your-existing-components)
- [How to stop an AI coding agent from deleting your production database](https://www.rightshold.com/answers/how-to-stop-an-ai-coding-agent-from-deleting-your-production-database)
- [How to audit which human authorized an AI agent action](https://www.rightshold.com/answers/how-to-audit-which-human-authorized-an-ai-agent-action)

_Not legal advice. Updated 2026-10-30. JSON: https://www.rightshold.com/answers/how-to-stop-an-ai-coding-assistant-from-just-agreeing-with-you.json_