SafePrompt · Prompt injection detection API
Get a free API key
SafePrompt
Prompt injection detection API for LLM apps and agents.
Back to blog
Ian Ho
7 min read

AI API security: why there is no standard, and what one would look like

Every infrastructure category has a standard API. AI security has none. Here is why vendor lock-in in a security-critical layer is dangerous, and what the standard should look like.

AI SecurityAPI StandardInteroperabilityThought Leadership

Key points

AI security has no standard API: every vendor uses a different interface, which is dangerous vendor lock-in for a security-critical layer. The fix is a simple OpenAPI 3.1 spec defining a common validate endpoint, a shared safe/threats response, and a shared threat taxonomy. SafePrompt publishes the reference implementation at safeprompt.dev/openapi.yaml.

You picked an AI security vendor in a hurry, wired its SDK into every route, and shipped. Now its price tripled, or it had an outage. Switching means rewriting all of it, because there is no shared interface. That is the lock-in this post is about, and why it is worse in security than anywhere else.

Quick Facts

Auth standard:OAuth 2.0 / OIDC
Payments standard:Stripe-compatible APIs
Observability standard:OpenTelemetry
AI security standard:None
Diagram contrasting four prompt security vendors, each using a different request field and authentication header, against a single proposed standard contract with one prompt field, one X-API-Key header and a boolean safe field in the response.
Four vendors, four contracts. The cost of no standard is paid on every migration.

Every infrastructure category has a standard. Except this one.

Think about the last time you integrated authentication. You probably used OAuth 2.0 or OIDC. You did not have to choose between incompatible auth systems, you chose a provider (Auth0, Clerk, Supabase), and the interface was standardized.

Same for payments. Stripe defined the interface. Dozens of services are Stripe-compatible. You can switch processors without rewriting your checkout code.

Same for observability. OpenTelemetry defined the interface. Your traces work across Datadog, Honeycomb, Jaeger, any backend that speaks OTLP.

AI security has none of this. Every vendor (Lakera, now part of Check Point, NeMo Guardrails, and SafePrompt) ships a different API shape, different field names, different threat taxonomies. There is no way to swap vendors without rewriting every integration. If you are still weighing those vendors, our roundup of the best prompt injection detection tools lays them out.

Why this is specifically bad for security

Vendor lock-in is annoying in most categories. In security, it is dangerous for a few specific reasons:

1. You cannot respond fast to vendor incidents

If your AI security vendor goes down, gets breached, or raises prices 10x, you are stuck. Switching takes weeks of engineering time, time during which your app is either unprotected or offline. With a standard interface, you switch in an hour.

2. Threat categories are not comparable

Lakera Guard, now Check Point AI Guardrails, returns flagged: trueplus an optional per-detector breakdown. SafePrompt returns safe: false with a typed threat array. Others return numeric risk scores. Without a shared taxonomy, you cannot benchmark, compare, or audit what different services actually detect.

3. No secondary validation

Defense-in-depth is a core security principle. Running two AI security checks, one primary, one secondary for high-stakes decisions, is currently impractical because every integration is custom. A standard would make layered AI security as easy as adding a second DNS provider.

What the standard should look like

The spec does not need to be complex. The UNIX philosophy applies: do one thing well. An AI security gateway should validate a prompt and return a structured result.

ai-security-gateway-spec v1.0yaml
# ai-security-gateway-spec v1.0
POST /api/v1/validate
  Body:  { prompt: string, session_token?: string }
  Header: X-API-Key, X-User-IP

Response:
  {
    safe: boolean,
    threats: string[],
    confidence: number,       // 0.0 - 1.0
    processingTime: number
  }

Three endpoints. That is all.

  • /api/v1/validate, single prompt check
  • /api/v1/validate/batch, batch check (up to 50 prompts)
  • /api/v1/usage, quota and billing info

The response schema is the important part. safe: boolean is the primary decision signal. threats: string[] uses a shared enum so you can write logic like if threats.includes('extraction_system_prompt')that works across any compliant vendor.

What changes with a standard

Today, switching AI security vendors looks like this:

before-standard.jsjavascript
// Today: vendor lock-in
const result = await fetch('https://api.lakera.ai/v2/guard', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.LAKERA_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ messages: [{ role: 'user', content: userMessage }] })
}).then(r => r.json())
if (result.flagged) throw new Error('Blocked')

// Switching vendors = rewriting every integration

With a standard interface, every vendor looks the same to your code:

after-standard.jsjavascript
// With a standard: swap freely
import SafePrompt from 'safeprompt'
const sp = new SafePrompt({ apiKey: process.env.SAFEPROMPT_API_KEY })
const result = await sp.check(userMessage)
if (!result.safe) throw new Error('Blocked')

// Same interface. Any compliant vendor works.

The only thing that changes is which API key you configure. Your application code, the part that handles blocked prompts, logs threat categories, and alerts on anomalies, stays identical.

The threat taxonomy matters as much as the schema

Half the value of a standard is the shared vocabulary. These are nine of the threat labels the reference implementation returns today, covering the OWASP LLM Top 10 attack surface. Getting one shared list agreed across vendors is the part that still needs doing:

jailbreak_instruction_override

Direct "ignore all previous" commands

jailbreak_safety_bypass

DAN, developer mode, character breaks

extraction_system_prompt

Attempts to leak system instructions

exfiltration_target

Stealing context or conversation data

reference_obfuscated

Base64, ROT13, Unicode obfuscation

jailbreak_role_play

Persona hijacking via roleplay framing

multi_turn_attack

Slow-burn attacks across sessions

injection_pattern

Zero-width chars, invisible CSS

injection_template

XML/JSON formatted override attempts

Using shared category names means your alerting, logging, and incident response tooling works regardless of which vendor detected the threat.

SafePrompt is the reference implementation

We are publishing the full OpenAPI 3.1 spec and building against it. SafePrompt implements the validate and batch endpoints today, so if you build against those, SafePrompt works out of the box. You can read the spec right now, it is live at the URL below.

Get the spec

  • OpenAPI 3.1 spec: safeprompt.dev/openapi.yaml
  • GitHub: github.com/ianreboot/safeprompt
  • npm SDK: npm install safeprompt
  • Python SDK: pip install safeprompt

What we are asking for

We are not asking Lakera or anyone else to adopt our API shape verbatim. We are proposing a conversation: what should the standard look like?

The AI security category is young enough that we can still establish interoperability before lock-in calcifies. Auth took until OAuth 2.0 (2012) to get a standard, five years after the first OAuth draft. Payments took even longer.

AI security is young. Now is the time to get this right.

If you are building an AI security product and want to collaborate on the spec, open an issue at github.com/ianreboot/safeprompt or email [email protected].

Use the reference implementation today

You do not have to wait for a standard. A free key takes a minute, needs no card, and works with any provider.

Protect Your AI Applications

Add the check before you need it. SafePrompt reads every message, document and tool result going into your model and blocks the attacks, in one line of code.

Add SafePrompt as a preferred source on Google. You tick one box on Google's own page. Google then shows you more of our posts in your own results.