beetlebug▾
/

Isolation

The isolation level applies to the commands of the run tool. The file tools (read_file, write_file, edit_file, list_files, search) run in the daemon at each level, and they stay inside the work folder. The model calls run in the daemon.

--isolation of start sets the level. The default is isolation of config.json, else process. A level that the host cannot give makes start fail with the reason. jcode never falls back to a weaker level.

Level Protects Does not protect
none Nothing. A command has the full power of the user: each file of the user, each credential in the home folder, the network, and each process of the user.
process A command can change only the work folder, the paths of --write, and its scratch folder. It has no network unless --net. It has the memory limit of --mem and the process limits of a cgroup. A command can read each file that the user can read, also credentials. Linux only.
cloud The whole agent runs on its own EC2 instance, which ends after the one task. The instance gets only the commits of the work folder, and gives back its commits as the branch jcode/ID. The instance reaches the internet on port 443, and can call the models of its allow list. Its commands run as root on the instance.
vm A command runs in a new Linux guest. The guest sees only the work folder, at /mnt/share, and has no network unless --net. A fault of the guest kernel or of KVM. The work folder is shared: a command can change each file in it, also .git.

none

The command runs with sh -c as a child of the daemon, in its own process group. Use it only with a brief and a model that you trust, or on a machine with no secret.

process

The command runs in a process thread of ztcl (thread::create -isolation process):

The level needs Linux with Landlock, user namespaces, and cgroup v2. With ztcl 1.0.0-beta.7:

vm

Each command runs in a new guest of ztcl::vm: the signed guest image ztcl-guest (Linux with busybox), the memory of --mem (512 MB by default), and the work folder at /mnt/share. Before the command, jcode mounts a tmpfs on /bin with busybox and a link for each applet, so sh and #!/bin/sh work. The guest ends after the command; a stop, an interrupt, or a timeout deletes it.

The level needs KVM and the guest image in the store of ztcl::vm (Run an agent in a VM). With ztcl 1.0.0-beta.7:

cloud

The level needs AWS resources that the owner makes, and cloud in config.json; the design has each one. Each call to AWS assumes the role jcode-caller through the AWS profile of profile, so jcode never uses the rights of your user.

--net

--net gives a command the network. With the network, a command can send each file that it can read to another host. At the level process, that is each file of the user. none, and --net at the level process, give the agent the power of the user.