Closing the AI Loop in Software Development

These days I’ve been thinking a lot about something that seems crucial if you’re developing with AI: 💥 you’re probably doing it wrong 💥
And me too, okay? I don’t blame you.
And it’s not because you don’t know how to use a model or because you don’t code well, but because you’re not giving the agent the same capabilities a human developer has.
We want AI to understand, diagnose, and fix errors, but it can’t do that if we keep it blind and deaf to the development environment.
If you manage to close that loop, the magic happens: the agent stops being a clumsy assistant and becomes an autonomous developer capable of detecting and solving problems.
Let’s see what it needs to get there 👇
1️⃣ Access to the code
This is the basic step, and the one that’s mentioned the most: letting the agent read and understand your code. The clearer it is, with good architecture, documentation, and consistent naming, the more efficient it will be.
There’s no big secret here, but it’s the foundation of everything.
2️⃣ Access to persistence (database)
Your model needs to understand what’s in your database. Many errors aren’t in the code, but in the data it handles.
If you use a library like Prisma, let the model know: it knows how to read its schema and query information.
If not, you can use an MCP or any other interface that allows controlled access to the database.
Without access to the data, the agent is coding blind.
3️⃣ Ability to call the API
Your model should be able to communicate with the backend, especially if what you’re developing depends on remote services.
You can enable this in many ways:
- With the client code itself
- With an intermediate CLI or MCP
- Or with a well-defined JSON Schema or OpenAPI
With basic curl commands, if your API is well set up, it can do wonders.
Again, the idea is for the agent to be able to check what the API is actually returning and understand if the issue comes from there.
4️⃣ Being able to “see” and interact with the interface
If the AI generates UI code but can’t test it, you’ll end up being its pair of eyes, sending it screenshots or logs.
But it doesn’t have to be that way.
Today there are tools that let the agent interact with the interface autonomously:
- Playwright or Chrome DevTools for web
- Axe for iOS
- ADB or mobilecli for Android
With these, the AI can inspect the DOM, click around, and validate its own work.
When you combine all this —code, data, API, and UI— you close the loop.
And at that moment, your AI stops being just a glorified autocomplete and becomes a true digital developer.
We talk about all this (and much more) in the AI Expert training.
The November edition is full, but we’ll open a new round in January.
👉 More information and reserve your spot here
What do you think? Are you doing all this in your projects?
I encourage you to think about how you could give your LLM all these skills.
What is Loop Engineering? A practical example with Codex
I Don't Think the Token Subsidy Is Going Away. And That Says a Lot About the Future of AI