TL;DR: Put a gateway in front of the API and give the outside AI platform a key to that front door, never a network path inside. Use short-lived tokens tied to the platform's own identity. Start read-only for a month and publish only the routes it needs. The API still has to check which records each caller may see.
On November 5, 2026, a security manager at a large refiner asked me how to let a third party call an internal API. Machine to machine. No person in the loop.
Twenty minutes in, his director said it out loud. "The product that is wanting to pull this data is actually AI."
Nothing in the request said AI. It reached security as a firewall question.
Why is this question showing up now?
Outside AI platforms want your data, and they ask for it the way any integration does. Through an API. Security usually hears about it after the business picked the vendor.
The refiner's request is one of four client calls between August 25 and November 5, 2026, where outside or non-human callers of company APIs came up. On August 25, a health insurer described more than 100,000 APIs and said any developer can make one. On August 31, a pharma company framed AI agents as a new class of API caller. On September 29, an annuity insurer asked what it still controls when partners point their own agents at its APIs. Then the refiner.
Two of those four were an outside company's AI, by name. The annuity insurer put the worry plainly: "how much of that might translate to external where you may not have as much control."
The answer is all of it. You control the entry points you own.
Should you open a firewall rule for the vendor?
No. A firewall rule gives the vendor a network path, and a path has no opinion about who walks down it. I told the refiner's team, "it's just a road. It doesn't say who can come over that road."
Give the platform a front door instead. A gateway (the service that sits in the path and decides whether each request goes through) checks the token on each outside call and forwards only what's allowed.
Here's the design the refiner's team reached on its own, twice, at minute 30 and again at minute 55:
The cloud provider's managed API gateway takes the outside traffic.
The API stays in the headquarters data center.
The private line they already run carries traffic from the gateway to the API.
No new inbound rule opens on the on-premises firewall.
Every piece was something they already owned or licensed. That's the same lesson as checking what you already own before you buy an AI security tool. The team was eight people. What they needed was a picture of the design. The gear was already there.
How should the outside AI platform prove who it is?
With a short-lived token issued to the platform's own identity, not a password or a key that lives forever. There are two rungs that apply to an outside system.
The first rung is the OAuth client credentials grant. The vendor's app trades its credential for a token from your identity provider. The token lasts minutes. The gateway checks it on every call.
The second rung removes the stored secret. If the vendor runs in a public cloud, workload identity federation lets its cloud identity stand in for the secret. Microsoft's workload identity federation documentation lists AWS, Google Cloud, Kubernetes, and GitHub Actions among the supported sources. Nothing sits in the vendor's config for someone to steal.
The refiner didn't know where its vendor runs. That became a question to send back to the vendor, and it decides which rung they can reach.
Short tokens do a second job. They're your stop switch. When the token stops being renewed, access ends within minutes.
What should the gateway enforce on day one?
Less than the vendor asks for. Start read-only and widen on evidence. My line on the call was "no call that changes data until the read calls have run cleanly for a month."
Write these settings down before anyone builds:
Publish only the routes the platform needs, one at a time.
Read-only for the first month.
Rate and size limits for each caller.
Check every request against the API's OpenAPI description (the file that lists what the API accepts) and reject anything that doesn't match.
Return short errors to the outside and keep the detail in your logs.
Use the vendor's fixed addresses as a second lock, behind the token.
Require TLS 1.2 or higher on every hop, including the private line.
None of that's exotic. It's the checklist most teams never write because the request arrived as "can you open a port."
Who checks which records the AI can see?
The application team, inside the API. The gateway can't do it. It knows the caller is allowed in. It doesn't know whether that caller should see one plant's records and not another's.
OWASP ranks this first in its API Security Top 10. Broken object level authorization, API1 in the 2023 list, happens when an API takes an ID from the request and returns the object without checking that this caller may have it. OWASP's fix is a check on every function that takes a client-supplied ID, plus tests that block release when the check fails.
The refiner's team didn't know whether their API checks records per caller. That's normal. The API was built for internal users. Hand the question to the people who own the code, by name, before the gateway goes live.
What about the gateway's own access to the API?
Give the gateway its own credential from your vault. Then make the API accept calls only from the gateway. Then nothing can reach the API by going around the front door.
The refiner already ran a vault that reads its cloud key store. The credential problem was solved. They just hadn't pointed it here.
This gets harder with more callers. Once three outside platforms share one gateway credential, the API can't tell them apart. A request from one can ride the access of another. That's the confused deputy problem in AI agent gateways, and it's worth solving before the second vendor shows up.
Does it count if nothing reaches plant systems?
It counts a lot, and it's the first question to ask. "Does this API reach the refinery control systems?" got a five-word no from the director, and the IT pattern stood.
If the answer had been yes, the design changes. Plant networks have their own rules, and an outside AI platform reading operational data is a different conversation.
Ask it at minute one. Everything else depends on the answer.
Key takeaways
Outside AI platforms reach your data through APIs, and the request often doesn't say AI.
Give the platform a front door at a gateway, never a network path to the API.
Use short-lived tokens tied to the platform's identity, then federation to remove stored secrets.
Start read-only for a month and publish routes one at a time, with limits for each caller.
The application team owns the record-level check inside the API. The gateway can't do it.
Make the API accept only the gateway, using a credential from your vault.
FAQ
Is an outside AI platform different from any other integration?
The plumbing is the same as any integration. What's different is that an AI platform will ask for more data over time, and the refiner's director said as much: "this won't be the last time." Design for the second request now.
Can we use the gateway we already license?
Often, yes. The refiner already had a cloud tenant with a managed gateway service available. For a small team, the managed service is the easier first step. Learn from its logs, then decide.
Do we need mutual TLS?
It's a strong addition when the vendor can support it, because each side proves its identity with a certificate. Short-lived tokens at the gateway come first.
Who should own the vendor relationship?
The business owner who picked the vendor, with security setting the terms of the front door. Write both names on the request.
The vendor is already chosen by the time you hear about it. The front door is still yours to build.
