Opinion

AI Agents Expose the Cost of Technical Debt

The PHP2Shell case shows how AI can surface vulnerabilities faster than organizations can patch them. Closing the gap depends on better SBOMs, tests, deployment records, and release processes.

Font size

AI Agents are bringing years of hidden code and security debt into view. PHP2Shell illustrates the point: AI can accelerate discovery, but it cannot fill in an organization's missing inventory, tests, or deployment data.

An IEEE Spectrum article examining PHP2Shell and the impact of AI on cybersecurity reached the Hacker News front page, earning 468 points and 323 comments.

The HN figures come from the article's discussion page: news.ycombinator.com/item?id=50364336. The original article is available at spectrum.ieee.org.

These numbers are interesting for more than the amount of controversy. The discussion quickly moved beyond “How do we fix this vulnerability?” to a broader question: When AI can read code at scale, trace call relationships, and explain attack paths, could decades of technical debt accumulated through product iterations suddenly become a bill that must be paid?

468 Points on the Front Page, and More Than a Vulnerability to Debate

Published by IEEE Spectrum, the article uses the PHP2Shell vulnerability to examine AI's impact on software security. After reaching the Hacker News front page, it received 468 points and 323 comments.

Some participants focused on how PHP runtimes, frameworks, and deployment configurations can combine to expand the attack surface. Others questioned the reliability of AI-generated vulnerability reports. Still others pointed out that automated scanning can expose problems faster, but it cannot automatically complete the repairs.

By then, the central issue was no longer PHP2Shell alone. Existing analysis summarized the article's main conclusion this way: AI-assisted audits and vulnerability discovery are forcing organizations to confront long-standing debt in their code, architecture, and security processes.

That explains why one specific vulnerability generated so many comments.

Today's code reflects years of changing requirements. The architecture contains compromises left behind by reorganizations. Security processes may still date from an era without continuous integration, dependency tracking, or even code review. Modern companies may look like new systems while still running generations of old ones.

AI does not create this legacy debt from nothing. It simply makes it harder to continue hiding behind “we'll refactor it next time.”

AI Is an Audit Multiplier, Not a Replacement

The most immediate value of AI-assisted vulnerability analysis is shorter initial triage.

Maintainers can use an LLM to explain unfamiliar modules, reconstruct the call path from an HTTP request to a dangerous function, or identify unusual patterns across large volumes of logs, configuration files, and dependency manifests. For engineers taking over an aging project, that is a practical advantage. Instead of spending weeks understanding the code, a team can first ask a model to map potential attack paths and then have engineers verify them.

But “found” does not mean “fixed.”

A useful vulnerability report needs to establish facts at four levels:

  1. Code: How the dangerous function is called and whether its input is controllable.
  2. Dependencies: How the affected version entered the system and through which dependencies.
  3. Architecture: Whether requests can reach the vulnerable code and whether gateways, WAFs, or process isolation intervene.
  4. Response: How to determine the blast radius, distribute patches, notify customers, and verify the fix.

An LLM can make the first two layers sound authoritative while assuming that the organization has handled the other two correctly.

A report might say that a particular version is vulnerable. In reality, the deployment may be pinned to an old extension, a reverse proxy may filter malicious requests, and only a subset of instances may expose an administrative interface. Without a deployment inventory and runtime evidence, those conclusions remain assumptions.

AI Agents are therefore well suited to serve as audit copilots, not incident commanders. They can widen the scope of review and generate test code, but they cannot establish what is actually running in production.

Technical debt can be divided into the same four categories: code debt, dependency debt, architecture debt, and response-process debt. AI scanners are best at finding the first two. The other two still depend on people, access controls, and reliable data.

The Most Expensive Part Is Not the Patch

The first cost after a vulnerability disclosure is usually determining the blast radius.

Organizations need to inventory historical versions, dependency chains, and deployment environments:

  • Which services are still running the vulnerable version of PHP?
  • Was the affected dependency included directly or introduced indirectly through a framework or plugin?
  • Can older versions still be reached from the public internet?
  • Are container images, virtual machines, and managed copies consistent with one another?
  • Can customers upgrade on their own, or will the vendor need to provide a temporary mitigation?

This costs far more than changing a line of code.

The article offers one hypothetical estimate: A team with only 10 PHP maintainers might need half a day to make the code change. The real time would go into reconciling 20 services, 80 container images, and hundreds of deployment records to determine which instances should be rolled back, upgraded, or taken offline. This is a hypothetical scenario from the article, not actual deployment data for PHP2Shell.

A single-point CVE report provides a coordinate for a vulnerability, but repairing it may require rebuilding the asset inventory. The gap between that coordinate and a full set of construction plans is the price of technical debt.

Dependency issues can multiply that cost. A low-risk dependency may enter multiple projects through a Composer lock file. Updating a direct dependency is not difficult; determining whether its transitive dependencies introduce compatibility problems, then adding regression tests, is the hard part.

Without an SBOM, artifact tracking, and a version inventory, AI can help generate query scripts, but it cannot recover missing historical data on demand.

This is what makes the assumption that “finding a problem fixes it” especially dangerous. A tool produces a polished vulnerability list, maintainers dismiss several alerts, and the organization declares that its risk has fallen. Production systems, however, are no safer.

From Deferral to Refactoring

Historically, organizations often dealt with security debt through deferral: add a WAF first, keep the upgrade on the schedule, update dependencies in the next iteration, and reserve a quarter for refactoring the core module. Each step looks reasonable in isolation. Together, they created the kind of challenge seen in PHP2Shell.

That changes when AI Agents enter CI/CD.

If an Agent can inspect new dependencies in a pull request, generate regression tests, and explain permission changes, the repository must already have a clear structure: runnable tests, a machine-readable dependency manifest, explicit release boundaries, rollback-capable artifacts, and permissions that do not silently override one another.

Those are precisely the elements many aging projects lack.

A model can write tests, but those tests need stable interfaces. An Agent can inspect dependencies, but it first needs to know which lock file production uses. An Agent can propose a deployment plan, but production access should not be handed directly to an automated process that may guess incorrectly.

Refactoring therefore means more than writing more modern code. It also includes:

  1. Moving production configuration out of chat logs and wikis and into version control.
  2. Creating dependency and container-image inventories for each service.
  3. Encoding releases, approvals, and rollbacks as machine-executable workflows.
  4. Giving Agents least-privilege access and preventing them from changing firewalls or production secrets directly.
  5. Ensuring every fix has a repeatable verification command.

Teams once maintained order through process documentation. Once Agents are involved, those processes must become executable. Otherwise, a model can only offer generic advice in a repository that lacks context.

In the short term, AI makes security debt easier to expose. Over the longer term, it pressures organizations to rebuild how software is maintained: stronger tests, smaller permission surfaces, shorter release paths, and traceable decision records.

Editorial Perspective

AI's most important effect on software security is not that it creates more vulnerabilities. It lowers the cost of discovering and explaining old debt. An ignored dependency might previously have remained invisible until a scanner improved, a manual audit uncovered it, or a real attack occurred. Now, LLMs and AI Agents can identify suspicious call chains and affected versions first.

I expect the next competitive advantage to shift from “Who has the stronger model?” toward “Who has the more maintainable software and organizational processes?” Model capabilities will converge, but whether dependencies are pinned, production is traceable, tests are reproducible, and permissions are minimized depends on years of accumulated work. Switching APIs cannot close that gap.

This time is different because organizations can no longer treat a CVE as an isolated patch. AI puts code, architecture, and response processes in front of maintainers at the same time, pushing security away from end-of-version patch management and toward continuous engineering.

Actual remediation capability, however, remains constrained by code quality and historical data. Without an SBOM, tests, or deployment records, an Agent can accelerate the questions an organization asks but cannot prove that its production environment is secure.

Sources

Source: https://spectrum.ieee.org/ai-in-cybersecurity-php2shell-vulnerability