When Code Works but the License Doesn't: Evaluating License Constraint Handling in Coding Agents
Abstract
Coding agents increasingly perform repository-level software development tasks, including selecting dependencies, reusing and modifying source code, debugging implementations, and preparing software for deployment and distribution. These capabilities place autonomous agents directly within software supply-chain and licensing decisions that have traditionally been managed by developers, legal teams, procurement, and compliance processes. Existing evaluations of coding agents, however, primarily measure functional task completion and do not establish whether the resulting software is appropriate for its intended commercial use. We investigate whether coding agents can recognize, interpret, and preserve software-license constraints when constructing proprietary software intended for commercial use. We conduct controlled experiments across multiple coding agents and a diverse set of licensing and development conditions, including permissive and copyleft licenses, missing or contradictory licensing information, transitive dependencies, source reuse and modification, vendoring, dual licensing, source-available restrictions, deployment boundaries, and customer-distributed artifacts. We additionally introduce no-reference variants to examine whether agents autonomously discover licensing constraints when potentially problematic components are not explicitly identified. Agent traces, repository changes, dependency and source provenance, and final artifacts are evaluated against licensing ground truth using measures of functional success, license detection, commercial-use decision accuracy, incorporation-mode accuracy, provenance awareness, constraint preservation, final compliance, and escalation. Our results indicate a persistent distinction between functional correctness and licensing correctness. Agents can successfully construct and test software while failing to establish licensing correctness, particularly when constraints involve transitive provenance, source modification, authorization, or changes in deployment and distribution context. Stronger behavior occurs when agents translate licensing information into concrete engineering actions, including dependency substitution, architectural changes, preservation of licensing information, or release gating. These findings suggest that software licensing in agentic development should be evaluated not as a license-classification problem, but as a contextual constraint-recognition and preservation problem across the software lifecycle.