Logo

Programming with agents: how to keep control

November 17, 2026/14 minutes/Rene Pot

Programming in 2026 looks very different from programming in 2016. This is, of course, something you are very much aware of if you’ve been doing anything with programming in the last few years. But this year is something completely different.

Since the release of ChatGPT in 2022, many software developers have found ways to integrate AI into their workflows. It started with asking ChatGPT to write certain functions, doing small, innocent refactors or writing tests right in the chat interface, then using GitHub Copilot in your IDE, and now we're at agents running on your machine or in the cloud, making thousands of line changes every minute. 

The pace at which things change

When I started planning to talk about this subject in early 2026, I had a completely different answer than I do today. And most likely this answer will be completely different next year. This is how fast things change, and how challenging it can be to keep up with them. The rate at which new, increasingly capable models are released reminds me of how fast PC hardware used to change from the early 90s to the 2010s. A 3-year-old PC in 2000 was really due for a replacement, but a 3-year-old PC today might be a bit outdated, but still more than capable. 

So now, this race for better models is very much a thing impacting us software developers. And the change happens fast enough that it’s hard for me to recommend which model you should use, because by the time you’re reading this, a new model might've been released that would change my recommendation. But I’m going to try.

6 months ago I would’ve written a different article entirely. The capabilities introduced with Astra (OpenAI), and by extension every GPT-6 model, and Opus on Claude, are so significant that my recommendation has shifted from small PRs guided by your manual review to full autonomy using Agents and spec-driven development. Given how quickly these models have changed the way I work, I can only imagine what the next 6-12 months will look like. But it's time to dive into how I’d recommend you work today (November 2026) and possibly over the next 12 months.

What does keeping control mean

So you started reading this article to find guidelines for controlling your AI agent. And this is an important topic. We’ve all heard stories of AI agents messing up the code badly and causing downtime. This will never be 100% avoidable if you start using agents for more than small code changes; however, there are a lot of things you can do to prevent anything from happening.

Keeping control is key. And there are many tools at your disposal to do this, from third-party applications to other AI agents monitoring your PRs to text-based solutions. Text-based solutions are the biggest improvements you can make and will ensure you need to make the fewest changes in every step that comes after.

Control, when it comes to code, is knowing what happens, why it happens, how it happens, and what this means for your code quality. You want to know why an agent makes changes, the code it uses to make these changes, and if these changes don’t impact other things in your codebase.

I have personally been using ChatGPT since 2022 (including their API’s), and my Codex usage started as soon as I could get my hands on the desktop client in early 2026. So most of the things I’ll be sharing here are tailored to my personal experience using Codex. But I have had enough experience using Claude Code to know all these lessons apply to Claude as well.

Write instructions

This is by far my biggest tip for anyone working with AI agents, whether it is doing full rewrites in Codex, asking a Cloud-based agent to refactor your entire codebase, or just making minor changes using a ChatGPT chat in your browser. 

There are many places where you can write instructions, and I’d use them all. I’ll explain each I’d recommend using, and when you should use it.

General Agent Instructions

This is primarily for how you like working with the AI. In Codex, you can change “Codex Instructions” in the personalization settings. I use these settings to help me communicate with the Agent and let it understand how I work and what my skills are. But also how I like it to answer my requests.

An example of this could be:

In every thread we work on code, if there are uncommitted changes do not continue and let me know there are pending changes.

When I ask you to do something, ask 3 critical questions that could clarify the request in case of ambiguity.

Follow instructions in every repository and in case of unclarities, or conflicting instructions halt work and explain what the conflict is.

Instructions like these have more than once prevented changes to code I would’ve needed to roll back or alter completely. This would’ve cost me a significant number of tokens and might’ve burned through my weekly allowance. Of course you can add to this whatever you want, but make sure not to make it duplicate the other instructions, or make things more complicated or confusing than they need to be.

AGENTS.md

Now that Claude Code finally also reads the AGENTS.md file, this instruction is now universally accepted, and it's the best way to write instructions about your repository. This file should contain general instructions for your agent on how to handle the repository, how to apply changes, and how to test them. 

You can easily go wild in this file, but it is important to restrain yourself in what you put in here. The most important instructions should go here, and the file can reference other Markdown files for specific instructions. Keep in mind that this file is loaded on every conversation, so token usage will increase with very long files. But most importantly, stick to instructions that apply to EVERY interaction you’ll have with an agent for this application. This last rule alone can easily trim down your AGENTS.md file.

One helpful suggestion is to generate the initial AGENTS.md file using your agent. Use a prompt like

I need an AGENTS.md file for my repository, can you draft an initial version that takes style guide, contribution guide, and current linting rules into consideration. Keep it minimal, not wordy. Put only items in the file that are needed for every task.

This can get you a good first draft, which you can then alter to your needs and trim away text that would make things confusing or just add instructions most of your requests won’t need.

Skills

Skills are incredibly important in your Agentic setup. Skills can be written by yourself, or you can use one of the many skills provided by the community. Many companies provide skills to their users. These are very powerful, as you can be sure these skills instruct your Agent exactly how to program certain interactions with certain products. But if the companies themselves are not making the Skills, you will be able to find community-made Skills online. But, as with everything community-made, do verify these skills! Read the content. And not just manually, but also by an agent, as hidden instructions or straight-up exploits can be included in these files.

And if you can’t find the skill you need, or have company-specific skills that could benefit you and your team, then write them and share them! Skills are great for shared instructions. And if only you benefit from them, they can just be another markdown file in your repository!

Other markdown files

As mentioned in the AGENTS.md section, you can have further markdown files that dive into specificity. One example is design guidelines. Not every change you’ll make will require UI changes, but when you do, it’s important to have clear instructions.

One line you could add to your AGENTS.md file is

When doing anything user-facing, check DESIGN.md for instructions

Then, in your DESIGN.md file, you can add instructions for handling your design guidelines. You could again use AI to come up with an initial version using a similar prompt as before, or you can feed it your company's existing design/UI guidelines so it can create a specific design document for the project you are working on.

You can go as specific as you want with extra markdown files. I highly recommend adding more files rather than fewer, and keep splitting them based on how specific you can get. For example, if your design specification includes instructions for both a user-facing and an admin-facing part, you can split it and let your Agent decide which to use. 

Spec-driven development

Spec-driven development is the cornerstone of Agentic development right now. Don’t work without it.

Specification-driven development is writing in detail what you want the agent to make, and then letting it implement it autonomously. But rather than handing it a ticket from your ticketing system and letting it figure it out, it should include detailed specifications and do’s and don’ts. 

But, as with everything discussed so far, you should use Agents to write these specifications for you, and then manually (or with Agents again) adjust them until satisfied.

A prompt I frequently use to start writing specifications:

I want to write a spec file for a new feature.

The feature is to add a "remember me" feature to the app. Ask me critical questions and implementation question to narrow down the feature. 

This is what is written in the ticket: "Checkmark at login screen, store session in cookie, retain for max 30 days"

I just asked this in Codex, and here’s what it asked me.

Before we get into implementation, I’d like to clarify three things:

1. When someone selects “Remember me,” should they stay signed in after closing and reopening their browser, or should we only remember their email address?

2. Should the session expire 30 days after login, or should each visit restart the 30-day period?

3. When “Remember me” is unchecked, when should their session end?

I’ll use your answers to narrow down the remaining questions, then we can turn those decisions into a spec.

As you can see, you’re already getting questions that are important in specifications. And once you answer these questions, you can let it ask you more questions, or you can give it more details that you just thought of now. After the conversation is done, ask your agent to “write down all decisions made in a spec document in our repository”. Once that is done and written down, you can step into a new thread/spin up a different agent and say: “Here’s a spec document; implement it and verify the scope does not extend beyond the spec.”

Of course, spec documents can be written by your product owner, or anyone else in the chain. If you get handed a spec document, I highly recommend reading it and letting an AI verify it. Especially if their role is non-technical or if they’re not familiar with your codebase. You want the document to work technically and within the current code infrastructure; otherwise, a wrongly written spec might trigger unwanted rewrites. That said, well-written AGENTS.md and other documents should prevent unwanted rewrites. But LLMs sometimes ignore these, especially if you ask them to implement something that goes against them.

Keep changes scoped and contained.

The smaller the changes, the better. But of course, most features you want to implement won’t be small, but keeping them as small as possible will be a constant requirement for you when it comes to instructing agents. Luckily, with spec-driven development, you can even let your agents figure out how to implement things step by step.

In the spec-driven development section of this article, you learned how to write a spec file, but now it is time for implementation. Instead of putting your agents to work on the spec file, you should first consider whether the spec file doesn’t contain too much information or contains a too big feature. But instead of figuring this out yourself, why don’t you ask your agent?

Given this spec file, would you recommend implementing it in one go, or dividing it into several stages so each stage can be individually code-reviewed and tested, in a way that makes sense for both reviewers and workload? Do not cut the work up into arbitrary sections if it makes no logical sense to do so. Review the codebase and instructions to answer this question.

Generally, I would say, put a more capable Agent Model on this question. It will thoroughly check the spec, your source code, and all relevant instructions, and 90% of the time it will give an answer you’ll like and agree with. Of course, as the software developer, you should make the final call on whether the suggestion is a good one or if you want to define the split manually.

Use more agents

Besides instructions, having other agents check the work is a good call too. There are many agents out there with specializations you can tap into. It might be good to run a security check on your code, for example. Or have an agent check code quality/standards, test coverage, or common vulnerabilities.

But most importantly, you should let an agent, a different model than the one that wrote the code, code-review your pull request. This can be a first sweep on your PR before a human checks it, or it can be part of a group of agents that will collectively approve or deny a PR. I recommend manually reviewing a PR before merging, and having an agent (or more than one) check your PR is very wise and can reveal things a human might not. At the same time, an improperly instructed Agent will miss things a human wouldn’t. And knowing when an Agent has proper instructions is very hard, so play it safe; review yourself. 

Spot-check your code

The more you use Agentic development, the less you will be able to read every line of code. However, as any senior/lead developer should, you should periodically check your code. See if files aren’t growing too much; see if it’s not trying to abstract too much, going too deep with nested if/else statements. 

Agents, no matter how well instructed, sometimes get too enthusiastic with writing code. I’ve seen cases where there were 10 nested if-else statements, files that are 2000 lines long, and functions that cover the entire file. Most of these could’ve been solved with linting rules, but linting rules never cover everything and can still be ignored.

I even had an agent write a minimized JavaScript file once, which contained the entire application AND html/css. It was an absolute nightmare to read, but luckily my agent was very capable of un-minimizing it, especially because I had commit history and chat history to figure out what went into it.

Spot checking is really important the more you write code using agents. In fact, if your programming is almost exclusively agent-based, I recommend constantly reading your code. Not the PRs themselves, but the overall code. The reason I’d say not to read the PR is that it is an isolated change, and the existing bad coding behavior won’t be solved by commenting on that one PR. 

By staying on top of your code with this method, you will know for sure that the code structure and readability remain within your personal parameters. And this way, you’ll know that if you need to make a change manually, you can actually figure it out and do it. Because you should not rely on Agents being always available.

Conclusion

Whatever you do with Agentic development, keep a close eye on what your Agents are doing and properly instruct them. It’s easy to just give your agent a 1-liner and let it implement things, but that is where bugs can arise. Instead, having proper spec documents and the correct overall instructions prevent most bugs, and you get to development more quickly with fewer errors. Most likely even fewer errors than when handwriting code.

And slowly your job will shift from writing the code yourself to being a builder: writing actual, properly specified change requests with the technical know-how in the background. And finally, you’ll get the correctly specified tickets you’ve always wanted.

Start your engineering or tech career at Dataiku

See open positions

Ready for AI success?