What EBNF Is and How it Can Make Your AI System More Robust

· Dev Genius ·

2 min read Original article ↗

A 60-year-old notation for describing languages is the cheapest way to check tool calls before they run.

Cheikh seck

Your AI can’t do anything by itself.

It can’t open a file. It can’t send a message. It can’t check the time, read a database, or restart a server. It has no hands.

So it writes a note instead.

read_file(path="/etc/hosts")

This is commonly known as a tool call. A model that guesses the next word writes a short line of text, and a program on the other side reads that line and does the thing. Every agent, every assistant, every “AI that books your flights” works this way. The note is the only thing the model actually controls.

Which means the note is the only place you get a say.

And here’s the uncomfortable part: almost nobody checks the note. Most systems pull the arguments out with a regular expression, shrug, and execute. When that check is wrong — and it’s wrong more often than anyone admits — it doesn’t complain. It says fine. The malformed call goes through, does something almost right, and the bug surfaces three layers away wearing a different costume.

This article is about the cheapest way to fix that. It’s a notation from 1960, written down as an international standard in 1996, sitting in Go’s experimental library in a package almost nobody opens. We’ll…