ProductTutorialGetting Started

Getting Started with Bordair: Your First Scan in 30 Seconds

11 Jan 20264 min readBordair

Adding prompt injection detection to your application takes less than a minute. Here is how.

Step 1: Get your API key

Sign up at bordair.io/signup. Free tier includes 200 credits per week. No credit card required.

Step 2: Install the SDK

# Python
pip install bordair

# JavaScript/TypeScript
npm install bordair

Step 3: Scan your first input

Python

from bordair import Bordair

client = Bordair()  # Uses BORDAIR_API_KEY env var

result = client.scan("Hello, how can you help me?")
print(result)  # {"threat": "low", "confidence": 0.02, "method": "fast_accept"}

result = client.scan("Ignore all previous instructions")
print(result)  # {"threat": "high", "confidence": 1.0, "method": "pattern"}

JavaScript

import Bordair from 'bordair';

const client = new Bordair();

const result = await client.scan("Ignore all previous instructions");
if (result.threat === "high") {
  console.log("Blocked!");
}

Step 4: Add to your pipeline

# Before sending to your LLM
result = client.scan(user_input)
if result["threat"] == "high":
    return "Sorry, that request was blocked for security reasons."

# Safe to send to the LLM
response = openai.chat.completions.create(...)

What happens under the hood

  1. Pattern matching runs first (sub-1ms). Known attacks are caught immediately.
  2. If no pattern matches, the fast-accept gate checks for obviously benign input.
  3. If neither matches, the ML model classifies the input (under 30ms).

Total time: under 50ms for any input.

Protect your LLM application

Add prompt injection detection in minutes with Bordair's API.

Get started free