AI Has an XY Problem

The XY problem used to give itself away, one follow-up question at a time. Now AI answers every one of them, and people turn up nine steps down the wrong path with code that almost works.

AI Has an XY Problem

A client asked ChatGPT how to stop people right-clicking on their website.

It gave them a snippet of JavaScript, told them where to paste it, and it worked. Right-click was gone. A few weeks later they asked me why people were complaining they couldn't copy the phone number off the contact page.

What they actually wanted was to stop people pinching their product photos. Disabling right-click doesn't do that (anyone can still screenshot, drag the image out, or open the page source), but it does annoy every legitimate visitor. The useful conversation was about watermarks, image sizes, and whether it was worth worrying about at all. That conversation never happened, because the question that got asked was about right-clicking.

That's the XY problem: you want to do X, you decide Y is the way to do it, so you ask about Y. If nobody asks about X, you get a perfectly good answer to the wrong question. AI tools are very, very good at giving perfectly good answers to the wrong question.

The rabbit hole you can't see

The XY problem used to give itself away. Someone would ask about Y, you'd answer, and they'd come back with a follow-up. Then another. By the third or fourth question, the pattern was obvious enough that you'd stop and ask what they were actually trying to do. The rabbit hole was annoying, but at least you could watch it being dug.

Now those follow-ups go to a chatbot, and it answers all of them, patiently and confidently, without ever getting the slightly weary feeling that tells a human something's off. Right-click is disabled, so how do I stop people dragging images? Done. How do I stop them saving the page? Here you go. Nobody steps back and asks what the point of all this is.

So people don't reach me at step four any more. They reach me at step nine, when something finally breaks in a way the chatbot can't fix, and by then there's a stack of workarounds on top of the original wrong turn. Each one was a reasonable answer to the question that was asked. None of them were an answer to the actual problem.

It agrees with whatever you bring it

AI tools are very eager to accept whatever premise you hand them. Ask how to do Y, and the working assumption is that Y is a sensible thing to want. It'll rarely say "why do you want to do that?" because that's not what you asked.

The polish makes it worse. When a person gives you a half-hearted answer to a strange question, you can usually hear the doubt in it. "I mean, you could do that, I suppose..." is a useful signal. AI answers don't come with a shrug. The wrong approach arrives fully formed, nicely commented, with a short explanation of why it's a good idea. It sounds like a decision someone made carefully, when really nobody made a decision at all.

To the person asking, that feels like confirmation. They had a plan, they asked something that sounds like an expert, and it helped them carry the plan out. Why would they question it?

And it does it to itself

The less obvious half of this is that AI has its own XY problem. Give it a goal and it has a habit of quietly swapping that goal for the most literal version of your request.

  • "Get rid of this PHP warning." It puts an @ in front of the line, or turns error reporting off. The warning has gone. Whatever was causing it is still there.
  • "Fix this failing test." It changes the test so it passes. Technically a fix. The bug the test was there to catch is now safely hidden.
  • "My contact form emails aren't arriving." It writes a function that hooks into wp_mail and tries a few things, when the real issue is almost always that the server isn't set up to send email properly in the first place. I've got a whole guide on that one, and the answer is usually an SMTP plugin, not more code.

In every case it's done exactly what it was asked. The request was "make this symptom go away", so the symptom went away. The goal behind it, a site that works, wasn't part of the brief.

The agentic coding tools are getting better at this, to be fair, and some will now stop and say "this would suppress the error rather than fix it, are you sure?" But the default pull is still towards the narrowest reading of whatever you typed.

Where the unexplained fences come from

A lot of the mystery code I find on inherited WordPress sites turns out to be a leftover Y: a workaround for a problem nobody wrote down, solved in whatever way made sense to whoever (or whatever) was looking at the symptom at the time. I wrote about inheriting that kind of code in This Fence Has No Farmer.

The XY problem used to leave conversations behind it. Email threads, Slack messages, a half-remembered phone call. Now it leaves code that works well enough that nobody questions it, until someone finds it two years later and has to work out what X was supposed to be.

Making AI ask the question

None of this means the tools are useless. The irony is that AI is actually quite good at the XY problem when you point it in the right direction. It just won't usually do that by itself.

The simplest fix is to tell it what you're trying to achieve, not how you've already decided to do it. Compare these two:

  • "How do I disable right-click on my WordPress site?"
  • "I don't want people stealing the product photos on my WordPress site. What are my options?"

The first gets you a snippet. The second gets you watermarks, sensible image sizes, and probably an honest note that you can't fully stop it. Same tool, same knowledge, completely different outcome, because you gave it X instead of Y.

A few other prompts I find useful:

  • "Before you answer, tell me if this is the wrong approach." It gives the model explicit permission to disagree, which it otherwise tends to avoid.
  • "What would someone experienced do instead?" Surprisingly good at shaking loose the obvious answer buried under your plan.
  • "Fix the cause, not the symptom." Worth adding to anything involving errors, warnings or failing tests.

If you're a client reading this, you don't need to be good at prompting to avoid the worst of it. Just describe the problem, not your solution. That's most of the trick.

The human bit hasn't changed

The answer to the XY problem has always been the same: answer the question, then get curious about the bigger picture. What's changed is how deep the hole is by the time anyone gets curious, and how convincing the workarounds look along the way.

That curiosity is still mostly a human job. The AI will happily help you dig. It'll even tell you you're digging very well. It just won't often look up and ask why you're digging in the first place.

RSS