// GLOSSARY
Black box, gray box, and white box: three levels of knowledge in a test
Black box, gray box, and white box are three levels of knowledge a tester starts with: from no information at all, through user accounts and documentation, to access to the source code. The choice changes how much of the budget goes to reconnaissance and how much to finding vulnerabilities. For web applications the default choice is gray box, because the tester gets accounts for every role and doesn’t have to spend time obtaining them.
// 01
The three variants side by side
| Criterion | Black box | Gray box | White box |
|---|---|---|---|
| What the tester knows | Only what is public: a domain or an IP range | Accounts for every role, documentation, an architecture description | The same as gray box, plus the source code |
| What is handed over | The target of the test and the rules of engagement | Test accounts, test data, a developer contact | The repository, the database schema, the environment configuration |
| Where the time goes | A large share on reconnaissance and gaining access | Most of it on testing features and roles | Most on reading code and verifying the branches found |
| What it reveals in addition | What is visible from outside without a single account | Authorization flaws between user roles | Validation and logic flaws buried deep in the code |
| What it wastes | Budget on finding out what the company already knows | An attacker’s view without an account, unless you also test from outside | Time reading code in a large application |
| Effect on duration | Longer for the same scope and the same number of findings | Matches the estimate the scope was planned with | Longer preparation, faster confirmation of findings |
| When it makes sense | Checking the external perimeter without knowledge of the inside | The default mode for web applications and APIs | In-house development with a large share of business logic |
The difference between the variants isn’t in how thorough the test is, but in how much of the agreed time goes to finding out information the client already has. One note on spelling: gray box and grey box are the same thing; we use the US form, gray.
// 02
When black box makes sense and when it’s a waste
Black box makes sense where the goal is to verify what an attacker sees without any access at all: the external perimeter, a public portal, a mail gateway. For an application behind a login, though, a large part of the time is spent obtaining an account and mapping the features, work that gray box settles by handing over credentials.
The argument for black box is that it’s more realistic. It rests on an equation that doesn’t hold: the less the tester knows, the more faithfully they supposedly simulate an attacker. The trouble is the time budget. An attacker can push at one company for months at no cost; the tester has 15 days. Simulating ignorance therefore means buying reconnaissance instead of findings.
- The external perimeter is being tested and the question is what can be seen from there at all.
- The brief includes checking whether anyone catches the attack.
- The application is public and the tester can register an account themselves.
- The client needs to show a counterparty that the test ran without inside information.
Choose black box if you’re testing what is visible from the internet, not what happens after login.
// 03
Why gray box is the default for applications
Gray box is the default choice for web applications and APIs because the tester gets an account for every role and can go straight to checking whether it’s possible to climb from one role into another. Authorization flaws, meaning access to someone else’s data after a legitimate login, can’t be tested without an account for every role.
Handing over accounts also solves a practical problem: without them, the tester has no idea that besides the ordinary user the application also has an approver role and a branch manager role. The range of checks the tester goes through is governed by the methodology, not by the level of knowledge; for web that is most often the OWASP Web Security Testing Guide.
Choose gray box if the application has more than one user role and you care that all of them get tested.
// 04
When it pays to give the tester the source code
White box pays off for applications that the company develops itself and that carry a lot of custom logic: payment flows, limit calculations, integrations with banking interfaces. With the code, the tester also verifies branches that can’t normally be reached from the interface and, for each finding, points straight to the place that needs fixing.
The worry that handing over code gives something away to the tester misses the point. Code doesn’t raise the severity of a finding; it only shortens the path to it. What the tester may and may not do with it is governed by the NDA and the rules of engagement anyway, not by keeping the repository secret.
- You develop the application yourselves or have access to the code through your vendor.
- A substantial part of the risk is in the logic, not the configuration.
- The test is meant to follow up on a code review or on fixes from the previous round.
- The application processes payments, health data, or other sensitive data.
// 05
For a network and for an application the words don’t mean the same thing
For an application, the level of knowledge means accounts, documentation, and source code. For a network it’s something else: whether the tester knows the topology, IP ranges, and list of systems in advance, or has to find them alone. The same word in an inquiry for a test of an application and its roles and for a test of networks and servers therefore means different preparation each time.
For an internal network there is also a third variable that box terminology doesn’t cover at all: what privileges the tester starts with. Whether they get an ordinary domain account or first have to get onto the network themselves changes the result of the test more than how much documentation they read beforehand.
// 06
What is actually handed over in each variant
The list of inputs belongs in the brief, not in the kickoff call. When accounts and test data get sorted out only after the start, the time comes out of testing, regardless of the variant chosen.
| Input | Black box | Gray box | White box |
|---|---|---|---|
| Scope and rules of engagement | Always | Always | Always |
| An account for every user role | No | Always | Always |
| Test data and a test environment | By agreement | Always | Always |
| Description of architecture and integrations | No | Usually | Always |
| A developer contact for questions | No | Usually | Always |
| An exception on the web application firewall (WAF) or rate limiting | Depends on the goal of the test | Usually | Usually |
| Access to the repository | No | No | Always |
// 07
Frequently asked questions
Related pages
Updated September 5, 2026.
// TEST BRIEF
Not sure which variant to put in your inquiry?
Tell us what you want tested. We’ll get back to you and schedule a call to pin down scope, timing, and price.