OpenAI API Penetration Testing
Last updated:
Your OpenAI API application gives the model functions to call, and your backend executes the arguments the model returns. We test what those tools can reach and whose data they can touch. EJN Labs is a CREST-accredited UK company providing penetration testing for applications built on the OpenAI API, from £6,010 for a 5-day single-application scope, quoted within 24 hours.
- Unlimited retesting
- Unlimited pre-retesting
- No hidden fees
“I would highly recommend EJN Labs to any organisation seeking reliable, detailed, and well-managed penetration testing services, particularly for government or enterprise-level projects.”
“There wasn’t another company we could find that could deliver what we needed in the timeframe we needed. The client loved it, and we got instant ROI from the engagement.”
In an application built on the OpenAI API, the model proposes the call and your code carries it out, so the permissions of every function, connector and key you hand it decide the blast radius.
How the OpenAI API decides what your application can do
With function calling, the model returns the name of a function and a set of arguments, and your own code runs it. OpenAI’s function calling guide sets the default tool_choice to auto, in which the model may call zero, one or several functions, and can instead always ask for a call, force one named function, or apply an allowed_tools list that limits the model to a subset of the tools you pass. None of those settings checks who the end user is. Whether the account behind the request may run that function on that record is a decision in your backend, and it is the first thing a review looks at.
Connectors raise the stakes. OpenAI’s remote MCP documentation warns that a malicious server can exfiltrate sensitive data from anything that enters the model’s context, and gives an example of a web page that instructs the model to look up a customer in a CRM and put the email address in a URL. Fetching that URL would disclose the address, even if the CRM tool only allows reads. The same page recommends requiring approval for sensitive actions. This is indirect prompt injection, and it is covered in our AI penetration testing as well as here.
Then there is the key. OpenAI’s guidance on API key safety is to never deploy a key in a browser or mobile app, never commit it to a repository, give each team member their own key, and route requests through your own backend. A key that has leaked into a front-end bundle or a build log can spend your quota and reach your project’s stored data, so we search for it as part of the test, alongside the application code in our web application penetration testing.
SCOPE
What we test in an OpenAI API penetration test
API Keys in Bundles, Repositories and Logs
OpenAI’s key guidance says never to deploy a key in client-side environments such as browsers or mobile apps, and never to commit one to a repository. We search front-end bundles, mobile builds, source history, build logs, error pages and environment settings for a key, and test whether any endpoint of yours relays requests to OpenAI without applying your own limits.
Key Scope, Projects and Rotation
OpenAI recommends a unique key for each team member, workload identity federation in place of a long-lived key where it is supported, and says revocation of a key takes effect within a few seconds. We map which keys each service, pipeline and person uses, which organisation and project each belongs to, and whether one shared key serves production and testing together.
Authorisation on Every Function the Model Can Call
The model chooses the function and its arguments, and your code runs the call. For each function we test whether your backend checks that the signed-in user may perform that action on that record, or runs it with a service identity that can reach everyone’s data.
tool_choice, allowed_tools and Which Tools Each Request Exposes
Requests can leave tool_choice on auto, always ask for a call, force one function, or restrict the model to an allowed_tools list. We review which tools each request exposes, whether a user-facing route exposes administrative or write functions it does not need, and whether the model can be steered to a tool outside the intended flow.
Model-Supplied Arguments Reaching SQL, Shell and Internal APIs
Function arguments are text produced by a model that has read user input. We test what happens when those arguments carry injection payloads, file paths, internal URLs or another user’s identifiers into database queries, commands, server-side requests and your own internal APIs.
Remote MCP Servers and Connectors
OpenAI states the MCP tool in the Responses API defaults to requiring approval of each tool call, that only trusted servers should be used, and that URLs in tool outputs should not be trusted blindly. We list every connected server, the data each one receives, the allowed_tools and approval settings in force, and test whether a poisoned tool result can trigger a further call.
Prompt Injection From Users and Retrieved Content
OpenAI’s safety guidance asks developers to red-team for inputs such as ignore the previous instructions, and to limit input length and output tokens. We attack the system prompt directly, then through web pages, documents, emails and tickets your application feeds into the context, and record what the model can be made to disclose or do.
File Search, Vector Stores and Metadata Filters
File search can filter results on file metadata attributes. Where several customers or roles share one vector store, we test whether those filters are set by your server from the signed-in user, or can be changed by the caller, and whether another tenant’s documents can be retrieved.
Conversation State, Stored Responses and Retention
OpenAI saves response objects for 30 days by default unless store is set to false, and conversation objects are not subject to that limit. We test whether one user can read, continue or fork another user’s stored response or conversation by guessing or reusing identifiers, and what your own logs keep of prompts and outputs.
Output Handling, Moderation and Per-User Abuse Controls
Model output is untrusted text. We test whether it is rendered as HTML or markdown, placed into queries or shell commands, or used to approve actions, and whether your use of the moderation endpoint, safety_identifier values and rate limits holds when one user sends large volumes of requests or abusive input.
OUR PROCESS
OpenAI API Penetration Testing: From Scope to Attestation
Scope and Access
We agree the application, the OpenAI project and keys in scope, and the tools, connectors and data stores behind the model, and get test accounts for each user role.
Tool and Data Mapping
We map every function and connector the model can reach, whose permissions each one runs with, where prompts and retrieved content come from, and where output goes.
Manual Testing
A CREST-certified tester manually attacks prompts, tool arguments, retrieval and credentials with real accounts, chaining findings where they compound.
Attestation and Retest
You get a technical report with CVSS scores and reproduction steps, a walkthrough call, a free retest once fixes are deployed, and an attestation letter for auditors.
CREDENTIALS
Verified Accreditations Auditors Accept
Every credential below is independently verifiable. UK procurement teams, FCA supervisors, ISO 27001 / SOC 2 auditors, and cyber insurance underwriters all recognise these standards.
GET YOUR QUOTE
Get a CREST OpenAI API pen test quote in 24 hours
A fixed-price quote back in one business day, from a named CREST assessor. No sales pipeline, no chasing.
- CREST and IASME accredited. Testing your auditors and clients already recognise.
- Fast-track testing within 24 hours where required. Free retest of every fix included.
- Live findings via your client portal, not a four-week PDF.
- Fixed price from £3,500 for a single-role, single-app scope, agreed up front. Most engagements run £5,000 and up. No day-rate surprises.
Under NDA Further named references available on a scoping call.
- We reply within one business day with a fixed-price quote from a named CREST assessor.
- You approve the scope and we book a start date, usually within 24 hours.
- Live findings land in your client portal as we test, with a free retest of every fix.
Get your fixed pen test quote in 24 hours
Quote request received
We will reply within one business day with your fixed-price quote from a named CREST assessor.
Your data stays with us. No newsletter signup.
or book a 20-min scoping call first
We reply within one business day. Your data stays with us. No newsletter signup.
COMPLIANCE READY
Reports Mapped to Every Framework
Findings are written so your team can reference the report against each framework without translation work.
ISO 27001:2022
Annex A.8.8 management of technical vulnerabilities plus A.5.15-5.18 and A.8.2-8.5 access control validation.
SOC 2 Type I & II
CC6 logical access, CC7 system operations, CC8 change management evidence.
PCI DSS
Requirement 11.4 application penetration testing across cardholder data environments, including ecommerce penetration testing for online retail platforms.
FCA SYSC
SYSC 4.1.1R, 6.1.1R, 13 mapped to each finding for FCA-regulated firms.
UK GDPR
Article 32 effectiveness testing, customer-data security controls, ICO-acceptable evidence.
Cyber Essentials Plus
Direct certification through our IASME body status, single-vendor delivery.
PRICING
Transparent OpenAI API Penetration Testing Pricing
EJN Labs OpenAI API Penetration Testing prices start at £6,010. Pricing depends on the number of roles, integrations and environments in scope. See our pricing page for how we quote.
Depends on AI system complexity
Single LLM-powered chatbot, basic RAG (≤100 documents), no agent tools. Around 5 to 7 working days from kickoff to report.
Get a fixed quoteDepends on AI system complexity
Multi-tool agent system, complex RAG pipeline, fine-tuned model, multi-tenant. Around 8 to 12 working days from kickoff to report.
Get a fixed quoteDepends on AI system complexity
Production AI platform, multi-agent orchestration, regulated AI use case (FCA, NHS), custom-trained models. Around 12 to 18 working days from kickoff to report.
Get a fixed quoteSECTORS
Sectors We Test OpenAI API For
Sector-specific scoping for regulated UK organisations.
Fintech & FCA-Regulated
FCA SYSC, Open Banking FAPI 1.0, PSD2 SCA, payment-flow scrutiny, KYC/AML testing.
Fintech sector pageSaaS Companies
SOC 2 Type I & II evidence, multi-tenant boundaries, role escalation, customer-tenant isolation.
SaaS sector pageLaw Firms
SRA Cyber Standard, privileged data, conveyancing fraud defence, partner-tier procurement.
Law firm sector pageHealthcare
NHS DTAC, DSP Toolkit v6, UK GDPR Article 32, EHR systems, telehealth platforms.
Healthcare sector pageInsurance
FCA / PRA Operational Resilience, cyber underwriting, claims data, broker portals.
Insurance sector pagePublic Sector
CCS / G-Cloud framework, NCSC-aligned, citizen-facing services, PSN-compliance scrutiny.
Public sector pageWHY EJN LABS
What You Get From OpenAI API Penetration Testing
Six concrete differentiators competitors don’t all match.
CREST-Certified Testers, Verifiable
Every test by a CREST-certified pen tester (CRT, CCT APP, CCT INF where applicable). Verify our company status at crest-approved.org.
24-Hour Startup, Where Required
From signed scope to active testing in a single business day for incident response, audit deadlines, or regulator-driven timelines.
Live Findings, Not 4-Week PDFs
Critical issues reported during testing through your client portal. Your team remediates while testing continues.
Audit-Ready Reports
Executive summary plus full technical report with CVSS scores and explicit framework mappings (ISO 27001, SOC 2, PCI DSS, FCA SYSC).
Free Retests, Standard
Verify remediation of every finding before close-out. Letter of attestation for audit submission included. Most competitors charge £1,500-£3,000 per retest.
UK-Based CREST Testers
Every engagement performed by vetted, UK-based CREST-certified testers, matched to your needs, security clearance, and compliance scope.
FAQ
Frequently Asked
What access do you need to test our OpenAI API application?
We need test accounts for each user role, the application URL or build, and a description of the tools, connectors and data sources the model can reach. A key for a separate OpenAI project dedicated to the test lets us confirm behaviour without spending your production quota, and read access to the project’s settings lets us review keys and limits without changing them.
Will testing touch live data?
That is your choice, and we agree it before testing starts. We recommend a staging copy of the application with its own OpenAI project and seeded test records, because prompt injection tests are designed to make the application act. We do not run destructive tests or read real customer data without written agreement.
How long does an OpenAI API penetration test take?
A single application with a defined set of tools and one retrieval source sits in our 5-day single-application scope, with the report typically landing around 5 to 7 working days after kickoff. Several applications, many connectors or a large agent workflow move into a larger scope.
Do you test the OpenAI models themselves?
No. We test your application, the tools it exposes, the way it handles keys and retrieved content, and what it does with the output. We do not test OpenAI’s models or platform, and we do not try to defeat OpenAI’s own safeguards.
What is out of scope?
OpenAI’s own platform, infrastructure and models are out of scope, as are third-party connectors you do not control. We test what you build and configure: your backend, functions, keys, retrieval stores, prompts and output handling. A connected system such as your identity provider or cloud account is scoped and quoted separately.
Does OpenAI place rules on customer security testing?
OpenAI’s Usage Policies list unsolicited safety testing and circumventing its safeguards among prohibited uses, and its Terms of Use prohibit bypassing protective measures. We confirm OpenAI’s current terms with you during scoping and shape the test to them: it targets your application and its behaviour, not OpenAI’s safeguards, at a volume agreed in advance.
We build agents and workflows on the API rather than making raw calls. Does that change the test?
The questions stay the same: which tools can the agent call, with whose permissions, what can it read, and what leaves the system. We scope against the features your application actually uses, whether that is function calling, file search, remote MCP servers or a workflow built on them.
Is EJN Labs CREST accredited?
Yes. EJN Labs is a CREST-accredited company, and every OpenAI API engagement is carried out by UK-based, CREST-certified testers. Your report and attestation letter are recognised by auditors and insurers accordingly.
20+ CREST-accredited testing services in one place
Web, mobile, API, cloud, AI, infrastructure, red team. Pick the test that fits your environment.
Get a fixed price for your OpenAI API application
Your OpenAI API application gives the model functions to call, and your backend executes the arguments the model returns. We test what those tools can reach and whose data they can touch. EJN Labs is a CREST-accredited UK company providing penetration testing for applications built on the OpenAI API, from £6,010 for a 5-day single-application scope, quoted within 24 hours.



