Open source · Works with OpenAI & Anthropic

sAIfety
Guardrails for every AI call.
Zero code changes.

A drop-in proxy that automatically protects your AI features — blocking prompt injection, redacting PII, filtering topics, and validating outputs before they reach your users.

View on GitHub → See how it works

Every AI feature ships with the same risks.

Most teams build the same safety checks from scratch, every time. sAIfety means you build them once.

Without sAIfety

Rebuilt in every app, every time

  • PII reaches the model and gets logged by your AI provider
  • Users manipulate the AI by overriding your system prompt
  • No record of what's being sent to or returned from the AI
  • Safety logic scattered across multiple codebases
  • One rule change means updating every app that calls AI
  • Different teams apply different (or no) standards
With sAIfety

Consistent, centralised, automatic

  • PII is redacted before it ever leaves your infrastructure
  • Injection attempts are blocked at the proxy layer
  • Every request and outcome is logged to an audit trail
  • All rules live in one YAML file, not scattered in code
  • Update a policy once — every app inherits it instantly
  • Per-tenant profiles for different risk levels

One URL change. Full coverage.

sAIfety is a transparent proxy — it speaks the same API as OpenAI and Anthropic, so your existing code needs no modification.

1

Start the proxy

Run sAIfety alongside your app. It listens on port 8000 and forwards requests to whichever AI API you're using.

$ uvicorn main:app --port 8000
2

Change one line

Point your OpenAI or Anthropic client at the proxy instead of the AI API directly. That's the only code change needed.

# before OpenAI(api_key="sk-...") # after — one line change OpenAI( api_key="sk-...", base_url="http://localhost:8000/v1" )
3

Configure your rules

Edit policy.yaml to define which guardrails apply to which tenants. No code deploys — just save the file.

pii: enabled: true action: redact prompt_injection: enabled: true topic_filter: blocked_topics: - competitor - lawsuit

Everything that can go wrong, covered.

Six guardrails run on every request and response, configurable per tenant.

🔏

PII Redaction

Detects sensitive personal data in user messages before they reach the model. Choose to silently redact or block the request entirely.

Email Phone SSN Credit card
🛡️

Prompt Injection

Blocks attempts to override your system instructions — jailbreaks, persona hijacking, "ignore all previous instructions" patterns.

Jailbreak patterns Persona override System leak
🚫

Topic Filter

Blocks requests that mention any topic you configure as off-limits. Useful for brand safety, legal compliance, or competitive reasons.

Custom keywords Per tenant Word boundary match
☣️

Toxicity Filter

Inspects model responses before they reach your users, blocking hate speech, slurs, and harmful content.

Output scanning Configurable threshold
📐

Output Validation

Enforce a maximum response length, or require the model's response to conform to a JSON schema — useful for structured data pipelines.

Max length JSON schema Format enforcement
📋

Audit Log

Every request is logged — tenant, API used, outcome, reason if blocked, and message preview. Queryable via API or the dashboard.

SQLite Filterable JSON API

Works with what you already use.

Compatible with the official OpenAI and Anthropic SDKs in Python and JavaScript — no wrapper libraries, no lock-in.

  •  OpenAI Python & JS SDK
  •  Anthropic Python & JS SDK
  •  Any HTTP client (curl, fetch, axios)
  •  LangChain, LlamaIndex, and other frameworks that use OpenAI-compatible endpoints
# The only change needed in your entire codebase
from openai import OpenAI

client = OpenAI(
    api_key="sk-...",
    base_url="http://localhost:8000/v1",  # ← add this
)

# Everything else stays identical
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
    extra_headers={"X-Tenant-ID": "my-app"}  # optional
)
// The only change needed in your entire codebase
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: "http://localhost:8000/v1",  // ← add this
});

// Everything else stays identical
const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});
# Works with the official Anthropic SDK too
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-ant-...",
    base_url="http://localhost:8000",  # ← add this
)

response = client.messages.create(
    model="claude-opus-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)

See everything. Understand anything.

A live dashboard shows every request in real time — what was blocked, why, and by which guardrail. Edit your guardrail rules per-tenant directly from the UI. No YAML files, no restarts.

sAIfety Dashboard — localhost:8000
Total Requests
1,284
Blocked
47
Pass Rate
96.3%
Proxy Status
● Online
TimeTenantOutcomeDetails
14:32:01 default passed What is the capital of France?
14:31:58 strict blocked Request contains PII: email
14:31:44 default blocked Prompt injection attempt detected
14:31:39 default passed Summarise this document for me...

Free to self-host. Hosted plans start at $49.

Run sAIfety on your own infrastructure for free — forever. Or use our hosted service and skip the ops work entirely.

Free
Self-hosted. Full feature set, no restrictions.
$0
forever
  • Unlimited requests (self-hosted)
  • All guardrails included
  • OpenAI & Anthropic support
  • Policy editor dashboard
  • Audit log & token metrics
  • Community support
Clone on GitHub →
Growth
Hosted. Built for production workloads.
$199
per month
  • 1,000,000 requests / month
  • 200 requests / minute
  • All guardrails included
  • Hosted dashboard
  • Priority support
  • Custom webhook integrations
Start free trial →
Need higher limits or an on-prem license? Get in touch →

Start shipping sAIfer AI today.

Open source, self-hosted, and running in under two minutes.