Local LLM AI Penetration Testing: Keep Your Data Private
TL;DR: AI penetration tests and other AI security tests put their working material into the model's prompt: source code, test credentials, captured traffic and findings. A hosted model API takes those prompts out of your network. OpenAI, for example, keeps abuse-monitoring logs that can include them for up to 30 days by default, and longer in some cases.1 An in-country model keeps them in your country, though a provider processes them. An on-premises model keeps them on your own GPUs.
This is for you if someone at your Saudi or Gulf bank, government entity or telco has asked where an AI security tool's model runs.
Skip this if you're okay with sending private information to the cloud and outside your country.
Key points
- As of 2026, none of the ten data-residency regions in OpenAI's API was in Saudi Arabia.1
- In our reading of SAMA's Cyber Security Framework, an on-premises model falls outside its cloud requirement. Using an in-country provider still needs SAMA's approval and a contract.2
- When captured traffic holds personal data, sending it to a model outside the Kingdom is a transfer under the Personal Data Protection Law (PDPL), with the conditions in Article 29.3
What is local LLM AI penetration testing?
Local LLM AI penetration testing means that the large language model (LLM) behind an AI security test runs in one of two places. In-country means a provider's GPUs inside your country. On-premises means your own GPUs. A model works only on the text in its prompt. The testing tool fills the prompt with what each step needs, such as a source file to review or an HTTP response to judge.
Depending on the test, the prompt can hold any of these.
| Data in the prompt | Which tests use it | What a reader of the prompt learns |
|---|---|---|
| Source code and configuration files | AI static application security testing (SAST) | Application logic, and any keys committed with it |
| Target URLs, hostnames and IP addresses | AI penetration tests and AI dynamic application security testing (DAST) | A map of what you expose |
| Test credentials, session tokens and API keys | Authenticated testing | Working access while they are valid |
| Captured HTTP requests and responses | AI penetration tests and AI DAST | Whatever the application returned, including any customer records |
| Findings and draft reports | Every AI test | A list of weaknesses that are not yet fixed |
Where does a hosted model API send your data?
With a hosted model API, your prompts go to the provider's servers, in the regions the provider operates, under the provider's retention terms. OpenAI's API documentation as of July 2026 is one example:1
- Abuse-monitoring logs "may contain certain customer content, such as prompts and responses". By default they are "retained for up to 30 days", or longer where the law requires it or OpenAI needs it to protect its services or others from harm.
- A customer can keep its content out of those logs only after OpenAI approves it for Zero Data Retention or Modified Abuse Monitoring.
- Data sent to the API is not used to train OpenAI's models, and has not been since 1 March 2023, unless the customer opts in.
- Data residency covers ten regions: the United States, Europe, Australia, Canada, Japan, India, Singapore, South Korea, the United Kingdom and the United Arab Emirates. Inference stays in the region only in the United States, Europe and the UAE. In the UAE, that covers two text-generation models and two embedding models.
When an AI security vendor builds on a hosted API, your data passes through two companies. The vendor runs the scan, and the model provider processes its prompts. The provider's terms apply to the vendor's account, so ask which retention controls that account has.
Can you use AI on your source code without sending it abroad?
Yes, with an in-country or on-premises model. The model's location decides who processes the prompts, and so which approvals and transfer rules apply. The table compares the three options. Its last column is our reading of the rules quoted below it.
| Where the model runs | Where the prompts go | Who can read them | The question it raises in Saudi Arabia |
|---|---|---|---|
| Hosted API outside the Kingdom | The provider's region | The tool vendor and the model provider | SAMA's "explicit approval", NCA's hosting guideline, the PDPL transfer conditions |
| In-country: a provider's GPUs in the Kingdom | A data center in the Kingdom | The tool vendor and the GPU provider (one company or two) | SAMA's cloud approval and a contract |
| On-premises: your own GPUs | Nowhere outside your network | Your own staff, and anyone you grant access | SAMA's private-cloud exclusion |
SAMA's Cyber Security Framework (CSF) applies to banks and other SAMA-regulated firms.2 Its control 3.4.3 says that "in principle only cloud services should be used that are located in Saudi Arabia". A service outside the Kingdom needs "explicit approval from SAMA". The control "is not applicable to private cloud services (= internal cloud)", and we read an on-premises model as internal cloud.
An in-country model passes the location test, but we read it as a cloud service all the same. So the firm "should obtain SAMA approval prior to using cloud services or signing the contract with the cloud provider". The control also requires that "a contract should be in place ... before using cloud services".
For government entities and Critical National Infrastructure (CNI) operators, the National Cybersecurity Authority (NCA) lists this guideline under control 4-2-2 of its 2023 implementation guide:4
Ensure that the location of hosting and storing the organization's information is within the Kingdom.
That guide was written for ECC-1:2018, the earlier version of NCA's Essential Cybersecurity Controls. ECC-2:2024 deleted the sub-control that required hosting inside the Kingdom. It refers entities to the National Data Management Office (NDMO) on data localization, as our July post on foreign AI APIs explains.
The PDPL applies when prompts hold personal data. Its definition includes "name, personal identification number, addresses, contact numbers".3 Captured responses can hold such data when you test production, or a test environment with copies of real records. Article 29 allows a transfer outside the Kingdom only for the purposes it lists. It also requires "an adequate level of protection for Personal Data outside the Kingdom" and limits the transfer to "the minimum amount of Personal Data needed".
Article 29 leaves exceptions to those two conditions to the implementing regulations, which our July post covers. It also lifts these conditions in cases of "extreme necessity", such as preserving the data subject's life. An in-country or on-premises model in the Kingdom involves no transfer abroad.
How capable are open-weight models?
On average, the best open-weight models have trailed the best closed models by about three months, according to Epoch AI's October 2025 analysis.5 Epoch AI measures the gap on its Epoch Capabilities Index, a composite of many benchmarks of general capability. The gap varies, and at times it has closed completely.5
This gap applies to on-premises models, because a model can run on your own GPUs only if its developer releases the weights. Open-weight models are the ones whose weights anyone can download.
Questions to ask any AI security vendor about where its models run
Ask these before a trial, and get the answers in writing:
- In which country, and on whose GPUs, does the model run for our scans?
- Does any prompt go to a third-party model API, and if so, which provider, which region and which retention controls?
- Does the in-country or on-premises option cover detection and validation, or only fix suggestions?
- What else leaves our network during a scan, such as update checks, usage data or lookups against public vulnerability databases?
- Where are test credentials, session tokens and traffic captures stored, for how long, and who at your company can read them?
- Have you measured your in-country or on-premises option against your hosted option on the same targets?
How Haxset can help
Haxset offers AI SAST, AI DAST, AI PR Scanner and AI-Driven ASM as modules of the Haxset Engine. Haxset deploys the Engine and its models in your country on Haxset GPUs, or on-prem on your own GPUs. In those deployments, the full AI runs locally. Haxset does not keep the prompts its AI models process and does not train models on them. It stores only scan metadata and scan results. Contact us to match a deployment to your approvals.
FAQ
What is the difference between self-hosted and on-premise AI pentesting?
On-premises AI penetration testing runs the testing software and its model on your own hardware. "Self-hosted" says who operates the software. It says nothing about where the model runs, and a self-hosted tool can still call a hosted model API. Ask which GPUs process the prompts.
Does bring your own key (BYOK) keep data in the country?
Not by itself. With BYOK, a tool calls a model provider's API on your account, so the prompts still go to that provider and its regions. BYOK keeps data in the country only when the key is for a model endpoint that runs in the country.
Does UAE or Bahrain hosting meet Saudi data residency rules?
Not for SAMA's cloud rule or NCA's 2023 guide. SAMA's CSF expects cloud services "located in Saudi Arabia", so a service elsewhere in the Gulf needs SAMA's explicit approval.2 NCA's guide, written for ECC-1:2018, expects hosting "within the Kingdom".4 ECC-2:2024 refers data localization to the National Data Management Office instead.
Related research
- Saudi Rules on Sending Source Code to Foreign AI Services
- What Is AI SAST? What the LLM Actually Does
- AI SAST and DAST: How LLM Agents Find Vulnerabilities
References
-
OpenAI, Data controls in the OpenAI platform, API documentation, as archived on 26 July 2026. ↩ ↩2 ↩3
-
Saudi Arabian Monetary Authority (now the Saudi Central Bank), Cyber Security Framework, version 1.0, May 2017, sections 1.4 and 3.4.3 (pp. 6, 37–38). ↩ ↩2 ↩3
-
Saudi Data and Artificial Intelligence Authority (SDAIA), Personal Data Protection Law, English text, V2 (April 2023), Articles 1 and 29. ↩ ↩2
-
National Cybersecurity Authority (NCA), Guide to Essential Cybersecurity Controls (ECC) Implementation (GECC-1:2023), 2023, written for ECC-1:2018, control 4-2-2 (p. 164). ↩ ↩2
-
Luke Emberson, Epoch AI, Open-weight models lag state-of-the-art by around 3 months on average, data insight, 30 October 2025. ↩ ↩2
Interested in how this research applies to your organization?
Get in touch
