Run code

Run arbitrary Python or Bash code safely in a gVisor sandbox.

v0.8.0
run_code.py
Python · 2,820 lines
66    class Valves(pydantic.BaseModel):67        _VALVE_OVERRIDE_ENVIRONMENT_VARIABLE_NAME_PREFIX = "CODE_EVAL_VALVE_OVERRIDE_"68        NETWORKING_ALLOWED: bool = pydantic.Field(69            default=True,70            description=f"Whether to allow network access during code execution; may be overridden by environment variable {_VALVE_OVERRIDE_ENVIRONMENT_VARIABLE_NAME_PREFIX}NETWORKING_ALLOWED.",71        )72        MAX_RUNTIME_SECONDS: int = pydantic.Field(73            ge=1,74            default=30,75            description=f"Maximum number of seconds code is given to run; may be overridden by environment variable {_VALVE_OVERRIDE_ENVIRONMENT_VARIABLE_NAME_PREFIX}MAX_RUNTIME_SECONDS.",76        )77        MAX_RAM_MEGABYTES: int = pydantic.Field(

Run arbitrary Python or Bash code safely in a gVisor sandbox.

0
0

Run arbitrary Python or Bash code safely in a gVisor sandbox.

0
0