The rapid adoption of AI coding agents has changed one of the basic constraints of software engineering. Code generation is no longer necessarily the slowest part of building a system.

A capable agent can inspect a repository, create modules, modify multiple files, execute commands, produce tests, repair errors and continue iterating with relatively little direct typing from the developer. A system that once might have required months of implementation can accumulate tens of thousands of lines in a remarkably short period.

That creates an unusual engineering problem.

The source code may be completely visible. The application may run. The interface may look finished. Automated tests may be green. Yet the organization responsible for the software may still have only a weak understanding of how the system actually behaves.

This is the visible-code black box.

The code is not hidden. The problem is that generation has moved faster than comprehension, verification and ownership.

A repository containing 100,000 lines produced with Claude Code is therefore not dangerous because of the number 100,000. Line count is a crude metric. The real question is whether the organization has acquired enough verified control over those lines to safely place them into production.

That distinction should determine how AI-generated systems are audited.

The First Response Should Not Be More Generation

When a team discovers that a large AI-assisted codebase has grown faster than anyone can confidently explain it, the wrong response is to continue expanding it.

Net-new feature development should temporarily stop.

This does not mean abandoning AI-assisted engineering. It means shifting the engineering objective from implementation to assurance.

The immediate task is to determine what exists, whether it can be reproduced, which parts matter most, who understands them and what evidence supports the belief that the system behaves correctly.

The first practical step is to create an immutable audit baseline.

The exact repository revision should be tagged. Build artifacts and relevant configuration should be preserved. Model versions, agent configuration, tooling versions and other available environmental information should be recorded where possible.

Without a fixed baseline, the audit risks examining a moving target. Findings discovered on Monday may no longer apply to code regenerated on Wednesday. A defined revision turns the system into something that can actually be investigated.

The repository must then be inventoried.

A statement such as “the application contains 100,000 lines of code” tells very little about engineering complexity. Those lines may include production logic, generated clients, database migrations, snapshots, fixtures, tests, vendored libraries, configuration, duplicated modules or dead code.

Those categories should be separated.

GitHub Linguist, for example, explicitly distinguishes generated and vendored material because raw repository size is not equivalent to meaningful application logic. The same principle should apply to an AI-code audit.

The objective is not simply to count files. It is to understand what kind of software has actually been produced.

A clean-room build should follow immediately.

A fresh machine or ephemeral environment should be capable of installing dependencies, building the application and starting the system using documented inputs. If the software only works because of an undocumented package, local environment variable, workstation configuration or forgotten manual step, that dependency is part of the system whether the repository acknowledges it or not.

Hidden workstation knowledge is itself an audit finding.

The team should also stop treating automatically generated tests as automatic evidence of correctness.

Those tests should be preserved. They may be extremely useful. But until their assertions, coverage and independence have been examined, they remain claims about the software rather than proof about the software.

The same agent that generated an incorrect implementation can generate a test that accepts the same incorrect assumption.

Test volume and test independence are not the same thing.

Reconstructing Human Ownership

Once the repository has been stabilized, provisional ownership should be assigned.

Every production-critical subsystem needs a named human or team responsible for reconstructing and explaining its behavior.

“The agent created it” is not ownership.

“The agent can explain it” is not ownership either.

An AI model can be an extraordinary analytical tool, but organizational responsibility cannot be delegated to a transient model session. Someone must know what the component does, why it exists, what depends on it and what could happen if it changes.

This requirement becomes especially important around the crown jewels of the application.

Authentication, authorization, payments, personal information, privilege changes, destructive operations, external integrations and other high-impact flows deserve priority because failures there can produce consequences far larger than their code size suggests.

A five-hundred-line authorization layer may deserve more scrutiny than a twenty-thousand-line presentation layer.

The audit should therefore be architecture-first rather than file-first.

Reading an enormous repository sequentially is rarely the most effective way to understand it. The team should instead reconstruct the system from the top down.

What are the major components?

Where are the trust boundaries?

Which systems communicate with which databases?

What external services are called?

Where does identity enter the system?

Where is authorization enforced?

Which operations modify persistent state?

Which paths are asynchronous?

What happens when part of a workflow fails?

Context and component diagrams should be created and then validated against the implementation rather than accepted as assumptions.

Several critical user flows should be traced from beginning to end: external request, validation, authentication, authorization, business logic, database interaction, side effects and response.

This is where an apparently understandable application frequently reveals hidden complexity.

A request that looks simple at the interface may cross several services, enqueue a job, modify state asynchronously, call an external provider and trigger another process later. None of that complexity is inherently wrong. But production approval requires that the complexity be known.

Structured threat-modeling techniques, including system and data-flow decomposition recommended by OWASP, are useful here because they force the team to identify boundaries and assumptions that ordinary code review may miss.

The Code Cannot Define Its Own Requirements

One of the most important principles in auditing AI-generated software is that the implementation cannot be allowed to become the source of truth for the behavior it is supposed to implement.

If the auditor asks, “What should this function do?” and answers the question by reading the function, verification has collapsed into description.

Critical calculations, authorization rules, state transitions and business constraints should be compared with an independent specification, business rule, protocol requirement or other external source of truth.

The distinction matters because generated systems can be internally coherent while still being wrong.

An agent may implement a mistaken interpretation consistently across the application. It may then generate tests that encode the same interpretation. The implementation and the test suite will agree perfectly.

They can still both be wrong.

For this reason, high-value behavior needs independent oracles.

The organization should know not merely that the system produces output, but why that output is considered correct.

Tests Must Be Challenged, Not Admired

Large AI-generated test suites can create a particularly convincing illusion of assurance.

Thousands of tests, high coverage and a wall of green indicators look reassuring. But the correct question is not how many tests exist.

The correct question is what those tests are capable of detecting.

The suite should therefore undergo adversarial evaluation.

Controlled mutations should be introduced into important logic to determine whether the tests detect them. Invalid and hostile inputs should be supplied. Authorization should be tested across ownership and tenant boundaries. Duplicate requests, partial failures, retry behavior, migration failures and restoration procedures should all be exercised where relevant.

Expected behavior for important paths should be independently derived rather than copied from the implementation.

Research into error propagation and generated-test behavior provides a concrete reason for this caution: tests created from erroneous implementations can inherit those errors rather than expose them.

A passing test suite is valuable only when there is evidence that meaningful faults cause it to fail.

That sounds obvious in traditional engineering. In AI-assisted development it becomes critical because both implementation and verification artifacts may originate from the same generative process.

Generation is not independence.

Security Requires Concrete Verification

Security review should also move away from vague statements.

“Security best practices were followed” is not a production criterion.

The team should examine authentication, authorization, input validation, injection risk, secret handling, dependency provenance, database operations and privileged or destructive functionality using an explicit verification framework.

OWASP ASVS provides one such baseline.

The objective is not necessarily to satisfy every requirement at the highest possible level. The appropriate subset depends on the application and risk profile.

What matters is that the organization knows which security properties it expects, how those properties were checked and which residual risks it has consciously accepted.

Automated static analysis, dependency scanning, duplication detection and dead-code tools should be used aggressively, but their role must also be understood correctly.

They are maps, not verdicts.

A low warning count does not demonstrate correctness.

A high warning count, however, may show the team where investigation should begin.

The Modification Test

One of the strongest tests of actual ownership is surprisingly simple.

Ask the developer or designated component owner to modify an important part of the system.

But before allowing Claude Code or another agent to perform the change, require the human owner to predict what the change should affect.

Which components should move?

Which tests should fail?

Which database objects may be involved?

Which API contract could change?

Which downstream systems might be affected?

What failure modes should be considered?

Only after those predictions are recorded should the agent perform the modification.

The result can then be compared with the owner's expectations.

This exercise reveals something that documentation and verbal confidence often cannot.

It shows whether the person responsible for the subsystem possesses a working mental model of it.

Ownership becomes observable.

A developer does not need to remember every line. That would be an obsolete standard even in conventional software engineering.

But the owner must understand enough of the architecture and behavior to predict consequences.

The Production Gate

Production approval for a rapidly generated system should therefore depend on evidence rather than appearance.

The repository must be classified well enough that unexplained bulk is either removed or documented.

The application must build from clean, documented and pinned inputs.

The audited revision must be deployable without undocumented workstation knowledge.

Architecture maps must correspond to the actual implementation.

Critical flows must be traceable by named humans from external request to persistent effect.

Important requirements must be checked against an independent source of truth rather than inferred from generated code.

Critical tests must contain meaningful negative cases and independent expectations, with evidence that they detect real faults.

Authentication and session behavior must be explicitly verified.

Authorization must be tested at the server side across roles, resources, ownership boundaries and tenants where applicable.

Input and output trust boundaries must be understood.

The dependency graph must be known, and relevant vulnerability and supply-chain checks must be performed.

Database schemas, migrations, transactional behavior, backup processes and restoration procedures must be understood well enough for the intended operational risk.

Destructive or high-impact operations require explicit safeguards, authorization and recovery strategies.

Security requirements should be evaluated using an appropriate verification baseline and threat model.

Significant duplication, dead code and unnecessary complexity should either be removed or intentionally documented.

Logs, monitoring, rollback and failure-diagnosis mechanisms must be sufficient for the environment in which the application will operate.

The controlled modification test should demonstrate that the responsible owner can predict impact and safely supervise change.

And every critical component must have a clearly identified accountable person or team.

Passing these gates does not prove that the software contains no defects.

No realistic engineering process can make that promise.

What the gate provides is something more operationally useful: evidence that the organization has gained enough control over the system to detect problems, reason about changes and take responsibility for its behavior.

The Wrong Metric

The 100,000-line Claude Code scenario is therefore not fundamentally a story about excessive line count.

It is a story about unearned trust.

A repository can contain 100,000 lines and still be well engineered.

Perhaps large portions were generated from controlled schemas. Perhaps the architecture is coherent. Perhaps critical flows are documented and independently verified. Perhaps security boundaries have been tested. Perhaps the test suite contains strong independent oracles. Perhaps experienced engineers can explain, operate and safely modify every critical subsystem.

In that case, 100,000 lines are simply 100,000 lines.

The opposite is also true.

A 10,000-line repository may be a far more dangerous black box if nobody knows which authorization path is canonical, which migration can destroy data or which component actually owns an important state transition.

The meaningful variable is therefore not:

How much code did the AI write?

The meaningful question is:

How much verified human control exists over the resulting system?

That is the measurement that matters.

Generation Is Not Verification

Current research provides several reasons to take this distinction seriously.

AI assistance can increase implementation output while reducing measured developer understanding in some contexts. Autonomous coding agents can increase software throughput while maintainability indicators deteriorate in certain repositories. Models can introduce incorrect dependencies and invalid API usage. Tests generated from mistaken implementations can reproduce their mistakes instead of detecting them. Automated evaluation can reward behavior that satisfies visible checks without satisfying the underlying intention. Perceived productivity can also diverge from objectively measured productivity.

None of those findings proves that Claude Code, or AI-generated code in general, is intrinsically unreliable.

That would be the wrong conclusion.

They demonstrate something narrower and more important:

Generation is not verification.

Claude Code is capable of inspecting repositories, executing commands and performing substantial multi-step modifications. Those capabilities dramatically increase implementation bandwidth.

But the faster implementation becomes, the less reasonable it is to assume that traditional human review will automatically scale with it.

Engineering organizations therefore need assurance mechanisms whose capacity is not tied directly to the speed at which code can be generated.

That is the structural challenge created by agentic software development.

Human Ownership After AI

The durable engineering model is not one in which humans compete with AI by manually typing more code.

AI may generate code.

AI may analyze repositories.

AI may propose tests.

AI may search for vulnerabilities.

AI may explain unfamiliar modules.

AI may participate in review.

AI may help repair defects.

All of those capabilities are useful.

But an organization must still establish independent evidence for the properties on which it is willing to place production consequences.

Human ownership should no longer be defined as “a person personally typed this code.”

That definition was already weak, and AI makes it obsolete.

A better definition is stricter.

A human owner understands enough of the system to question it, verify it, change it safely, recognize when the agent is wrong and accept responsibility for what happens after deployment.

This changes the meaning of engineering ownership.

The valuable engineer in an AI-assisted environment is not necessarily the person who remembers the most syntax or produces the largest number of lines manually.

The valuable engineer is the person who can maintain a reliable model of the system while generation accelerates around them.

They know what must be true.

They know how to test whether it is true.

They know which parts of the system deserve skepticism.

They can predict the consequences of change.

And when the agent produces a plausible but incorrect answer, they have enough understanding to notice.

That is the control layer AI cannot simply be assumed to provide for itself.

Conclusion

The central risk of AI-generated software is not that the code is invisible.

It is that the code can become visible faster than it becomes understood.

That is why a polished interface, a large repository, thousands of generated tests and a successful demo are not sufficient evidence of production readiness.

They demonstrate implementation.

Production requires control.

The distinction will become increasingly important as coding agents improve. The more capable these systems become at building software autonomously, the less meaningful raw code production will be as a measure of engineering progress.

The scarce resource moves elsewhere.

It moves toward architecture, independent verification, threat modeling, system understanding, operational readiness and accountable ownership.

A future software organization may generate dramatically more code than teams of the past while asking its engineers to manually type dramatically less.

That does not eliminate engineering responsibility.

It concentrates it.

The final production question is therefore not whether humans wrote the system.

It is whether humans control it.

Until that condition exists, the repository may be readable, the interface may be impressive and every automated test may be green.

But in the engineering sense that matters, the system remains a black box.