LLM Code Generation for Policy-Compliant Cloud Infrastructure

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing security policies for cloud infrastructure are primarily designed for human consumption and lack automated enforcement, leading to potential gaps and vulnerabilities, and manual updates are time-consuming and error-prone.

Innovation Solution

A system and method using a Large Language Model (LLM) to generate secure infrastructure code by integrating security policies as embeddings and schemas, ensuring compliance through an automated process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual processes are used to update security policies and code, then developers can maintain security policies, but the process is time-consuming and error-prone

Engineering Contradiction:
Improvesecurity policy accuracyVSAvoidtime to update policies and code
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system enables self-service through automated code generation. The code generator automatically produces infrastructure code that complies with security policies without requiring manual intervention from developers to write or update the code themselves.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system performs preliminary action by pre-defining security policies and using them to automatically generate compliant code before deployment. This ensures security requirements are built into the infrastructure code from the start rather than requiring post-hoc updates.

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If textual security policies are used for human consumption, then policies are readable, but they fail to provide automated enforcement and lead to gaps and vulnerabilities

Engineering Contradiction:
Improvepolicy readabilityVSAvoidautomated security enforcement
Core Design Contradiction:
Ease of operationVSExtent of automation

Solution Approach 1:

The code generator acts as an intermediary that translates human-readable security policies into machine-executable infrastructure code. This intermediary component enables automated enforcement by converting textual policies into actionable code that can be directly applied to cloud infrastructure.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system changes the parameter of security policies from purely textual format to a combination of textual policies and generated code. This transformation maintains readability while adding automated enforcement capability through the generated infrastructure code.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If developers manually update security policies and code to keep pace with software updates, then security compliance can be maintained, but the manual process is both time consuming and error prone

Engineering Contradiction:
Improveability to keep pace with updatesVSAvoidspeed of policy and code updates
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The system enables self-service through automated code generation. The code generator automatically produces infrastructure code that complies with security policies without requiring manual intervention from developers to write or update the code themselves.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system implements feedback by continuously monitoring security policies and automatically regenerating code when policies or infrastructure requirements change. This feedback loop ensures code remains compliant without manual intervention, enabling rapid adaptation to updates.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12602206B2Systems and methods for code generation
Publication Date: 2026.04.14 SAP SE
  • US12602206B2 patent drawing
  • US12602206B2 patent drawing
  • US12602206B2 patent drawing

AI summary

Embodiments of the present disclosure include techniques for generating code. Input code is received from a user. The code may not be conforming to a particular policy. The input code may be used to retrieve corresponding policies relevant for the code. In some embodiments, the input code may have a particular version, and a schema corresponding to the code version may be retrieved. The input code, policy, and schema may be input to a large language model to generate modified code conforming to the policy and the schema, for example.