Sandboxing creates confined execution environments that limit the level of access untrusted programs have. It works by implementing namespace isolation and access checks to control what resources programs can access. While sandboxing improves security, it also has limitations such as not providing enough or too much isolation, lack of portability, usability issues, and design/implementation failures. Popular online sandboxes for analyzing malware include Anubis and BitBlaze, while offline options include Sandboxie and Autovin.