BlogAI & ML

Why AI Agents Miss Edge Cases Nobody Mentions

Why do AI models miss edge cases? Mostly because they stop looking. Named cases were missed 22% of the time, unnamed ones 74%. What our failed runs showed.

Nomos Insights
Updated 5 min read

AI models miss edge cases, the unusual inputs and situations at the boundary of normal use, mostly because they stop looking, not because they cannot handle them. In our codebase questions, the strongest model we tested usually caught a case when the question named it, and usually missed the same case when the question left it unnamed.

Here's a pair of numbers that changed how our engineers write tasks. When one of our codebase questions named a case directly, a frontier model (one of the strongest models available at the time) missed it around 22% of the time. When the question covered the exact same case without naming it, the model missed it around 74% of the time.

Same model, same code, same case. The only difference was whether someone said it out loud.

One failure is a story

If you want to know where a strong model is weak, you have to watch it fail a lot. One failure is a story. A few hundred start to show a pattern. Our engineers ran our codebase questions through a frontier model again and again, read the failed answers line by line and wrote down what they saw.

That named versus unnamed gap tells you something important. The model can usually handle the case. It just doesn't go looking for it. Ask "what happens with empty input" and it checks. Ask "which inputs can cause this" and it checks the obvious ones and stops.

So when we write a question now, we name the group we care about, like "every kind of input this tool accepts", but we don't hand over the list of cases inside that group.

Where else do strong models fall short?

In five more places, each one a kind of case that is easy to leave unchecked.

  • Inputs nobody showed. Empty values, unusual encodings, a time without seconds, old style line endings. Models don't make up strange inputs on their own. Around 71% of these cases were missed.
  • Library and system behavior. When the answer depends on how a library or the operating system behaves, the model often assumes the simple version. About half of these were missed.
  • Long chains. When the answer touched three or more places in the code, misses went up to about 54%, compared to about 35% for answers in one place.
  • State, time and order. What happens on the second run, after a restart, or when two things happen close together. Missed somewhere between 37 and 48% of the time.
  • Things that never happen. Models are weak at noticing what code doesn't do, like a check that's missing or a step that never runs.

Terminal agents show a close cousin of this habit, covered in Why AI Agents Fail at Terminal Tasks.

What does failing by silence mean?

It means the model stops before it reaches a case. This is the part we didn't expect. When our reviewers went through what the strongest model got wrong, around 69% of the misses weren't wrong statements at all. They were cases it never reached.

The model wasn't confused. It was done too early.

We also tried planting wrong beliefs in the question, like a colleague's mistaken theory. On the strongest model this almost never worked. Across 195 trials it didn't take the bait once. A weaker model did fall for it sometimes. So traps aren't a useful way to make tasks hard for top models. Breadth is.

How should you write tasks that test edge cases?

Name the group of cases, never the cases inside it. A scoring list, the set of facts a correct answer must contain, only has so many rows, so every missed fact costs a real share of the score. In our experience the best tasks hide four to six facts spread across three or more areas of the code, all reachable from the question and none of them named, so that is what our engineers aim for when they write a question. A careful engineer can get everything right. A hurried agent can't.

If your evaluation set mostly names the cases it tests, your scores will look better than your model really is. Real users don't list every case. They describe a problem and expect the tool to think of the rest. Your test data should work the same way.

The full project behind these numbers is written up in How to Test Whether AI Agents Understand a Codebase.

FAQ

What's the most common way strong AI models fail on code questions? They stop too early. When our reviewers went through the misses, most were cases the model never checked, not wrong claims.

Do trick questions make tasks harder for frontier models? Not much. When we planted wrong ideas in our questions, the strongest model ignored them. Writing questions that cover many unnamed cases was far more effective.

How many hidden facts should a hard task have? In our experience, four to six facts spread across at least three parts of the code worked best.

Why do edge cases matter when testing AI agents? Real users rarely list every case, so a test set that names them makes a model look stronger than it is.


Want Tasks That Find Your Model's Blind Spots?

Our engineers write evaluation tasks for AI labs and model teams that hide the cases real users never mention, with every fact verified in the code and each set delivered when your evaluation cycle needs it.

Get in Touch
Filed underFrontier ModelsAI AgentsFailure ModesAI Evaluation