Code sprawl: how ungoverned AI-built code piles up across the business

Cover image for Code sprawl: how ungoverned AI-built code piles up across the business

AI-built code is piling up faster than teams can track it. Scripts, flows, and internal tools now live across engineering repos, CRM, finance spreadsheets, and IT tooling, often with no clear owner or change history.

This is the "wild code" problem: ungoverned AI implementations spreading through shared API keys, unsanctioned data uploads, and shadow IT nobody signed off on. It's the kind of sprawl that shows up when AI adoption outpaces the governance capabilities meant to keep it in check. Bans don't fix this. Governance does. That means knowing where AI-built code runs, tracing every change to a responsible human, and keeping audit trails that prove controls worked.

This article examines why code sprawl is already present in most businesses, why policy documents and tool bans fall short, and what a durable governance approach actually requires. When that discipline is missing, teams inherit code they can't trace, outages they can't quickly diagnose, and audits they can't easily defend.

What code sprawl is, and why it's already inside your business

Code sprawl means the buildup of AI-generated or AI-assisted code at a rate faster than an organization can inventory, attribute, review, and maintain it.  Related problems include shadow AI, BYOAI, agent sprawl, and vibe coding.

Velocity and comprehension separate code sprawl from the shadow IT of a decade ago. AI makes producing working code easier, so review and governance capacity must cover more output, including output accepted by people who never read it.

A Cloud Security Alliance whitepaper reports that 91% of AI tools in enterprise environments operate outside IT control, with an average of 269 shadow AI apps per 1,000 employees. Builders are no longer only engineers. Marketing managers, operations leads, and finance teams now build working applications, connect them to production systems, and deploy them, often without involving IT or security.

An automation that depends on its builder's account can lose a working connection when that person leaves the company. That failure mode is preventable when teams migrate the flow before its credentials and context become orphaned.

Why bans and policy documents don't stop code sprawl

AI tool bans can drive usage underground rather than reduce the amount of AI-generated code. Samsung banned ChatGPT in April 2023 after engineers leaked proprietary semiconductor source code into the public tool.

By June 2026, Samsung had reversed course and deployed ChatGPT, Google Gemini, and Anthropic Claude to its DX Division employees globally after employee demand outran the ban.

A durable reversal requires governance infrastructure:

  • mandatory AI security compliance training

  • contractual data-use restrictions

  • real-time data loss prevention

  • role-based access control

These controls address the original concern, data leakage, without relying on prohibition. The pattern repeats even where enforcement power is strongest. Even in environments with strict oversight, prohibited AI tools tend to find their way back in as employees test them independently to keep pace with their work. Blanket restrictions can push usage into personal devices and off-network environments that are harder to monitor than sanctioned tools.

The more durable approach is to enforce controls at both the tool-access level and the code level. When access restrictions can't hold the line, controls have to move to where the code actually lives, onto a governed execution surface.

What does governing AI-built code actually require?

Governing AI-built code means knowing where it runs and tracing every change to its origin and a responsible human. It also requires retaining evidence that controls worked. In practice, that comes down to three capabilities: visibility into where code lives, traceability from each change to a person and a model, and audit trails that can be searched rather than reconstructed.

1. Visibility: an inventory of what AI has built

You can't govern code you can't see. The scale of ungoverned AI makes it difficult for technology and security leaders to confirm which internal tools are running in production or whether those tools have introduced risk . Detection has to happen in the codebase itself, not at the tool-access gate. Reviewers should check for risks such as outdated dependencies, ignored error handling, and leaked secrets.

Regulation is forcing the issue. EU AI Act obligations took effect in August 2026 with mandatory AI system inventories, a requirement most organizations with ungoverned shadow AI cannot currently meet.

Moving distributed automations onto a shared execution surface is one way to turn scattered scripts into a single inventory that can be searched, audited, and reported on when regulators or auditors ask.

2. Traceability: every change linked to a model and a human

Traceability starts at the commit layer. Teams can adopt attribution through trailers such as Co-Authored-By and Assisted-by, along with fields for model name, version, and inference date.

That metadata is only useful if a person stands behind it, though. A more durable organizational control is to require every AI-authored pull request to name a human sponsor who accepts responsibility for its review and correctness. For an audit, a named reviewer who can vouch for the metadata creates a clear accountability path.

3. Audit trails: proof that holds up under review

Audit-as-code practice formalizes the encoding of audit requirements as executable controls: logging decisions, enforcement events, human overrides, and any agent actions, with timestamps and sufficient context for later querying. That record turns an audit request into a search instead of a manual reconstruction project.

For a SOC 2 Type II audit, teams should retain evidence across the observation period rather than rely on a snapshot of current settings. A shadow script without a changelog cannot provide that history, no matter how well it runs. The same discipline applies to agentic automation, where allowed-tool lists, confidence thresholds, and logged AI runs should be built in from the start rather than added after an incident.

Whatever platform teams choose, the governance requirements it needs to support are consistent:

  • Audit trails that capture every workflow step, human decision, and AI action with enough context to reconstruct what happened and why.

  • Role-based access determines who can build, edit, approve, and run a workflow, rather than by whoever holds the credentials.

  • Change control that treats automation updates like any other production change, with review, approval, and a record of who signed off.

  • Separation between test and production credentials so that experimentation never touches live systems and production runs use scoped, service-level access.

These capabilities cost money to build, but not building them costs more.

How IT and security teams are governing AI-built code today

Teams inheriting growing volumes of agent-authored code need structural controls in addition to manual review. Governance works on two fronts: the code repository, and the scripts, flows, and one-off agents running across IT, security, and business teams.

At the repository layer, the practices are concrete. Governance guidance for AI coding assistants sets out explicit approval conditions, including enterprise deployment requirements, data training restrictions and privacy controls. Reviewers should assume AI-written code can contain bugs or vulnerabilities and check for common failure modes: outdated cryptography, outdated dependencies, ignored error handling, leaked secrets, and vulnerable packages.

The second front is harder because the code lives outside the repository. Ungoverned scripts and flows tend to depend on individual credentials, run on personal schedules, and skip the review gates that repo-based code goes through. Teams containing sprawl here take a few practical steps:

  • Inventory what's running: Ask each team to list the scripts, automations, and internal tools they rely on, who built them, and which systems they touch. An incomplete list is still better than none.

  • Assign an owner to every automation: If no one will accept ownership, that's a signal to retire the workflow or rebuild it under a service account with proper access controls.

  • Move workflows off personal credentials: Rebuild critical automations on a shared execution surface where approvals, logs, and access controls are part of the runtime, not bolted on afterward.

  • Require human approval for consequential steps: Access provisioning, data movement, and production changes should be routed through a named approver, whose decision is recorded alongside the automation's run history.

  • Log everything the workflow does, including any AI steps: Timestamps, inputs, outputs, and the guardrails in force at the time make an audit a search rather than a reconstruction.

The goal isn't to eliminate scripts. It's to make sure that every automation running in the business has a name, a record of what it did, and a review process that doesn't depend on the original builder still being around.

One product designed to address this gap is Tines 3B. Tines 3B runs AI-generated agents, apps, and automations inside a code-first environment with built-in credential protection and monitoring, so IT keeps visibility into what's running without blocking the builders producing it. Tines 3B addresses the |wild- code” side of the problem: the scripts and mini-apps AI tools produce every day that would otherwise land in personal accounts and unmanaged repos.

Getting ahead of the code you already have

AI-built code already runs parts of the business, and the volume climbs regardless of what any policy says. The organizations that handle it well can name an owner for any automation in production and retrieve its change history, including what it did last Tuesday. 

Whatever platform teams standardize on, the goal is the same: pull AI-built code that would otherwise accumulate under individual accounts onto a governed surface where logging, approvals, and ownership are part of the runtime. 

Tines 3B is one option, purpose-built for that job — a code-first environment for AI-generated agents, apps, and automations, with built-in credential protection and monitoring.

When the governed path is also the fastest path to build, teams stop routing around it, and the inventory problem shrinks rather than compounds. Architecture prevents sprawl more effectively than policy memos. Sign up today and test Tines 3B.

Frequently asked questions

What's the difference between code sprawl and shadow AI?

Shadow AI, per the Cloud Security Alliance, is any AI system, tool, agent, or integration operating in your environment without formal registration, risk assessment, policy governance, or security monitoring. Code sprawl is the accumulated output: the code and automations, sanctioned or not, piling up faster than your capacity to govern them. Shadow AI feeds code sprawl, but shutting down unsanctioned tools doesn't retire the code they already produced.

How can we tell which code was AI-generated?

Teams can adopt commit conventions such as Co-Authored-By and Assisted-by tags with model-level metadata. Pair attribution at commit time with code-level application security checks and a named human sponsor who accepts responsibility for each AI-authored change.

How does the EU AI Act affect governance of AI-generated code?

EU AI Act obligations took effect in August 2026 and include mandatory AI system inventories. For organizations shipping AI-generated code into production, that means being able to identify every AI system in use, document its purpose and risk classification, and evidence controls across its lifecycle. Ungoverned shadow AI is the most common gap: teams cannot inventory what they cannot see. A governed execution surface, paired with commit-level attribution, closes the visibility gap the regulation now requires teams to demonstrate.

What's more effective: banning AI coding tools or governing them at the code level?

Bans push prohibited usage to personal accounts or off-network environments that are harder to monitor than sanctioned tools. Enforcement at the code level is more durable: review gates on every AI-authored pull request, secret scanning as a merge gate, a named human sponsor for each change, and logged execution regardless of which tool wrote the code.

What are auditors asking about AI-generated code?

For AI-generated code, teams should be prepared to demonstrate provenance and security testing prior to production, as well as observation-period control evidence. For SOC 2 Type II readiness, retaining logs and approval records across the observation period, together with monitoring evidence, provides the record that an ungoverned script never produces.

Sign up today to get started or schedule time with our team to learn more.