Black-box vs grey-box vs white-box AI testing: which to choose first
Start with grey-box testing if your chatbot, internal copilot or MCP-connected agent can call tools or act on data, and add black-box testing for the parts of the surface that outside users can reach. Grey-box testing means the tester signs in as each role (an employee, a contractor, a customer, an administrator) and tries what that identity can reach through the agent's tools. Many agent-specific risks sit there. The OWASP Top 10 for Agentic Applications for 2026 lists Tool Misuse (ASI02) and Identity and Privilege Abuse (ASI03) as separate items, and a black-box tester cannot see which tools or permissions a role holds. Black-box testing fits a public chatbot with no tools, where the question is what an outside user can extract or make the system say. It gives you the view an attacker or customer reviewer gets, which is the evidence most security questionnaires about an exposed endpoint ask for.
Bring in white-box testing when the prompts, tool schemas, MCP server code and configuration are in scope, which is usually when you own the build. Reviewing the system prompt and tool descriptions shows what the agent has been told to do and which tools it can call. Reading the MCP server code shows how it handles credentials. The MCP security best practices forbid token passthrough, so a server must not accept tokens that were not issued for it. A code review can check that directly, while a black-box run can only infer it. For local MCP servers, the same guidance expects clients to show the exact command before a one-click install, to require explicit user approval, and to run servers sandboxed with minimal default privileges. Check those settings in the configuration itself. Ask early which of these artifacts you can export, because access sets the scope.
Combine the approaches when the agent is both public and tool-enabled, which is the usual case for a customer-facing copilot. A practical sequence is white-box review of prompts, schemas and MCP code first, grey-box runs for each role second, and black-box testing of the public entry point last, followed by retesting after fixes. NIST SP 800-115 notes that organizations often combine techniques to reach an in-depth assessment, and the OWASP Web Security Testing Guide says no single technique is enough. No single approach covers the whole system. Black-box testing misses the permissions behind the chat window, grey-box testing misses defects that only show in code and configuration, and white-box review does not show what an attacker can reach from outside. Confirm the MCP protocol version your servers implement before you write it into scope, since the guidance cited here is tied to version 2025-11-25.
How black-box vs grey-box vs white-box AI testing compare on access and evidence
This table compares what each testing box gives the tester, what it can find, and what evidence it leaves for an assessor. NIST SP 800-115 treats review techniques as passive and penetration testing against production systems as high risk, so set the environment and access in the rules of engagement before you choose a box. The main takeaway: the access granted decides which OWASP LLM, agentic and MITRE ATLAS risks a test can reach.
| Factor | Black-box | Grey-box | White-box |
|---|---|---|---|
| Goal | Show what an outside party can make the system do with no internal knowledge. | Test named abuse paths using a standard user identity and a known tool list. | Find design and configuration causes, such as prompts, tool scopes and model sourcing. |
| Access and method | Chat or API access only; method is adversarial prompting and output probing. | A standard or low-privilege account and tool or connector lists; scripted injection and permission tests. | Design documents, system prompts, tool and MCP code, policies; code review plus exploitation. |
| AI surfaces covered | Public chat and API endpoints; hidden tool use is only inferred from outputs. | Chat plus the agent's tools, connectors, retrieval sources and MCP servers the account reaches. | All grey-box surfaces plus system prompts, memory stores, tool code, pipelines and admin settings. |
| What it finds | Externally reachable prompt injection, data leakage, exposed AI services and unauthenticated endpoints. | Excessive agency, tool misuse and privilege abuse that only appear once a tester is logged in. | Over-broad tool scopes, token passthrough, unsafe code execution and poisonable retrieval or memory design. |
| What it misses | Internal permissions, reachable tools not exposed in the chat, and flaws behind an authenticated path. | Code paths the tester cannot see, and model or dataset supply chain issues outside the test identity. | Emergent behavior with live user data and deployment drift, so it still needs dynamic testing. |
| Evidence produced | Reproduced prompts and outputs for externally reachable failures, with severity and suggested fixes. | Attack transcripts, permission matrices and tool-call traces tied to each test role. | Code and configuration findings with file or setting references, plus fix retests. |
| Fit with OWASP LLM, agentic and MITRE ATLAS lists | Strongest for LLM01, LLM02 and ATLAS prompt injection and jailbreak techniques. Limited for ASI03 and ASI04. | Adds LLM03 Excessive Agency, ASI02 Tool Misuse and ASI03 Identity and Privilege Abuse, plus ATLAS agent runtime discovery. | Best placed for LLM04, LLM05 and ASI04 supply chain and poisoning, using code and pipeline review. |
| Effort and cost drivers | Usually least setup; effort grows with the number of agents, tools and prompt variants probed. | Needs test accounts, role mapping and a tool inventory from the client; cost grows with roles and connectors. | Needs code access, architecture walkthroughs and reviewer time; cost grows with codebase size and custom tools. |
| Cost of a later round | Repeats cheaply for regression, but tools or memory added later may go untested. | Repeat cost rises when roles or connectors change; fix the identity matrix in the statement of work. | Each release needs fresh code access; plan change-triggered reviews to limit repeat cost. |
Which parts of an AI system each approach can reach
The access level you grant a tester decides which parts of an AI system they can test at all. A black-box tester reaches the model endpoint and the chat or API front end, so they can probe for prompt injection (LLM01 in the 2026 OWASP list) and for sensitive information disclosure (LLM02). A grey-box tester usually receives a test account with a defined role, the tool and function schemas, and access to a sample retrieval index, which lets them check whether retrieval, vector stores (LLM09 in the 2026 list) and memory respect the permissions of the user asking. White-box access adds the system prompt and instruction files (LLM08 Hidden Context Exposure in 2026), the tool implementations, agent identity configuration, OAuth scopes, and the model and dataset supply chain (LLM04 and LLM05), which an outside tester cannot inspect directly.
Tool and MCP surfaces show the clearest split between the approaches. The MCP security best practices (protocol version 2025-11-25) forbid token passthrough: an MCP server must not accept tokens that were not explicitly issued for that server. A grey-box test can check this from outside by presenting a token issued for another audience and seeing whether the server accepts it, and it can compare what a low-privilege identity is able to call against the scopes it was meant to hold. A white-box review asks different questions, such as whether the server code validates token audience, checks OAuth authorization URLs and avoids confused deputy behavior in proxy designs. For local servers, clients offering one-click setup must show the exact command and require explicit user approval, and servers should run sandboxed with minimal default privileges. Check these settings on each developer machine, because a black-box test of a remote endpoint will not reveal them. MCP security best practices
Decide which questions matter before you write the scope. If the main risk is data extraction through the chat front end, black-box and grey-box tests answer it directly. If the main risk is an agent with write access to a ticketing or payments system, the identity behind each tool call matters more, which calls for grey-box identity tests plus white-box review of the server code. Before you sign a statement of work, ask the testing partner which surfaces are in scope, whether local MCP servers on developer machines are included, and which OAuth scopes and tool schemas they will receive. Also confirm whether exposed AI endpoints will be scanned from outside, since MITRE ATLAS v2026.09 added Misconfigured or Publicly Exposed AI Services (AML.T0132) as a technique. MITRE ATLAS data release v2026.09
How the access level changes which trust boundaries a tester crosses
The diagram starts with an inventory of AI systems, agents, tools, MCP servers and identities, since the access level only changes what a tester can reach once those are known. The first question is who the tester is. An outside user reaches only public endpoints and the chat interface, which gives black-box coverage. An authenticated role adds the tools and data that role can use, which gives grey-box coverage. Access to prompts, configuration and code gives white-box coverage. All three feed one combined validation step. After fixes, the retest loop confirms that each failed case is closed. Check that every identity and tool permission appears in the inventory before choosing a branch.
The decision path from inventory to access-based coverage, validation and retest.
What black-box vs grey-box vs white-box AI testing finds and misses
Each view of an AI system or agent sees a different part of the attack surface, so each one finds a different set of problems and leaves others untouched. The cards below pair what each view can surface with what it cannot, using the same risk categories throughout. Read them together: the last card lists the gaps that remain when no single view is used on its own.
Black-box view
Black-box testing starts with only the public interface: chat endpoints, APIs, and any AI service reachable from the internet or a partner network. It can surface prompt injection through the public interface and publicly exposed or misconfigured AI services, which MITRE ATLAS tracks as AML.T0132. It cannot see the system prompt, retrieval sources or tool definitions, so hidden instructions stay hidden. It also cannot reach anything behind a role, such as admin consoles or tools only an internal user can invoke. Ask the tester to state in the report which accounts, if any, were used, so the gap is documented.
ATLAS v2026.09 releaseGrey-box view
Grey-box testing runs with one or more known roles, such as a standard employee or a support agent, and with the agent's tools and connectors in view. It is the view that most often surfaces excessive agency (OWASP LLM03), tool misuse (ASI02) and identity and privilege abuse (ASI03), because the tester can see what each role lets an agent do. It can also show token passthrough under a given role, which the MCP authorization specification forbids. It misses code paths that role never reaches, so an admin-only branch or a rarely triggered tool stays untested unless a second role is tested. Ask for the role matrix used in the test.
MCP security best practicesWhite-box view
White-box testing reads the source: how prompts are assembled, how tool schemas and MCP server code are written, where configuration files hold secrets, and which third-party models, datasets and plugins the build pulls in. It is the view that examines supply chain exposure (OWASP LLM04) most directly, alongside secrets and unsafe prompt construction. Its limit is runtime behavior: a code review cannot show how the model responds to a hostile document or a long sequence of user inputs. Pair it with a runtime view before treating the result as a full picture, and ask whether the review also covered the deployed configuration.
Combined blind spots
No single view covers the whole system, and the gaps sit between the three. Black-box misses hidden instructions and role-gated paths, grey-box misses code that a role never reaches, and white-box misses behavior under real inputs. Combining views narrows these gaps but does not close chains that cross several roles, tools and data sources, which the scope must name explicitly. Agree in the statement of work which views are used, which roles are tested and which runtime inputs are replayed, so the report states what was and was not covered.
When compliance frameworks call for each approach
Most compliance frameworks name the kind of test they expect, not the access level a tester should start from, so the choice of black-box, grey-box or white-box work for an AI system or agent is usually yours to justify. NIST SP 800-53 Rev. 5 control CA-8 Penetration Testing is selected only in the high baseline in SP 800-53B Release 5.2.0, and its enhancements call for an independent penetration testing team and red team exercises. That points to an adversary-minded test of the deployed agent, with its tool permissions, identities and data paths in scope. The SA-11 Developer Testing and Evaluation enhancements are different. Static code analysis, manual code reviews, dynamic code analysis and interactive application security testing need access to code, configuration and runtime behavior, which leans toward grey-box and white-box work on the components you built or customized.
Other frameworks are more specific about method. DORA Article 25(1) lists source code reviews where feasible alongside penetration testing, so a financial entity running a self-hosted agent platform should expect code-level evidence for the parts it changed and should ask its competent authority how feasibility applies to third-party components. PCI SSC's penetration testing guidance says that simply running an automated tool does not satisfy the penetration testing requirement, so an automated black-box scan will not close a payment-related agent finding on its own. For AI systems, EU AI Act Article 15(5) requires high-risk systems to resist attempts to exploit vulnerabilities, including data poisoning, adversarial examples and confidentiality attacks. Article 55(1) requires documented adversarial testing for certain general-purpose AI model providers. Neither article says which access level meets it.
DeployOpen prepares the test evidence for these reviews, including scope statements, method records, findings and retests, but it does not issue audit reports, attestations or certifications. Before you fix a test access level, write down which control or article each test is meant to support. Then ask your assessor, regulator or customer security team to confirm in writing that the proposed mix of black-box, grey-box and white-box work is acceptable for that scope. Ask specifically whether they expect code-level review of self-hosted components, whether agent tool permissions and MCP servers are in scope, and whether testing at the model and agent layer will be accepted as documented adversarial testing. Their written answers decide whether the evidence holds up in review.
What you receive from each approach and what an assessor can use
This table compares what each testing approach hands over at the end of an AI system or agent engagement, and which items depend on the access the client grants. Read the access-dependent rows first, because they decide how far an assessor can trace a finding to prompts, tool calls, configuration and code. The written scope sets the exact outputs for each approach, and DeployOpen prepares the evidence an assessor uses.
| Deliverable | Black-box | Grey-box | White-box |
|---|---|---|---|
| Test plan and rules of engagement | Plan covering in-scope endpoints, test accounts and permitted attack classes, agreed in writing | Plan adds the roles, tool scopes and test identities the client provides | Plan adds model, prompt, tool and configuration review areas, with code access terms |
| Asset and surface inventory (depends on access) | Observed endpoints, UI entry points and connected tools as visible from outside | Endpoints plus the tools, roles and data sources the client documents | Inventory of agents, tools, prompts, MCP servers and data stores taken from configuration |
| Reproduction records: prompts, requests, tool calls and logs (depends on access) | Prompts, responses and requests captured from the test client only | Prompts, requests and tool call traces for authenticated test roles | Prompts, tool calls and server logs correlated with code paths and configuration |
| Findings with the severity method agreed in scope | Findings rated under the scope's method, with exploitability limited to observed behavior | Findings rated under the scope's method, with privilege and tool impact traced | Findings rated under the scope's method, with root cause in configuration or code |
| Code or configuration references (depends on access) | None unless the client supplies configuration | Configuration excerpts for tool scopes and permissions, where shared | File and line references for prompt assembly, tool registration, authorization and logging |
| Fixes and retest results | Fix guidance and retest of reproduced cases at the surface | Fix guidance for roles, tool permissions and data handling, plus retest | Fix guidance at the code and configuration level, plus retest of each root cause |
| Compliance evidence mapping (depends on access) | Limited to observed controls, mapped to OWASP LLM or agentic risk IDs | Access control, logging and tool permission evidence mapped to test results | Mapping extended to configuration, data handling and code controls the assessor asks about |
| Assurance and who issues it | Evidence for the assessor. Independent auditors and certification bodies issue any report or certification. | Evidence for the assessor. Independent auditors and certification bodies issue any report or certification. | Evidence for the assessor. Independent auditors and certification bodies issue any report or certification. |
What drives the cost of black-box vs grey-box vs white-box AI testing
Five drivers set the effort and risk of an AI test regardless of the box label. Scope and access decide how much the tester must map, tool and identity depth decide how many trust paths get tested, and environment and retest terms decide the risk and the repeat work. Read each card as a question to settle in the written scope.
Scope of AI surfaces
Scope fixes how many agents, tools, MCP servers, models and data stores the tester must cover, so it often drives the most effort. A black-box test may reach only a public chat interface, while a grey-box or white-box test must map every surface down to tool registrations, retrieval indexes and model endpoints. DeployOpen is paid for enumeration and testing time per surface, once for the initial inventory and again when new agents or tools join. In the written quote, ask for a named list of surfaces with counts per category and explicit exclusions.
OWASP LLM Top 10 2026Access the client provides
Access sets how much the tester can see, from public interfaces only for black-box work to source and configuration for white-box work. The client supplies test accounts per role, sandboxed tenants, architecture documents and, where agreed, source and configuration access. Each item widens coverage and shortens discovery, but someone inside the client must create and maintain it. Your internal time is the main unpaid cost, and DeployOpen is paid for reviewing what arrives. Ask the quote which roles, tenants, documents and repositories will be provided, who provisions each, and the date each must be ready.
Tool and identity testing depth
Agents act through tools and identities, so OAuth flows, scope minimization and token handling add testing time that prompt testing alone never reaches. MCP authorization guidance forbids token passthrough, so a tester must confirm each MCP server accepts only tokens issued for it. Cost rises with each OAuth grant, connected tool and identity provider in scope, and most of that work is one-time per integration. It recurs when a tool or permission changes. Ask the quote to list each OAuth client, grant type, tool and token store in scope, and whether confused deputy and privilege escalation paths are tested.
MCP security best practicesEnvironment, data and rules of engagement
Testing in staging or production changes both the risk and the price of the engagement. NIST SP 800-115 rates penetration testing that runs exploits against production systems and data as high risk, so the rules of engagement must set which systems, accounts and datasets are in bounds and how a test is halted. Staging is often cheaper to prepare, but it may lack the production model, tool and permission settings. Costs include writing the rules of engagement, data handling terms and any rollback support. Ask the quote which environment is used, which datasets, and who can stop the test.
NIST SP 800-115Retest and continuous testing
Retesting confirms that each fix closed its finding, and agent setups need another pass after model, prompt or tool changes. Whether a retest sits inside the fixed scope or costs extra is a scope decision, so settle it before work starts. Continuous testing runs under a retainer, which recurs on a schedule you agree and covers changes between formal tests. Recurring cost tracks how often your agents, tools and models change. Ask the quote whether a retest is included, how many rounds it allows, what triggers a retest after a model or tool change, and what the retainer covers.
How to combine the three approaches in one AI engagement
NIST SP 800-115 notes that organizations often combine techniques to reach an in-depth assessment at an acceptable level of risk. This sequence starts with a complete inventory, then combines inside and outside views so each test builds on earlier findings. The output is role, code, supply chain and exposure findings, each with a retest record.
Inventory agents, tools, identities and data stores
Map every agent, tool, MCP server, identity and data store the engagement covers, with the owner of each. Include which tools can write, which identities the agents act as, and where prompts, memory and retrieved documents are stored. The client's platform or security team typically supplies this, and the tester checks it against deployment configuration. The step closes with a written asset inventory and a scope list agreed with the client, which every later test references. Confirm that the list includes any tool added since the last review.
Run grey-box role tests on authorization
Test the agent as each role in the inventory, using test accounts for each. Check whether a low-privilege user can get the agent to call a tool or read data above their role, and whether injected instructions drive tool misuse (OWASP ASI02). Also check token handling: the MCP authorization specification forbids token passthrough, so testers confirm each MCP server accepts only tokens issued for it. Output: a role matrix of tools and data paths, with reproduction steps for each failed check. Done when every role in scope has a recorded result.
Review prompts, schemas, server code and supply chain
Read the artifacts the agent runs on: system prompts, tool schemas, MCP server code, configuration files, and the model and dataset supply chain. Testers look for excessive agency (OWASP LLM03), overreaching tool descriptions, hard-coded credentials, and unvetted third-party models, datasets or fine-tuning pipelines (LLM04 and LLM05). Output: a review report with file-level findings and a supply chain record listing each model, dataset and dependency with its source. Done when every artifact in the inventory is read or excluded with a stated reason.
Run black-box validation from outside access
Test from the position of an outside user or unauthenticated caller, with no prompts, schemas or credentials provided. Testers probe the agent's public chat, APIs, webhooks, connectors and any exposed model endpoints, and attempt prompt injection through content the agent reads, such as documents, emails or web pages (OWASP LLM01). They also check for publicly exposed AI services (MITRE ATLAS AML.T0132). Output: a reachability report with proof of each exposed path. Done when the reachable surface in the inventory has been tested or marked out of reach with evidence.
Retest after fixes and on change
Rerun the failed checks from steps two to four after fixes are deployed, in the environment where each issue was found. Repeat the role, code and exposure tests whenever a tool, MCP server, model, dataset or permission changes, since a new tool can open a path no earlier test covered. Confirm that monitoring records the techniques the testers used, in line with CIS Safeguard 18.4. Output: a retest record per finding and an updated inventory. Done when every finding is closed, accepted in writing by the client, or carried forward with an owner.
What buyers ask about black-box vs grey-box vs white-box AI testing costs and effort
What does an AI system security test cost?
DeployOpen does not publish a price list, so the quote follows the written scope, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. Ask for line items for access, testing and retest, because each one moves the total for a different reason. Access covers the time to set up test accounts, tool permissions and any grey-box or white-box materials, and it rises with the number of agents, tools and environments in scope. Testing scales with the attack surface, such as prompt injection paths, tool calls, memory stores and MCP servers. Retest appears as its own line, and its size depends on how many findings need verification. The initial test is largely one-time, while upgrades and continuous testing recur under a retainer. Ask the provider to show which items are included and which are optional.
How long does an AI agent security test take?
No duration applies across all AI engagements, so the written scope sets the timeline and the date of the first deliverable. Ask for the timeline in the statement of work, including when the findings report arrives and when the retest takes place. Duration rises with the number of agents, tools, identity integrations and environments, and with how long it takes to get test accounts and approvals in place. Grey-box and white-box work usually needs more time up front for architecture review and documentation, while black-box work can start sooner but may produce less depth on internal behavior. Ask the provider to split the timeline into setup, testing, reporting and retest so you can see where delays would come from. Your change windows and the availability of named contacts will also set the pace.
What do we need to provide for an AI security test?
The engagement needs a defined set of inputs before testing starts. Plan to provide:
- Test accounts for each role in scope, including a low-privilege user and an administrator
- Logs and telemetry access for the agent, its tools and the identity provider
- Architecture diagrams showing models, retrieval sources, tools, MCP servers and data flows
- A tool and permission inventory that states what each tool can read or write
- Named technical and business contacts, plus agreed rules of engagement that define allowed attacks, data handling and stop conditions
Rules of engagement matter most for agents, because a prompt injection test can trigger real actions in connected systems. Missing items usually extend the timeline, so confirm the list with the provider during scoping.
Can our own team run an AI security test internally?
Your team can run useful internal checks, but an automated scan or a checklist does not on its own count as a penetration test. The OWASP Top 10 for LLM Applications 2026 and the OWASP Top 10 for Agentic Applications for 2026 give a structured list of risks, including prompt injection, excessive agency, tool misuse and identity and privilege abuse, and they can guide internal test cases. The PCI SSC Penetration Testing Guidance (v1.1, September 2017) says simply running an automated tool does not satisfy the penetration testing requirement, and it describes the work as essentially manual. An internal team needs people who can build exploits, document evidence and retest fixes. An independent reviewer helps where results will go to an auditor or a customer.
Is a black-box test enough for a customer security review?
It depends on what the customer's questionnaire asks. A black-box test shows how the system behaves from the outside, which can answer questions about prompt injection resistance, data exposure through the interface and access controls a user can reach. Questions about supply chain, admin settings, tool permissions, role definitions and logging usually need grey-box or white-box evidence, such as configuration review and log samples. Map each questionnaire line to the test type that produces the evidence it asks for. DeployOpen tests AI features and prepares evidence customers ask for, including questionnaire answers, system card content and trust center content, but it does not issue audit reports, attestations or certifications. Confirm with the customer's security team which evidence format they accept before scoping.
Does a security test satisfy the EU AI Act?
A security test does not by itself satisfy the EU AI Act, but it can support documented testing and resilience work. Article 15(5) of Regulation (EU) 2024/1689 asks high-risk AI systems to be resilient against attempts to exploit vulnerabilities, including data poisoning, model poisoning, adversarial examples, model evasion and confidentiality attacks. Article 55(1) asks providers of general-purpose AI models with systemic risk to perform documented adversarial testing. A scope statement, test report and retest records can become evidence in that file. DeployOpen does not issue attestations, certifications or audit reports, so a findings report records the work performed and does not determine compliance. Buyers should confirm with counsel which obligations apply to their system and what documentation those obligations require.
How DeployOpen scopes and runs AI system security tests
DeployOpen agrees the scope of each AI system or agent engagement in writing before work starts, including which access level applies: black-box, grey-box or white-box. Testing covers the model-facing application, its tools, permissions, identity settings and data paths, and engagements are fixed-scope.
How we scope
- The written scope names the access level for each target: black-box, grey-box or white-box, with reasons agreed up front.
- For agents, the scope lists the tools, MCP servers, data sources and identities the test may touch.
- Rules of engagement set limits on prompt injection tests, data exposure checks and any use of live customer data.
How we build
- Black-box work probes the deployed interface as an outside user would, including indirect prompt injection.
- Grey-box work uses supplied test accounts and role settings to check tool permissions, SSO and access control.
- White-box work reviews system prompts, tool schemas, agent configuration and MCP server code alongside live tests.
How we hand over
- Findings report with reproduction steps, affected component, severity and the fix recommended for each issue.
- Agent rollout reviews also cover coding agents, workplace agents and MCP servers, with a retest after fixes.
- Documented scope, method per access level and retest results that compliance teams can review.
How we support
- Ongoing support and continuous testing for AI systems and agents are available as retainers.
- Retests after fixes confirm whether changed prompts, tool permissions or access settings closed each finding.
- Re-test scope after model, prompt or tool changes is agreed in writing before the next test begins.

