In most organisations, production systems are well protected, while development systems hardly are. As long as experienced developers work there, that usually goes well. Now that AI coding agents run commands, change files and find credentials on those same systems on their own, it is no longer enough. For agents to work quickly without a single mistake becoming expensive, the development environment needs to meet five conditions.
📌 Development systems were never built for agents
Live systems are usually well protected against attacks from outside: firewalls, application firewalls and mechanisms that detect an intruder or limit the damage. Development systems have traditionally looked very different. The person working there knows their way around and above all wants to move fast. Root privileges, simple passwords, a database server without a password or mail delivery switched off with a configuration flag are not unusual. The same machine also holds emails, documents, other projects and often further credentials and API tokens. The justification is speed and trust in one's own people.
AI coding agents change this situation fundamentally. An agent is a bit like a very keen intern who is handed the master key to the whole building on day one: they work quickly, tirelessly and without breaks, and they can get in everywhere, to the shell, the file system, the network and the credentials. What happens behind a door they would have been better off leaving shut is beyond their judgement. They follow instructions. And they sit exactly where protection is weakest. Vendors build in their own safeguards, but nobody who is responsible for code, data and costs should rely on those alone.
📌 Five conditions at a glance
A development environment for agents therefore needs its own security architecture. It rests on five conditions that only work together: isolation, clean version control with a way back, handling of credentials, automated testing and cost control. If one is missing, the overall model has a gap through which a single agent error turns into real damage.

📌 Isolation: the agent does not run on the developer's machine
The first question is simply where the agent runs. Many let it work directly on their own machine because it is convenient. All security then depends on the vendor's safeguards, and there are enough documented cases where exactly that went wrong. A clear separation is better: a virtual machine used exclusively for development, for example under Hyper-V, VMware or VirtualBox, or a dedicated, hardened development instance in the cloud. A VM has an additional advantage: snapshots capture entire states that you can return to at any time.

What such an environment can look like in practice is shown by DevSysBot, a small open-source tool from OCENOX (github.com/ocenox/devsysbot). On a fresh system it runs a short interview, turns the answers into a blueprint as a Markdown document that a person reviews and adjusts, and only then lets an agent set up the environment. The human decides, the agent builds. The blueprint stacks five safety nets: file system snapshots every ten minutes, Git with a protected main branch, tests and CI, the agent's sandbox, and a firewall that blocks access to production networks, cloud metadata and mail servers. That also removes the argument that a secure environment is too much effort.

📌 Version control as the way back
Every development team knows the second condition; it is just often practised carelessly: commit frequently, work with branches, write clear commit messages or let the agent write them. With agents, further layers are added. File system snapshots catch changes that have not yet been committed, and scheduled backups protect the development database. It does happen that an agent, in its eagerness, deletes an entire database. Business-critical data is rarely stored there, but spending half a day recreating carefully built test cases costs money too.
Two rules matter most. The agent commits under its own name as co-author, so it stays traceable which code comes from people and which from the agent. And the main branch is protected. In GitLab and GitHub, that branch often holds the definition of the deployment pipeline. If an agent can write to it directly, it gains indirect access to production through the pipeline. Merge requests with a four-eyes review close this gap. The typical counter-example: the agent pushes straight to main, the pipeline is green, and nobody notices that the code is no good.
📌 Credentials do not belong within the agent's reach
Every development environment contains credentials for other systems: the database, the cloud, web services. Whoever holds such a token can, depending on its permissions, do a great deal. There are cases in which an agent found a very powerful token and decided to simply rebuild a faulty environment from scratch. It was the live environment.

A few clear principles follow from this. Credentials never sit in code or in files the agent can read, but in a central secret manager. They are injected only at runtime, are short-lived, are rotated regularly and have only the permissions actually needed. Just as important is that a token never gets into the model's context in the first place. Some providers use inputs for training, and a token that ends up there must be considered published. GitLab and GitHub offer their own mechanisms for protected and masked variables. They belong in everyday development.
📌 Tests as the only guard
When an agent works autonomously, the test suite is the only safeguard that reliably stops errors. Agents can take over a lot of manual testing work. But they have a limited understanding of what a test is for, and they readily write tests that check nothing. The classic test pyramid still applies: many unit tests, fewer integration tests, few end-to-end tests. Agents tend to write everything as an end-to-end test.
The biggest trap is green tests. Lots of tests, all green: that feels safe. If they check nothing, though, it is only the appearance of safety. Generated tests therefore need careful review too, supported by coverage tools and scanners that search code for tokens and security gaps. How much of this is needed depends on the stage of development, the size of the team and the required level of security. One simple, effective lever: the agent receives the task and the tests in the same step. Not "write code", but "write code that passes these tests".
💰 Keeping costs under control
Every agent call consumes tokens, and tokens cost money. A subscription usually has a cap. When billing runs through the API, light use is very cheap, but large agent systems in which agents direct other agents can quickly become very expensive. Discipline is what matters: keep the context small, use caching and choose the right model. For a large share of tasks, a smaller, cheaper model is enough.
For oversight there are observability tools such as Langfuse, Helicone or LangSmith, plus the providers' own consoles, which are often underrated. Splitting tokens finely by project or application area quickly shows where the costs arise. At governance level, limits, alerts or a subscription with a fixed budget help. One thing above all should be avoided: letting an agent run unattended overnight without a budget limit and switching off the safeguards so it can keep going. That can make for an unpleasant surprise the next morning.
❓ What this means for leadership
AI coding agents can be used productively without losing sight of security and costs. The prerequisite is not any special technology, but an environment in which isolation, ways back, protected credentials, meaningful tests and clear budgets are a given. For IT leaders this is a leadership task: whoever approves agents should know which systems they run on, what they can reach and who reviews their results. DevSysBot is available as open source on GitHub, and for a review of your own AI development set-up, OCENOX can be reached via ocenox.com.