AI coding agents – that is, tools that not only provide code suggestions but independently create and modify files and write them to version control – have arrived in many development teams. However, as these tools become more autonomous, the risk profile also shifts.

A recent report from the developer press describes exactly this point: when working with AI coding agents, credentials can end up in public repositories. According to the report, the cause is a convenience feature, i.e. a comfort option intended to speed up workflows.

No further technical details about the incident are available here. However, the basic pattern is already informative enough for project managers, because it does not concern a single product but rather the way automated tools are integrated into existing development processes.

Why convenience and security diverge here

Convenience features thrive on omitting intermediate steps. In software development, however, these very intermediate steps are often the points where people check what actually happens: Which files are included? Where is it published? Is the target repository private or public?

An agent that completes a task from code change to push in a single pass shortens these control points. Secrets – that is, credentials, API keys, tokens or passwords – are often stored in configuration files, environment variables or local helper files in development environments. If such artefacts are carried along without targeted selection, the path to a publicly visible repository is short.

In addition: a secret published by accident cannot be undone with another commit. Histories can be cloned, mirrored and automatically searched. In practice, this means that a key that has once become public must be considered compromised.

Guardrails in the AI-assisted development process

The sensible way to deal with this topic is not to banish AI tools from everyday development. It is to consciously set the limits of their ability to act. Several levels are suitable for this:

  • Limit permissions: Agents only receive access to the repositories and branches required for the task – and ideally no rights to write to public targets without an intermediate step.
  • Require confirmation for publications: Creating new repositories and switching from private to public should remain a human decision.
  • Separate the working environment: Production credentials do not belong in environments where agents can freely read and write. Separate, short-lived credentials are sufficient for development and testing purposes.
  • Maintain exclusion lists: Consistently exclude configuration and environment files from version control instead of relying on nobody touching them anyway.

Securing secret handling technically

Organisational rules alone are not enough, because under time pressure they are the first to give way. Technical safeguards are more reliable:

  1. Secret scanning in the pipeline and as a pre-commit check, i.e. an automatic search for typical key patterns before code is even published.
  2. Central secret management via a dedicated service, so that credentials are obtained at runtime and not stored in the project directory.
  3. Short validity and narrow scopes for tokens, so that a leaked key has as little reach and as little time as possible.
  4. Practised rotation, i.e. a documented and regularly tested process for quickly replacing credentials.

Reviews remain the decisive control point

Code reviews have long focused on technical quality. When agents generate larger volumes of changes, the focus shifts: it becomes more important to check what exactly is part of a changeset, not just whether the logic is correct.

In practice, it helps to keep changes small, pay particular attention to new files in review and mark automated contributions recognisably. A review that consists of a quick approval loses its protective value in agent-driven development.

When something has happened

For emergencies, a concise, prepared process is needed: immediately invalidate and reissue affected credentials, check logs for suspicious access, clean up the repository and document the incident. The order is important – revoke validity first, then clean up. Anyone who designs this process only during an incident loses time that is scarce when exploitation is automated.

Assessment for web and software projects

For web and software projects, this above all means one thing: AI agents change not only the speed of development but also the points at which errors arise and become visible. Anyone using such tools should consciously update permissions, secret management and review rules instead of carrying them over unchanged from manual working practices. A one-off review of access rights and secret handling costs little effort – significantly less than rotating all credentials under time pressure.

Sources