← Table of Contents · Page 421 of 868
SANDBOXING AND ISOLATION FOR SAFETY
Part 1 of 9
LEARNING GOALS
By the end of this chapter you will be able to describe container and virtual machine isolation, explain network egress controls, apply resource limits, and recognize the unsolved hard problems of safe execution.
WHAT A SANDBOX IS
A sandbox is a fenced-off area in which a program can run without being able to touch anything outside.
Children play in a sandbox and make a mess, yet the mess stays inside the box.
When an agent runs code or handles untrusted files, a sandbox keeps any damage contained.
Sandboxing is the last line of defense, because it works even when the model has been fooled.
CONTAINERIZED AND VIRTUAL MACHINE ISOLATION
A container is a lightweight, isolated package that holds a program and what it needs, and it has its own view of files and processes.
A VM is a whole simulated computer running inside a real one, with a stronger wall between it and the host, at the cost of more weight and slower start.
Containers are like separate apartments in one building, sharing the building's foundation.
Virtual machines are more like separate houses.
Both let you run each task in a fresh, disposable environment that is destroyed afterward.
Because nothing persists, a hostile task cannot leave anything behind for the next one.
Typical hardening steps include running as an ordinary user without administrator power, mounting files as read-only wherever possible, and giving the task only the folders it needs.
Advertisement
Read Aloud:
0:00 / 0:00