Skip to main content

Semantic Security

Regex filters catch “ignore previous instructions” but miss “disregard prior directives.” Raptor’s semantic firewall catches both.

How It Works

We use the same embedding technology as the cache, but for security. Similar attacks get caught, even if worded differently.

Built-in Patterns

Raptor includes patterns for common attacks:

Actions

Choose what happens when a pattern matches:

Blocked Response

When a request is blocked:
HTTP status: 403 Forbidden

Streaming Protection

For streaming requests, we monitor the response in real-time:
If the AI starts generating content that matches a pattern, we cut it off immediately.

Dashboard Configuration

  1. Go to Shield in your dashboard
  2. View built-in patterns or create custom ones
  3. Set similarity thresholds (0.0 - 1.0)
  4. Choose action (Block, Warn, Log)

API Endpoints

Tuning Thresholds

Start with Warn action to see what gets flagged. Switch to Block once you’ve tuned thresholds.

Performance

Firewall adds ~2ms to every request. The embedding computation uses a local ONNX model—no external API calls.