Silent errors in AI code that are easy to miss

Alexander Busse·November 24, 2026

New articles by email

We send you an email whenever a new article is published. Only the new article, no advertising. You can unsubscribe at any time via the link in every email.

You will first receive a confirmation email. By subscribing you also consent to our email service Brevo recording whether you open the emails and click links in them. Details are in our privacy policy.

Flat illustration: a person walks along a path away from a well, carrying a glass jug with a crack. The jug is only half full, and drops fall from the crack. Behind them a trail of water drops leads all the way back to the well.

One risk in coding with AI comes from limits anchored deep in the training data, and those limits can cost dearly. In our case, a single number in the code meant that a check never finished reading roughly nine out of ten pieces of evidence. Even so, it decided which of our AI's proposals would stand, and it was allowed to reject up to half of them. There was no warning, and its results looked complete.

The check is part of OdySecure. There, an AI proposes risks, and every proposal has to cite its evidence, an entry from a catalogue of known threats. The check is meant to verify that the proposal is backed by that entry. It stopped after 280 characters. A typical entry was 1,188 characters long, so it saw about a quarter. For the longest entry, it missed 94 percent.

Cuts like this caused errors again and again while we were building OdySecure. For us, it was the most expensive error we have had from AI development. We found the same trail in three more places. At its end stood a suspect we had brought in ourselves. Three days after we had banned the practice, the suspect wrote a new silent limit.

A counter brings it to light

We only noticed the error when we counted, over a complete run, how much text was lost along the way. We then found the place by reading the code. It was an inconspicuous number. We call such upper limits on length, count or time, and every cut to an input, caps.

Whether the check rejected correct proposals because of it, we do not know. What is certain is that it decided on about a quarter of its evidence. Since 31 August 2026 the limit follows the measured length of the entries, and we split large volumes across several requests instead of cutting them.

Three more cases

Findings were missing from our supplier assessment. The response schema, the form the model's answer must take, limited the result lists to 60 entries. The model read that as an instruction and left findings out. Truncated answers silently counted as complete. Even the error message was cut to 500 characters. That removed exactly the detail needed to clear up such a hit. Our finding of 30 July 2026: "None of these caps was recognisable as a cap."

Until early August 2026, our self-hosted models used only half of their context window, the amount of text a model can read and write at once. We had measured 262,144 tokens, a token being a piece of a word. The configuration said 131,072 in every row, so each request could read and write only half as much. The note on the fix speaks of "cuts that physically need not exist at all".

AI proposals continued existing texts that had been silently cut to 2,000 characters beforehand. Our finding on it: "The proposal then read like a continuation of the existing material and was a continuation of its first half."

Why nobody noticed

Each time, the code or the configuration contained a limit that seems reasonable where it sits. As long as the data is small, it does not strike. When the data grows, in our experience the system usually keeps running and delivers a plausible, smaller result that counts as complete. To users, whatever was cut off looks like a gap the model failed to find.

Ordinary tests miss this, because a shortened text also produces a plausible result. Errors like these can only be found with thorough testing. If you have software built with AI, you can end up with incomplete reports without any sign of it. Some limits make themselves known as a rejection or an abort. The silent ones were the ones that cost us.

Caught in the act

Suspicion fell on the AI assistants we write code with. Since 7 September 2026, a rule in our project file has forbidden silent caps. That is the file of working instructions our AI assistant reads.

Three days later, an AI assistant wrote a connector, meaning a link to a vulnerability scanner. The connector cut links to 200 characters and so turned long addresses into broken ones.

On 4 November 2026, a second connector took over the same cut and the same count limit, a maximum number of findings per report. Next to that limit, the code says "the same construction and the same number". The count limit was not silent. It rejected oversized reports with an error message. But the assistant itself called its number "a chosen operating limit" and "not a measured size". So it wrote down that the number was not measured, and set it anyway. Both were found by a second model that reviews our changes before we adopt them.

So even if you know the pattern, it is hard to train it out of the AI. The maker of an AI coding assistant writes in its documentation that the assistant treats rules in project files as context, not as enforced configuration. According to that documentation, blocking an action reliably takes a technical block.

The motive

Language models learn from code that existed before their training. The first two generations of Llama, a model family from Meta, read about 2,000 and about 4,000 tokens at once in 2023 (Touvron et al.). Our self-hosted model processes one million tokens today.

How firmly models hold on to what they learned has been studied for deprecated programming interfaces. Asked to complete code from real projects that originally used a deprecated interface, models proposed the deprecated one again in 70 to 90 percent of usable completions. A hint in the request did not fix this sufficiently (Wang et al., ICSE 2025). The study covered smaller code models and GPT-3.5, not today's assistants. Models can follow coherent information that contradicts what they learned. But if part of the information matches what they learned, they tend to stick with it (Xie et al.).

We know of no such study for upper limits. We still consider the pattern a plausible explanation of our cases. A limit of 2,000 characters is far too small for a model with one million tokens. We suspect the same cause as with the deprecated interface: such limits are in the code AI learned from. We cannot prove this for any single number.

Once such a limit is in the code, new code adopts it, as our second connector did. A public collection of patterns in AI code describes the same for fixed default values and calls it amplified by AI, but not found only in AI. On top of that, we suspect that a number makes an unknown risk look manageable. In a code review, "unlimited" reads like an oversight and a number reads like diligence.

The false lead

The obvious move would be to set every limit generously. That is what our own house rule required at first: two to three times the highest observed value. That calculation produced a limit of 45,000 tokens. On 6 September 2026, a run meant to generate policies ran into this limit. At the end there was not a single policy. Since then, any limit on how much is read or produced needs an observed event in which it struck. A factor is not enough.

How we catch such limits today

Limits against repetition, endless loops, an overlong total run time and runaway costs remain welcome. A content limit sets how much a work step may read or produce. If it strikes, that points to an error for us. We fix it, and the limit goes. If it never strikes, it is dead weight and goes as well.

Every content limit on a model call, meaning a request to an AI model, is listed in a hand-checked inventory. Each entry has a reason, a deadline and the event the limit is tied to. Automated checks look for new limits in the code. They fail if the entry is missing, a deadline has expired or text for the model is shortened with a bare character cut. "That way a new silent cap costs its author an explanation instead of costing us an analysis." These checks reach as far as the model calls and the text we assemble for them. The cut in the connector was outside that range. The second model found it.

If a limit strikes on a model call, it is logged with the measured value, and at 70 percent use a warning follows. Cuts before the call are counted per limit. We never pass a truncated answer on as a valid result. When a time limit runs out, the process ends with a message of its own and never as "done, empty".

What to ask your development team

There is a lot of talk about AI and security, but in our experience this silent error rarely comes up. Anyone who uses AI-written code needs an inventory of its limits. Ask your team or service provider to show you the numbers in the code that decide how much is read, produced or waited for. For each one, ask what it is tied to and whether it fits the models you use today. Ask who reviews AI code independently before it is adopted, and whether testing uses real data volumes. As long as test data stays below its limit, a cap never triggers. The case is not closed with that, because new code can bring a new cap.

Get new articles by email. Only the new article, no advertising.

New articles by email

We send you an email whenever a new article is published. Only the new article, no advertising. You can unsubscribe at any time via the link in every email.

You will first receive a confirmation email. By subscribing you also consent to our email service Brevo recording whether you open the emails and click links in them. Details are in our privacy policy.

Related articles

Related services