Code Provenance Analysis for AI-Generated Library Copies

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software developers face challenges in identifying and managing vulnerabilities and licensing incompatibilities when they copy or generate code from third-party libraries, especially in languages without package managers, leading to technical debt and legal risks.

Innovation Solution

A system using cryptographic hash functions and machine learning embeddings to segment and analyze code, comparing it to an index of third-party libraries to identify sources and vulnerabilities, and suggest fixes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If developers copy third-party code into their code bases manually or through a script, then productivity is improved, but the ability to identify and manage vulnerabilities and licensing issues deteriorates

Engineering Contradiction:
Improvecode development speedVSAvoidtracking of code sources and versions
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The system performs preliminary actions by automatically creating and maintaining an inventory of copied code sources, versions, and licensing information at the time of copying, rather than requiring developers to manually track this information later. This preliminary tracking enables subsequent vulnerability and licensing compliance checks without impacting development productivity.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If developers use AI to generate code, then productivity is improved, but the ability to identify original code sources and associated vulnerabilities deteriorates

Engineering Contradiction:
Improvecode generation speedVSAvoiddetection of AI-generated code sources
Core Design Contradiction:
ProductivityVSDifficulty of detecting and measuring

Solution Approach 1:

The system implements feedback mechanisms that continuously monitor and analyze code repositories for AI-generated content, automatically tracing it back to original sources in third-party libraries. This feedback loop enables the system to identify vulnerabilities and licensing issues in AI-generated code by comparing it against known code bases, maintaining security oversight despite increased productivity from AI code generation.

Inventive Principle:
Principle #23Feedback

3Ease of operation

If developers do not record the precise version of copied material, then ease of operation is improved, but the ability to generate Software Bill Of Materials deteriorates

Engineering Contradiction:
Improvesimplicity of code copyingVSAvoidversion information of copied code
Core Design Contradiction:
Ease of operationVSLoss of information

Solution Approach 1:

The system enables self-service functionality by automatically capturing and recording version information, source identifiers, and licensing details of copied code without requiring developer intervention. The system autonomously maintains this information in a structured format, enabling automatic generation of Software Bills of Materials and continuous compliance monitoring while keeping the development process simple and uninterrupted.

Inventive Principle:
Principle #25Self-service

4Productivity

If developers copy code without monitoring the source for vulnerabilities, then productivity is improved, but software security deteriorates

Engineering Contradiction:
Improvedevelopment efficiencyVSAvoidsoftware security
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary vulnerability assessments by automatically scanning copied code against known vulnerability databases and security criteria before the code is integrated into the application. This preliminary security check ensures that vulnerable code is identified and addressed before deployment, maintaining both productivity and security by automating the monitoring process without requiring manual security reviews.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12613978B2Software composition analysis (SCA) to identify AI-generated code that includes code copied from third-party libraries
Publication Date: 2026.04.28 ENDOR LABS INC
  • US12613978B2 patent drawing
  • US12613978B2 patent drawing
  • US12613978B2 patent drawing

AI summary

In some examples, a code file in a development system is selected and the selected code file is segmented, using a parser, to create multiple parsed blocks. A block of the multiple parsed blocks is selected and a cryptographic hash function used to create a block signature that uniquely identifies the selected block. The block signature is compared to multiple signatures of blocks in third-party libraries. The multiple signatures are stored in an index. When the block signature matches one of the multiple signatures of blocks in third-party libraries, the index is used to determine a source file from which the selected block was copied. Vulnerabilities included in the source file and fixes to address the vulnerabilities are identified to enable a software developer to apply the fixes to the identified vulnerabilities.