You downloaded a public repo from GitHub. It looked fine at the time. A month later, a dependency gets compromised, or a contributor pushes malicious code, or an auto-updater pulls something you didn't ask for. The code is on your filesystem. If it runs with your user permissions, it can read your SSH keys, your AWS credentials, your browser cookies — anything your user account can touch.
Docker fixes this. A container is an isolated Linux environment that only sees what you explicitly give it. No mounts means no access to your Mac's filesystem. No network flag means no outbound connections. The code runs, but it runs in a box.
This guide covers how to set that up from scratch on macOS.