Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Sandboxing is a security technique that runs applications or files in an isolated environment, so that anything they do cannot affect the host system, network, or other applications.

What Is Sandboxing?
Sandboxing is the practice of running code in a tightly restricted, isolated environment, known as a sandbox, so that whatever it does cannot affect the rest of the system. A sandbox limits what the code can see and touch: which files it can read, which network connections it can make, and which system functions it can call. If the code turns out to be malicious or simply buggy, the damage stays inside the box.
The term covers two related ideas. The first is isolation as a built-in protection, used every day by browsers, mobile operating systems, and applications. The second is sandboxing as an analysis tool, where suspicious files are deliberately detonated in a controlled environment to observe their behaviour.
Most people use sandboxes constantly without noticing:
This kind of sandboxing reduces the impact of vulnerabilities, including zero-day vulnerabilities that have no patch yet.
Security products and analysts use sandboxes to examine suspicious files and links before they reach users. Email gateways, web proxies, and endpoint platforms can automatically send unknown attachments to a sandbox, where they are opened in an instrumented virtual machine. The sandbox records everything the file does:
If the behaviour looks malicious, the file is blocked and its indicators, such as domains and file hashes, can be shared with other security tools. This dynamic analysis complements signature-based detection, because it judges files by what they do rather than what they look like.
Attackers know their code will be sandboxed and design it accordingly. Common evasion techniques include:
Modern sandboxes counter these tricks with realistic environments, simulated user activity, time acceleration, and bare-metal analysis systems, but the contest between evasion and detection never ends.
Sandboxing is valuable but not a complete defence. Sandbox escapes do happen, as regular browser security updates show. Analysis sandboxes add delay to email delivery and cannot inspect everything, especially encrypted or password-protected files. And some attacks, such as credential phishing pages, contain no malware for a sandbox to analyse. Sandboxing works best as one layer alongside antivirus, endpoint detection, email authentication, and user awareness.
For most organisations, the practical steps are to keep browsers and operating systems updated so that their sandboxes stay effective, enable sandbox-based attachment analysis in email security, use containers and least-privilege service accounts for applications, and give analysts an isolated environment for safely examining suspicious files.
At Privia Security, our Email Security Solutions include sandbox analysis of attachments and links, stopping malicious content before it reaches your users.
A virtual machine is one way of building a sandbox, providing a fully separate operating system. Sandboxes can also be lighter, such as browser process isolation or container restrictions, which limit what an application can do without running a whole separate system. In malware analysis, sandboxes are usually instrumented virtual machines designed to record behaviour.
Yes, although it is difficult. Sandbox escapes typically require a separate vulnerability in the sandbox or the underlying operating system, and they are valuable enough that attackers save them for high-value targets. Keeping browsers, hypervisors, and operating systems fully updated is the best protection, since vendors patch known escape vulnerabilities quickly.
It can add a short delay, usually seconds to a few minutes, while attachments are analysed. Many products reduce the impact by delivering the message body first and releasing the attachment once it is cleared, or by rewriting links so they are checked at the moment of clicking. Most organisations find the trade-off worthwhile.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.