arXiv:2608.23842cs.SEAug 2026

Manuscript Offprint

arXiv:2608.23842

Automated Synthesis of Cloud Emulators

Archit Bhatnagar, Zhenning Yang, Sarah McClure, Yiming Qiu, Sylvia Ratnasamy, Ang Chen

Abstract

DevOps programming (e.g., using CLI/API scripts or IaC frameworks) is key to cloud infrastructure management. Unlike traditional programming tasks, DevOps program testing needs provisioning and execution against actual cloud resources, which is often time-consuming, unsafe, and costly. Cloud emulators have gained popularity for easing DevOps program testing; they are generally API-level mocks that can execute DevOps programs in a local environment. Still, building these emulators remains challenging: developers must manually interpret extensive cloud documentation and handcraft logic for each service, API, and their interaction. This does not scale to the complexity of the cloud, which is further a moving target as the services and APIs evolve. CLOUDEMU is an automated approach that constructs emulators based on cloud documentation via neurosymbolic code synthesis. The key idea is to combine LLMs' general strengths in documentation understanding and code generation with cloud-specific symbolic abstractions that suppress hallucinations and enforce precision at scale, while using the real cloud as an oracle for automated testing, repair, and alignment. Our evaluation shows the effectiveness of CLOUDEMU on major cloud provider (AWS and GCP) services in both coverage and accuracy. CLOUDEMU outperforms the existing leading tool LocalStack, which was manually developed by a large team of engineers over a decade.

1 Introduction

Building and maintaining cloud infrastructure (e.g., virtual machines, gateways) is an essential task. DevOps engineers perform these tasks programmatically—e.g., using CLI commands or Python scripts that directly invoke cloud-level APIs [5, 11] exposed by the provider, or using Infrastructure-as-Code (IaC) frameworks [3, 8, 9] (e.g., Terraform) that compile infrastructure configurations to API calls. However, testing against the cloud is expensive [13], and resource provisioning can be time-consuming. Prices and provisioning time can further increase for resources in high demand [56]. This complicates DevOps programming and reduces velocity.

To enable no-risk, no-cost, and high-velocity cloud development, cloud emulators [6, 7, 10] are quickly gaining traction. Emulators mimic the cloud by exposing identical API interfaces to DevOps programs and simulating their execution in a mock environment, providing a lightweight backend without going through the real cloud. In order to emulate a resource (e.g., VM), emulator developers sift through cloud documentation, identify target APIs, and handcraft the mockup logic based on their understanding of the expected behavior. Interdependent resources (e.g., VM is associated with Subnet and VPC) further need to be emulated in relation to each other.

While this is a laudable effort, existing practices of emulator development cannot catch up to the complexity and dynamicity of the cloud ecosystem. For instance, AWS alone provides 240 services [1], and a service can expose up to 200 APIs; Azure and GCP exhibit a similar level of complexity. Market competition means that providers often add new services and upgrade existing ones, making the cloud a moving target [12]. Each cloud provider also features a different set of services and APIs, and more players are entering the cloud market. To ensure reliability at scale, tenants often construct multi-cloud deployments, which further propagates the need for DevOps testing across cloud providers. Hence, manual emulator development is a tedious process that needs to be repeated for each provider and turns out to be increasingly difficult. The stark reality is that even the most advanced emulator [6] today only covers 95 out of over 240 AWS services, and only with partial API coverage for these services; and no mature multi-cloud emulators exist to our knowledge.

In this paper, we propose a new approach to building cloud emulators. We automatically synthesize emulation logic from cloud documentation, and then align the generated emulator with the live cloud to close any remaining gaps. We observe that publicly available cloud documentation provides a treasure trove of information. No matter how complex a cloud's services may be, their usage and behavior is often described in painstaking detail by the cloud provider. This is fundamental to the cloud's business model, as providers need to sufficiently describe their interfaces to the tenants. The incentives are strong for providers to comprehensively document their services and keep the information up to date. While poring over these pages is difficult for human developers, Large Language Models (LLMs) have the potential to digest this information and generate emulation code for the described behavior automatically. If successful, this new kind of emulators will not only achieve higher service coverage, but can also easily adapt to service changes, and generalize across providers without multiplying the engineering effort. This version is an extension of our preliminary attempt at the problem [17].

We design three steps to mimic the workflow of a (human) emulator developer: digesting swaths of information from documentation, coding emulation logic for each resource and its interactions, and testing the emulator against the actual cloud to find and close any gaps. While LLMs can help with each step, they can also hallucinate and introduce arbitrary errors. Our key observation is that cloud services follow a highly structured style where each resource can be modeled as a state machine (SM). transitions are triggered by API invocations and may further affect the states and transitions of other resources. CLOUDEMU exploits this structure throughout all steps to impose precise constraints and provide high assurance—a neurosymbolic workflow that “compiles” text-based documentation to working code, further tested and refined against the actual cloud as the oracle.

We call the first step documentation wrangling, where the key challenge stems from the sheer volume of cloud documentation. While LLMs can read/parse voraciously, they can also forget key information after thousands of pages. Retrieval-augmented generation [29, 34] uses a vector database to help LLMs locate relevant parts of the documentation selectively, but its indexing mechanism is imprecise in nature, using semantic match in the embedding space (e.g., top-k based on the prompt); further, understanding the whole document is particularly important, as cloud documentation exhibits dense cross-references (e.g., VM definitions refer to NIC attachments, documented far apart). CLOUDEMU develops a resource index, that leverages the service and API boundaries, threading through the documentation based on the structure of cloud services for easier LLM consumption.

The previous step indexes and compiles text documentation into a structured representation; and the next code generation step further compiles any remaining textual descriptions into fully symbolic code. We insist that the LLM generates code following the index structure, translating text to code to fill in “holes” in a preprogrammed template that models a hierarchy of state machines (SM). Cloud services are complex but modular, allowing the overall task to be decomposed. This template preprograms key components symbolically.

Resources are modeled as state machines (SM), and their hierarchical and dependency relationships constrain how resource states can evolve under API operations. For example, deleting a parent resource may require first reclaiming its children, while creation and update operations must preserve consistency across dependent resources. As a result, the LLM only needs to infer, for each API, the corresponding behavior from a small fragment of API description extracted from the large cloud documentation, within this constrained scaffold.

The final step is program alignment which addresses potential gaps that arise from textual ambiguity or under-documentation, testing, and then aligning the behavior of the synthesized emulator to that of the actual cloud. It leverages the structure of the template to perform targeted testing, producing high-coverage traces to exercise different program paths. Alignment means that permissible behaviors should produce the same effects in the emulator and the cloud, and forbidden behaviors should fail in both; ideally, failures should also result in identical error codes and error messages to assist with DevOps debugging. By testing the effect of these traces in both environments, we can detect divergence, track down the source of errors, e.g., to a specific SM implementation, a specific interaction, or even back to the cloud documentation, and perform LLM-assisted program repair.

These technical designs also contribute key takeaways for building software systems with the assistance of AI. (1) LLMs are most effective when used selectively to infer semantics where needed, rather than end-to-end system generation. (2) Structured constraints enable generation at scale: symbolic scaffolds that capture architecture and interfaces allow large systems to be synthesized reliably from smaller, composable pieces. (3) LLMs can produce plausible but incorrect outputs, and grounding the resulting systems on external oracles and feedback loops can help with continuous validation and alignment. Our extensive evaluation shows the effectiveness of CLOUDEMU and validates its high coverage and accuracy over leading, manually-built emulators like LocalStack.

References (26)