On Automated and Explainable Provenance of AI-Generated Code

  Alejandro Velasco, Nathan Wintersgill, Trevor Stalnaker, Oscar Chaparro. and Denys Poshyvanyk

  Proceedings of the 42nd IEEE International Conference on Software Maintenance and Evolution (ICSME'26)

Abstract: Generative AI for code generation has transformed software development, but it has also introduced a critical transparency problem: the origins of AI-generated code are opaque to the developers who use it, the organizations that deploy it, and the compliance professionals responsible for ensuring its legal and quality standards. Existing mitigations flag problematic outputs after the fact without explaining why a model produced them or how future generation could be improved. We present a research vision, grounded in a US NSF-recommended research grant, that argues that the next generation of CodeGenAI tools must be built on a foundation of explainable provenance: automated, post-hoc traceability that links generated code back to the prompt components, training data instances, global data features, and internal model components that caused its generation. We grounded this vision in empirical evidence from studies of software developers, model users, and compliance/legal professionals, which show that provenance information is a practical necessity that current tools do not provide. We characterize the problem across four traceability dimensions, outline a research program combining large-scale empirical studies with model-agnostic causal and interpretability techniques, and identify the key open challenges that the community must address to realize this vision.