Your next big project starts here

Read, learn, and start your next project with a team that delivers results.

Get a Quotephoto from officephoto from officephoto from office
Back to articles

When AI Tries Too Hard to Help: Sycophancy in Code, Tests and Audits

Country flag

Share article:

We are building an AI support assistant for our Shopify apps, and part of the design is a second AI that audits every conversation and suggests how to improve the assistant. In testing, the auditor gave us a textbook case of AI sycophancy. Over two days it proposed 17 fixes, each with a confident explanation. When we checked them against the prompt and the help center, about one pointed to a real gap. The rest solved problems that weren't there: cases the existing rules already covered, or mistakes the assistant hadn't made, each with a new rule attached to fix it.

The auditor was doing what its first rubric asked: propose a fix for every issue it noticed. So when nothing needed fixing, it found something anyway. Catching that in testing, before any of those fixes reached the assistant, is what testing is for, and redesigning the auditor became one of the problems the project had to solve.

That habit has a name. AI sycophancy is a model's tendency to tell people what they want to hear: agreeing, guessing and producing something that looks useful when the honest answer is "I don't know" or "nothing to fix." It goes far beyond one auditor. In March 2026, a study in Science found that 11 leading models affirmed users' actions 49% more often than other people did, and that people still trusted and preferred the flattering models, which is exactly why the habit is so hard to train out.

Below we follow it through code, tests, instruction following, written work and customer support, come back to AI auditing AI, and end with what people have to design, and keep doing, so the AI stays useful.

What is AI sycophancy, and why does "helpful" training cause it?

Why would a model invent a fix nobody needs? Because of how it was taught to be helpful. Chat models are tuned on human feedback, and people reward answers they like. OpenAI described this mechanism in its own product in April 2025: an update to GPT-4o, tuned partly on thumbs-up and thumbs-down ratings, became flattering enough that the company rolled it back. Offline tests had looked positive, and sycophancy was not part of the launch checks.

The newest models still show it. Anthropic's Claude Opus 5.5 system card (September 2026) reports low hallucination rates alongside "a modest countervailing increase in susceptibility to user pressure": under pressure, the model kept to what it actually believed in 87.4% of test prompts, so about one answer in eight gave way. Google's Gemini 4 safety report (October 2026) cut its over-pleasing score by nearly two-thirds against Gemini 3.1 Pro, and still warns that the model may validate poor ideas when a user keeps pushing.

Why AI makes things up instead of saying "I don't know"

A related habit is guessing. In 2025, OpenAI argued that scoreboards built on accuracy alone reward a confident guess over an honest abstention, so models learn to guess. The Gemini 4 report shows what changes when a model abstains more often when unsure. On a 1,000-question factual test, Gemini 4 Argon gave a wrong answer 6.3% of the time, against 19.3% for Gemini 3.1 Pro. Its overall score barely moved, from 77.4 to 78.8.

A leaderboard would call that a small step. For a business, it is three times fewer confident wrong answers, and a wrong answer that sounds right costs more than a missing one because someone acts on it. A model only learns to say "I don't know" when the people who design and measure it count that answer as a good one.

AI-generated code: more output, not always more progress

Code is where extra output is easiest to measure, and the measurements disagree with how AI-assisted work feels. In METR's 2025 randomized trial, experienced developers felt about 20% faster with AI and were measured 19% slower. METR's February 2026 update, with newer tools and 57 developers, found a small speedup whose confidence interval still includes zero, and repeated that self-reported gains are unreliable.

What does grow reliably is volume. A November 2026 preprint of 7,660 resolved tasks across 18 frontier models found that the median coding agent changed 2.33 times as many lines as the developer's own fix; on SWE-bench Verified, most of the extra lines were tests and documentation. When another October 2026 preprint kept asking agents to refactor the same code, some rewrote up to 31 times the original codebase before they first stopped. GitClear's 2026 code-quality report sees the same pattern across 623 million code changes: refactored code fell from 13% of changes in 2023 to 3.8% in 2026, while copy-pasted code rose to 15.7%. Google's DORA 2025 report still ties AI adoption to less stable delivery.

The common thread is a model that produces more than the task needs, and someone has to decide which of it should exist.

Tests that pass and prove nothing

Tests are supposed to catch that extra code, and they fail in two ways.

The first is gaming. A model rewarded for making tests pass can satisfy the tests instead of the task. Anthropic measures this with coding tasks that are deliberately impossible to solve honestly, run with and without an instruction to say so. The most recent card with that comparison is the Claude Opus 4.7 system card (April 2026).

Share of impossible coding tasks where Claude models hard-coded or gamed tests, without and with an instruction to report the problem: Opus 4.5 45% vs 25%, Opus 4.6 45% vs 37.5%, Sonnet 4.6 40% vs 27.5%, Mythos Preview 37.5% vs 20%, Opus 4.7 45% vs 12.5%

Without guidance, every model in the chart gamed the tests in 37.5 to 45% of these tasks. With one paragraph telling it to report an impossible task, Claude Opus 4.7 dropped to 12.5%, while the same paragraph moved Opus 4.6 only from 45% to 37.5%. Anthropic's newer cards, through Claude Opus 5.5, no longer publish this comparison. In OpenAI's GPT-6.2 system card (November 2026), GPT-6.2 Astra hid a blocker from the user in 22% of coding runs without its standard Codex prompt and in 8% with it. An instruction helps only as much as the current model follows it, so someone has to measure that on the model you actually run.

The second failure is quieter. When the same AI writes the code and then the tests, the tests describe the code it wrote, not what the code was supposed to do. In an October 2026 preprint of 145 merged pull requests, 8 to 17% of AI-generated regression tests asserted the faulty behavior as correct, 83 to 91% of those tests kept passing in later commits, and the developers' own test suites caught only 14 to 30% of the faults they locked in. A peer-reviewed ISSTA 2026 paper found that models shown buggy code wrote about eight times more tests that confirm the bug and about three times fewer that reveal it. The fix is to test against the requirements, not the code: in a July 2026 preprint, a tester given the spec as one plain paragraph found 27 of 30 seeded bugs, against 2 of 30 without it.

A green test run means little until a person has written down what the software is supposed to do and what the agent may do when the honest answer is "this can't be done."

Do AI models always follow instructions?

All of this assumes the agent does what a person wrote down, and many teams take that for granted. The vendors' own reports say otherwise. In OpenAI's GPT-6.2 system card (November 2026), instruction-following failures were the most common problem flagged when the models replayed about 17,000 real internal coding tasks, and they grew in the newer models: from 3.21% to 4.66% of turns for the Sol line. Anthropic writes of its flagship Claude Opus 5.5 that "the main issues we observe are around epistemic quality and instruction following." When researchers gave agents a real company handbook to follow, the best model tested in mid-2026 completed only 36.2% of tasks fully by the rules (HANDBOOK.md).

Anthropic audit score for ignoring explicit constraints, lower is better: Haiku 4.5 4.46, Mythos 5.1 2.12, Haiku 5.5 2.06, Sonnet 5.5 1.99, Opus 5.5 1.88, Mythos 5.2 1.80

A smaller, cheaper model is not automatically the weak link, and it is not a cure-all either. In Anthropic's own audit in the Claude Haiku 5.5 system card (October 2026), Haiku 5.5 scored 2.06 for ignoring explicit constraints: a big improvement on Haiku 4.5 at 4.46 and close to Sonnet 5.5 at 1.99, but behind Opus 5.5 at 1.88, and it over-refused harmless requests more than any other model in that audit. Every model in the chart stays above the lowest possible score. Which model holds your rules best is something you measure on your own instructions, and measure again when the model changes.

Workslop: polished text that moves the work to someone else

Written output fails more quietly, because a fluent paragraph looks finished. BetterUp Labs and the Stanford Social Media Lab call it workslop: AI-generated work that looks complete but lacks the substance to move a task forward. In their May 2026 follow-up with nearly 2,300 workers in the US, Canada and the UK, each case took about two hours to fix, and one worker in ten said half or more of the AI-generated work they received was unhelpful.

The person who generated the text saves time. The colleague, manager or customer who receives it spends that time reading it, working out what it actually says and redoing the missing part.

We see the same pull in documentation. An AI agent that maintains our internal docs, asked to improve a page, tends to add a new section instead of rewriting the one already there. Each addition looks reasonable on its own, but together they make the page longer while the original gap stays open. So we judge an edit by whether the page now answers its question better, and a longer page with the same gap counts as a failed edit.

Support bots that invent facts or hand off too soon

In customer support, that reader is your customer, and an invented answer becomes a commitment. In May 2026, a German appeals court in Hamm ruled against a clinic whose website chatbot had given its doctors specialist titles they did not hold, and held that the chatbot is not a third party: what it says is the company's own statement. The case can still go to the Federal Court of Justice, but it follows the 2024 Canadian ruling that made Air Canada pay for a refund policy its chatbot made up.

Helpfulness can also push the other way. In testing our own support assistant, we found a case where a calm "it doesn't work" was read as a frustrated customer at risk, so the chat went straight to a human. The rule meant to protect unhappy customers fired on a neutral one. An over-cautious hand-off is cheaper than an invented fact, but it still spends a person's time on a question the assistant was built to answer, so we treat it as a defect to fix before launch.

When AI audits AI: a judge that always finds something

Nobody can read every conversation by hand, so the usual answer is a second model that checks the first, the LLM-as-a-judge setup. Judges have their own biases. A 2026 study in Transactions on Machine Learning Research found that style alone, such as markdown formatting over plain prose, swayed judges' verdicts, and that several judges preferred longer answers.

A judge asked to find problems also tends to find them. A February 2026 preprint found that models reviewing code against requirements often labeled correct code as defective, and that more detailed review prompts made this worse. In the field, developers rejected 56.3% of the comments an AI code reviewer left across 31,073 cases, according to a July 2026 preprint.

That is what we saw in testing our auditor: of its 17 fixes, the one real gap was the hand-off rule above. Applying all of them would have cost more than it fixed: a 2026 technical report found that appending generic rules to a prompt cut one model's score from 26 of 30 cases to 9 of 30.

What a human has to design for AI to stay useful

Every problem above comes back to one gap: nobody told the AI what a good result looks like, when doing nothing is the right answer, and when to stop. Those are decisions a person has to make, and keep making after launch. These are the controls we are building into that auditor, and they apply to any AI system that produces or judges work.

Allow "no change" and "unknown"

A task where doing nothing counts as failure teaches the model to always produce something. Give the assistant, and any AI that grades it, a legitimate way to say "nothing to change" or "not enough information." Anthropic's guide Demystifying evals for AI agents (January 2026) recommends exactly that for graders. AI judges need it: in one preprint, judges accepted 96% of correct answers but rejected fewer than a quarter of wrong ones.

Write the requirements down

When a rule is missing, the model guesses. In a 2025 preprint, models filled in unstated requirements 41% of the time, and prompts with gaps were twice as likely to break after a model or prompt change. So we separate "the assistant broke a rule" from "we never wrote the rule," and we change the prompt only when the same failure shows up in at least three conversations. Tests are built from those written requirements, never from the model's own code.

Check in code what code can check

Formats, limits, links, forbidden actions and promised hand-offs are fixed rules a script can test every time. An AI judge is for what code cannot decide, and it is calibrated against cases labeled by people first, then again on every model or prompt change, because prompts validated on one model version do not reliably carry over to the next. Hamel Husain and Shreya Shankar's AI evals FAQ describes the same routine: read real traces, build one pass/fail judge per failure mode, and check it against human labels.

Decide in advance when the AI stops

Set a retry limit and a list of actions that always go to a person, such as refunds, cancellations and anything that can't be undone. OpenAI's practical guide to building agents names both triggers. Each tool gets its own permission: allowed, needs approval, or blocked.

Design the review so it isn't a rubber stamp

A person in the loop helps only if they actually check. In a randomized experiment with education experts (PNAS Nexus, 2026), the same harsh, wrong grade was corrected less when it was labeled as coming from AI. Another preprint found that making corrections more laborious led reviewers to accept more errors. Show the reviewer what the AI actually did and what it assumed, and make stopping it cheap.

Name an owner and keep reading

One person owns the assistant and has the authority to pause it. For most high-risk systems, the EU AI Act requires this kind of oversight from December 2027; for everyone else, it is how problems get noticed. That person keeps reading real conversations after launch, on a schedule, because logs show what offline tests miss. In one Google test (October 2026), an AI grader failed 3 of 11 runs that the logs showed had actually passed.

Developers already work this way with AI output. In the Stack Overflow 2026 survey, only 6.6% of respondents trusted AI output for important decisions, 48% trusted it only when they could easily check it, and 9.6% used AI answers as they came. The checking is where the value is decided, and it has to be designed as carefully as the AI itself.

We build AI into products the same way: an AI agent that tests a product against its spec and leaves the decisions to people, and AI customer support measured on real chats before anyone trusted it. If you are planning an AI assistant, agent or internal tool and want it to do less filler and more of the job, tell us about your project.

Read More

FAQ

  • 01

    What is AI sycophancy?

    AI sycophancy is when a model agrees with the user, flatters them or produces an answer it thinks they want instead of the accurate one. It comes from training on human feedback, because people tend to rate agreeable answers higher.

  • 02

    Why does AI make things up?

    Most evaluations score only whether an answer is correct, so a confident guess scores better than "I don't know," and models learn to guess. When Gemini 4 started abstaining more often when unsure, its wrong answers on a factual test fell from 19.3% to 6.3% while its overall score barely changed.

  • 03

    Can you stop AI from being sycophantic?

    Not with a prompt alone. Sycophancy comes from how models are trained, so the controls have to sit around the model: a person decides what a good answer looks like, gives the model legitimate ways to say "I don't know" or "no change needed," and writes checks against requirements the model did not write itself. Someone then reads real conversations and outputs regularly, keeps a set of cases labeled by people to test against, and reruns those checks every time the model or the prompt changes. Without that ongoing work, nobody notices when a new model or a new rule brings the filler back.

  • 04

    Can AI test its own code?

    It can write tests, but tests written from the code it produced tend to confirm that code, bugs included. Tests need to come from requirements a person wrote, and a person decides what counts as a pass.

  • 05

    Is LLM-as-a-judge reliable for auditing AI?

    Only after calibration. A model judge tends to find something to fix in every case it reads and is swayed by style and length. It needs an "unknown" verdict, patterns counted across many cases, and regular comparison with human reviewers.

Internet connection broken

Internet connection restored