CodeJail manages execution of untrusted code in secure sandboxes. It is designed primarily for Python execution, but can be used for other languages as well. The current version is 4.1.0, released May 2025. Release cadence is irregular, approximately 2-3 minor versions per year.
pip install edx-codejailVerified import paths — ran on the pinned version, not inferred.
Basic usage: configure a jail and execute untrusted code safely.
Update code to handle cases where execution is blocked, or explicitly configure the jail to allow unsafe operations if needed.
Ensure AppArmor is installed and the codejail profile is loaded. Run as root or use appropriate sudo.
Use jail.run() for more control or parse the returned dict.
Replace sys_packages with python_path in CodeJail constructor.