Masterarbeit
Safe Execution of AI-Generated Code Using WebAssembly
Research Area
Web Engineering
Students
Advisers
Description
AI agents increasingly use on-the-fly generated code to perform complex tasks, such as the CodeAct pattern introduced by Microsoft. However, generated code may contain unintentional errors, consume excessive system resources, or be manipulated via prompt injection to perform unintended actions. Established isolation mechanisms such as virtual machines and containers offer strong boundaries but introduce considerable overhead and operational complexity. WebAssembly provides a lightweight, platform-independent sandbox with a capability-based security model, in which code cannot access files, the network, and other host resources by default and must be explicitly enabled. However, it is not yet well understood how these properties can be applied to sandbox these code-writing agents in practice.
The thesis aims to address this issue by exploring the potential of WebAssembly as a sandboxing mechanism for the safe execution of code generated by code-writing agents. To this end, an approach will be designed in which the capabilities available to generated code are explicitly controlled and restricted according to a policy, and the integration of such a sandbox into the execution loop of an agent will be investigated. A prototype of the approach will be implemented so that its feasibility and its effect on the flexibility and performance of code-writing agents can be examined.
The objective of this thesis is to create a solution or a combination of existing approaches to solve the problem of sandboxing code-writing agents through the use of WebAssembly as a sandboxing mechanism. To achieve this goal, a review of the state of the art of code-writing agents, permission policies, and sandbox mechanisms is to be conducted. Based on the findings, a prototypical implementation of the solution should be created, and a suitable evaluation of the prototype should be conducted.