Technical Documentation
Natural Language Firewall

Complete technical reference for the Unseen Networks Natural Language Firewall - the enterprise-grade AI security platform with real-time policy enforcement.

Natural Language Security Platform

Unseen Networks provides real-time security for your AI applications with OpenAI-compatible endpoints. Get enterprise-grade protection with zero code changes - just point your existing applications to our secure firewall.

🚀 Get Started in Minutes

Drop-in replacement for your existing AI provider endpoints with instant security.

What You Get

  • Latest AI Models: Access to the newest models from OpenAI, Claude, and Perplexity
  • Real-time Protection: Advanced natural language firewall with instant threat detection
  • Complete Visibility: Full audit trails and analytics for every AI interaction
  • Policy Engine: Sophisticated rule system for compliance and custom security requirements
  • Zero Integration: Drop-in replacement requiring no code changes to existing applications
Zero Latency Impact: Sub-100ms policy evaluation with comprehensive request/response protection.

Supported AI Providers

Provider Latest Models Use Cases
OpenAI GPT-4o, GPT-4, GPT-3.5 Turbo (all latest versions) General purpose, coding, analysis
Claude (Anthropic) Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku Writing, reasoning, complex analysis
Perplexity Latest Sonar models with real-time web search Research, current events, fact-checking

Advanced Security Features

  • Bidirectional Protection: Policy evaluation on both requests and responses
  • PII Tokenization: Reversible tokenization with redaction pipeline
  • API Simulation: Test policies without hitting real AI providers
  • Compliance Presets: GDPR, HIPAA templates with custom rule support
  • Real-time Analytics: Prometheus metrics and exportable audit logs

Quick Start Guide

Get started with Unseen Networks Natural Language Firewall in 3 steps. The platform provides OpenAI-compatible endpoints with real-time security policy enforcement.

Step 1: Setup & Authentication

Obtain your API key from the admin dashboard and configure your AI provider keys:

API Key Structure: Uses x-api-key header for Natural Language Firewall authentication, plus standard provider API keys.

Step 2: Replace Your Endpoint

Replace your AI provider endpoint with the Natural Language Firewall's OpenAI-compatible endpoint:

// Before - Direct OpenAI/Claude/Perplexity call
const response = await fetch('https://api.openai.com/v1/chat/completions', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_PROVIDER_KEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
});

// After - Protected through Natural Language Firewall
const response = await fetch('YOUR_FIREWALL_HOST/v1/chat/completions', {
    method: 'POST',
    headers: {
        'x-api-key': 'YOUR_FIREWALL_KEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
});

Step 3: Configure Policy Presets

Enable security policies through the admin UI or directly in Redis. Available presets:

  • GDPR: Email, phone, IP address detection with redaction
  • HIPAA: SSN, medical record numbers, health data protection
  • Custom: JSON-based rules with regex and keyword matching
Done! Requests now flow through the policy engine with complete audit trails.

Integration Examples

OpenAI SDK (Python)

import openai

# Configure OpenAI client to use Natural Language Firewall
client = openai.OpenAI(
    base_url="http://localhost:3001/v1",  # Natural Language Firewall endpoint
    api_key="dummy",  # Not used - auth via x-api-key header
    default_headers={
        "x-api-key": "YOUR_FIREWALL_KEY"
    }
)

# Works with any model - automatic provider routing
response = client.chat.completions.create(
    model="gpt-4",  # Routes to OpenAI
    messages=[{"role": "user", "content": "Hello!"}]
)

# Or use Claude models
claude_response = client.chat.completions.create(
    model="claude-3-5-sonnet-20241022",  # Routes to Anthropic
    messages=[{"role": "user", "content": "Explain AI safety"}]
)

# Or use Perplexity for web-enhanced responses
perplexity_response = client.chat.completions.create(
    model="llama-3.1-sonar-large-128k-online",  # Routes to Perplexity
    messages=[{"role": "user", "content": "Latest news about AI development"}]
)

Direct HTTP with cURL

curl -X POST http://localhost:3001/v1/chat/completions \
  -H "x-api-key: YOUR_FIREWALL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {"role": "user", "content": "What is my IP address 192.168.1.1 doing?"}
    ]
  }'

Response Format

Natural Language Firewall returns OpenAI-compatible responses with additional metadata:

{
  "id": "chatcmpl-1234567890",
  "object": "chat.completion",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "The IP address [REDACTED] appears to be..."
    }
  }],
  "ai_proxy": {
    "traceId": "trace_abc123",
    "policy_decisions": {
      "prompt": { "action": "redact", "rules_triggered": 1 },
      "completion": { "action": "allow", "rules_triggered": 0 }
    },
    "redacted": true
  }
}

Verification

  • Headers: Check for x-request-id in response headers
  • Admin UI: View real-time request traces in the dashboard
  • Policy Testing: Include PII in requests to see redaction in action
  • Health Check: GET /health for service status

AI Models & Providers

Choose from the latest and most powerful AI models available. Simply specify the model name in your request - we handle all the routing and security automatically.

Available Models

OpenAI Models

{
  "model": "gpt-4o",          // Latest multimodal model
  "model": "gpt-4-turbo",     // Fast, high-quality responses
  "model": "gpt-4",          // Most capable model
  "model": "gpt-3.5-turbo"   // Fast and cost-effective
}

Claude Models (Anthropic)

{
  "model": "claude-3-5-sonnet-20241022",  // Latest and most capable
  "model": "claude-3-opus-20240229",     // Most intelligent model
  "model": "claude-3-haiku-20240307"     // Fastest responses
}

Perplexity Models

{
  "model": "llama-3.1-sonar-huge-128k-online",    // Most capable with web search
  "model": "llama-3.1-sonar-large-128k-online",   // Balanced performance
  "model": "llama-3.1-sonar-small-128k-online"    // Fast with web access
}

Model Selection Guide

Use Case Recommended Model Why
Code generation & debugging gpt-4o, claude-3-5-sonnet Excellent coding capabilities
Complex reasoning & analysis claude-3-opus, gpt-4 Deep analytical thinking
Fast responses & chat gpt-3.5-turbo, claude-3-haiku Speed optimized
Research & current events llama-3.1-sonar-*-online Real-time web search
Creative writing claude-3-5-sonnet, gpt-4 Superior creative abilities
Always Latest: We automatically update to the newest model versions as they become available.

How to Choose Models

Simply specify any supported model name in your request. Our system automatically:

  • Routes Correctly: Sends your request to the right AI provider
  • Applies Security: Same protection policies across all models
  • Provides Compatibility: OpenAI-format responses regardless of provider
  • Manages Keys: Uses the appropriate API keys automatically

Chat Completions API

The core endpoint providing OpenAI-compatible chat completions with integrated security policy enforcement.

Endpoint

POST /v1/chat/completions
Host: your-ai-proxy-host
x-api-key: YOUR_API_KEY
Content-Type: application/json

Request Format

Accepts standard OpenAI chat completion format with automatic provider routing:

{
  "model": "gpt-4",
  "messages": [
    {
      "role": "user",
      "content": "Analyze this email: john.doe@company.com"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 1000
}

Response Format

Returns OpenAI-compatible response with additional Natural Language Firewall metadata:

{
  "id": "chatcmpl-1234567890",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "gpt-4",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "I can analyze the email pattern [REDACTED]..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 50,
    "total_tokens": 75
  },
  "ai_proxy": {
    "traceId": "req_abc123def456",
    "policy_decisions": {
      "prompt": {
        "action": "redact",
        "rules_triggered": 1
      },
      "completion": {
        "action": "allow",
        "rules_triggered": 0
      }
    },
    "redacted": true
  }
}

Policy Enforcement Flow

  1. Request Received: Request traced and authenticated
  2. Prompt Evaluation: Policy engine evaluates user messages
  3. Provider Routing: Model name determines AI provider (OpenAI/Claude/Perplexity)
  4. Provider Call: Request forwarded to appropriate AI service
  5. Response Evaluation: Policy engine evaluates AI response
  6. Response Return: Final response with policy metadata

Error Responses

Status Reason Response
400 Policy Violation (Block) Request blocked by content policy
401 Authentication Invalid or missing x-api-key
202 Manual Review Request held for review (hold action)
503 Provider Unavailable AI provider service unavailable
Trace Headers: All responses include x-request-id header for request tracing in admin UI.

Policy Engine

The Natural Language Firewall policy engine provides real-time evaluation of both incoming prompts and outgoing AI responses using JSON-based rule definitions.

Policy Architecture

  • Singleton Engine: One policy engine instance per server with hot reload capabilities
  • JSON Configuration: All policies defined in structured JSON files
  • Bidirectional Evaluation: Both requests and responses are evaluated
  • Real-time Processing: Sub-100ms evaluation with no latency impact
  • PII Pipeline Integration: Advanced redaction with tokenization support

Policy Structure

{
  "id": "gdpr",
  "name": "GDPR Compliance Policy",
  "description": "General Data Protection Regulation compliance rules",
  "version": "1.0.0",
  "enabled": true,
  "rules": [
    {
      "id": "gdpr-email",
      "name": "Email Address Detection",
      "description": "Detects email addresses as personal data",
      "type": "regex",
      "pattern": "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b",
      "action": "redact",
      "severity": "medium",
      "enabled": true
    }
  ]
}

Rule Types

Type Description Configuration Use Cases
regex Pattern matching with regular expressions pattern field with regex string Email, phone, SSN, IP addresses
keyword Keyword-based detection keywords array of strings Sensitive terms, medical keywords

Policy Actions

Action Behavior Use Case Policy Mode Impact
allow Continue processing without modification Approved content No change
redact Replace sensitive data with placeholders PII protection, data masking No change
block Reject request with 400 error High-risk content, violations May downgrade to redact in lenient mode
hold Queue for manual review (202 response) Suspicious but uncertain content May downgrade in lenient mode
Performance: Policy evaluation typically completes in <10ms with full regex and keyword processing.

Compliance Presets

Pre-built policy templates for major compliance frameworks, ready for immediate deployment.

GDPR Preset

Comprehensive European data protection compliance with PII detection and redaction.

Included Rules:

  • Email Detection: Regex pattern for email addresses (redact)
  • Phone Numbers: International phone number patterns (redact)
  • IP Addresses: IPv4 address detection (redact)
  • Customer Secrets: Keywords like "password", "secret", "token" (block)
  • Personal Data: Keywords like "full name", "address", "credit card" (hold)

HIPAA Preset

Healthcare privacy protection with specialized medical data detection.

Included Rules:

  • Social Security Numbers: US SSN format detection (block)
  • Medical Record Numbers: MRN pattern matching (block)
  • US Phone Numbers: Specific US phone format (redact)
  • Medical Keywords: Diagnosis, prescription, medication terms (hold)
  • Email Addresses: PHI-containing email detection (redact)
Enable Presets: Policies can be enabled through admin UI or directly in Redis configuration.

Terminal Chat

Interactive WebSocket-powered terminal for real-time AI conversations with built-in security monitoring. Perfect for testing, development, and administrative tasks.

Features

  • Real-time WebSocket Connection: Instant bidirectional communication
  • Multi-Model Support: Switch between OpenAI, Claude, and Perplexity models
  • Live Policy Monitoring: See security decisions in real-time
  • Request Tracing: Full trace IDs for every interaction
  • Admin Access: Requires proper authentication for security

WebSocket Endpoint

ws://your-proxy-host/api/terminal
Authentication: x-api-key header or admin credentials

Message Format

{
  "type": "chat",
  "model": "gpt-4o",
  "message": "Analyze this data: john@company.com",
  "timestamp": "2024-01-15T10:30:00Z"
}

Use Cases

Scenario Description Benefit
Policy Testing Test security rules with real AI responses Immediate feedback on policy effectiveness
Model Comparison Try same prompt across different AI models Choose the best model for your needs
Development Testing Quick testing without building full integration Faster development cycles
Admin Monitoring Real-time oversight of AI interactions Immediate security insights
Security Note: Terminal chat sessions are fully logged and traced like all other API interactions.

Public Chat

Configurable public-facing AI chat interface with enhanced security controls. Perfect for customer-facing applications, educational environments, and public demos.

Features

  • Enhanced Security: Additional filtering for public-facing use
  • Customizable Policies: Specific rule sets for public interactions
  • Rate Limiting: Built-in protection against abuse
  • Content Filtering: Extra safeguards for inappropriate content
  • Easy Integration: Simple API for web and mobile apps

Public Chat Endpoint

POST /api/public-chat
x-public-chat: true
Content-Type: application/json

Request Format

{
  "message": "What can you help me with?",
  "sessionId": "user_session_123",
  "model": "gpt-3.5-turbo"
}

Security Enhancements

Feature Description Purpose
Content Filtering Extra screening for inappropriate requests Protect public-facing reputation
Rate Limiting Stricter limits for anonymous users Prevent abuse and spam
Response Sanitization Additional filtering of AI responses Ensure appropriate public content
Session Tracking Track conversations without user accounts Abuse detection and prevention

Configuration Options

  • Allowed Models: Restrict which AI models public users can access
  • Content Policies: Apply stricter filtering rules for public use
  • Rate Limits: Configure request limits per session/IP
  • Response Length: Limit response sizes for public interactions
  • Logging Level: Control what information is logged for public chats
Production Tip: Always test public chat configurations thoroughly before enabling for external users.

Request Tracing

Comprehensive request tracing provides complete audit trails for every interaction, enabling monitoring, debugging, and compliance reporting.

Trace Lifecycle

1. REQUEST_RECEIVED    - Initial request capture with headers/body
2. PRE_DECISION        - Prompt policy evaluation results
3. PROVIDER_REQUEST    - Forwarding to AI provider
4. PROVIDER_RESPONSE   - Response from AI provider
5. POST_DECISION       - Response policy evaluation
6. RESPONSE_SENT       - Final response to client

Trace Metadata

Each trace includes comprehensive metadata for filtering and analysis:

{
  "traceId": "req_abc123def456",
  "metadata": {
    "apiKeyName": "Production API Key",
    "organizationId": "org_company123",
    "model": "gpt-4",
    "provider": "openai",
    "providerKeyName": "OpenAI Production Key",
    "promptContent": "Analyze this data: john@company.com...",
    "status": 200,
    "responseContent": "I can analyze the email [REDACTED]..."
  },
  "events": [
    {
      "timestamp": "2024-01-15T10:30:00.123Z",
      "event": "REQUEST_RECEIVED",
      "data": {
        "method": "POST",
        "path": "/v1/chat/completions",
        "userAgent": "openai-python/1.2.3",
        "curlCommand": "curl -X POST..."
      }
    }
  ]
}

Admin UI Trace Viewer

  • Real-time Updates: WebSocket-powered live trace monitoring
  • Advanced Filtering: By API key, organization, model, or time range
  • Detailed Drill-down: Expand any event for full request/response details
  • Export Capabilities: PDF, CSV, and JSON export for compliance
  • Policy Insights: Visual indication of triggered rules and actions

Compliance Features

Feature Description Compliance Value
Immutable Logs Trace events cannot be modified after creation Audit trail integrity
Complete Coverage Every request gets traced, no exceptions Full visibility requirement
Policy Decisions Record of all security actions taken Compliance reporting
Performance Metrics Timing data for all processing stages SLA monitoring
Retention: Trace data retention is configurable based on compliance requirements.

Authentication

Natural Language Firewall uses API key-based authentication with role-based access control and provider key management.

API Keys

You need two keys to use Unseen Networks:

Key Type Header Purpose Example
Provider Key Authorization Your OpenAI/Anthropic/etc. API key Bearer sk-...
Unseen Networks Key x-api-key Your Unseen Networks API key un_live_...
Security Note: Never expose your API keys in client-side code. Always make AI calls from your backend servers.

Key Management

Manage your API keys through the dashboard:

  • Create Keys: Generate new keys for different environments
  • Rotate Keys: Regularly rotate keys for security
  • Monitor Usage: Track which keys are being used
  • Revoke Keys: Instantly deactivate compromised keys

Environment Variables

Store your keys securely using environment variables:

# .env file
OPENAI_API_KEY=sk-your-openai-key-here
UNSEENNETWORKS_API_KEY=un_live_your-api-key-here
UNSEENNETWORKS_BASE_URL=https://acmecorp.unseennetworks.ai/v1
// Use in your application
const openai = new OpenAI({
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: process.env.UNSEENNETWORKS_BASE_URL,
    defaultHeaders: {
        'x-api-key': process.env.UNSEENNETWORKS_API_KEY
    }
});

REST API Reference

The Natural Language Firewall provides a REST API that mirrors your AI provider's API while adding comprehensive security protection.

Base URLs

Hosting Type Base URL Format Example
Cloud (Organization) https://[organization].unseennetworks.ai https://acmecorp.unseennetworks.ai
Self-Hosted https://[your-domain-or-ip] https://ai-proxy.yourcompany.com
Organization Setup: Your organization subdomain is provided during onboarding. Contact support@unseennetworks.ai for setup assistance.

Chat Completions

Protected chat completions endpoint compatible with OpenAI API:

POST /v1/chat/completions
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_PROVIDER_KEY
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
  "model": "gpt-4",
  "messages": [
    {
      "role": "user",
      "content": "Hello, world!"
    }
  ],
  "max_tokens": 100,
  "temperature": 0.7
}

Response Format

Unseen Networks returns the same response format as your AI provider, plus security headers:

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "gpt-4",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}

Security Headers

Additional headers in Unseen Networks responses:

Header Description Example
X-Firewall-Protected Indicates request was processed true
X-Firewall-Templates Applied security templates gdpr,injection_defense
X-Firewall-Threats Number of threats detected 0
X-Firewall-Latency Processing latency in ms 12ms

Error Handling

Unseen Networks returns HTTP status codes to indicate success or failure:

Status Code Description Action
200 Success Request processed successfully
400 Bad Request Check request format
401 Unauthorized Check API keys
403 Threat Detected Request blocked by security rules
429 Rate Limited Reduce request rate
500 Server Error Contact support

SDKs & Libraries

Use Unseen Networks with your existing code by updating the configuration of popular AI SDKs.

Official SDKs

Unseen Networks works seamlessly with official SDKs from AI providers:

Zero Code Changes: Just update the base URL and add headers. Your existing code continues to work.

OpenAI Python SDK

import openai

# Standard configuration
client = openai.OpenAI(
    api_key="YOUR_OPENAI_KEY",
    base_url="https://acmecorp.unseennetworks.ai/v1",
    default_headers={
        "x-api-key": "YOUR_API_KEY"
    }
)

# All existing methods work unchanged
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)

OpenAI Node.js SDK

import OpenAI from 'openai';

const openai = new OpenAI({
    apiKey: 'YOUR_OPENAI_KEY',
    baseURL: 'https://acmecorp.unseennetworks.ai/v1',
    defaultHeaders: {
        'x-api-key': 'YOUR_API_KEY'
    }
});

// Use all features normally
const stream = await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{role: 'user', content: 'Hello!'}],
    stream: true
});

for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

Anthropic Python SDK

import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_ANTHROPIC_KEY",
    base_url="https://acmecorp.unseennetworks.ai",
    default_headers={
        "x-api-key": "YOUR_API_KEY"
    }
)

message = client.messages.create(
    model="claude-3-opus-20240229",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude!"}
    ]
)

Framework Integration

LangChain

from langchain.llms import OpenAI
from langchain.chat_models import ChatOpenAI

# Configure LangChain to use Unseen Networks
llm = ChatOpenAI(
    model_name="gpt-4",
    openai_api_base="https://acmecorp.unseennetworks.ai/v1",
    openai_api_key="YOUR_OPENAI_KEY",
    headers={"x-api-key": "YOUR_API_KEY"}
)

# Use LangChain normally - now with Unseen Networks protection
response = llm.predict("What is machine learning?")

LlamaIndex

import openai
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader

# Configure OpenAI for LlamaIndex
openai.api_base = "https://acmecorp.unseennetworks.ai/v1"
openai.api_key = "YOUR_OPENAI_KEY"
openai.default_headers = {"x-api-key": "YOUR_API_KEY"}

# LlamaIndex will now use Unseen Networks automatically
documents = SimpleDirectoryReader('data').load_data()
index = GPTSimpleVectorIndex.from_documents(documents)

HTTP Clients

Use Unseen Networks with any HTTP client library:

cURL

curl https://acmecorp.unseennetworks.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_OPENAI_KEY" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Hello!"}],
    "max_tokens": 100
  }'

Requests (Python)

import requests

response = requests.post(
    "https://acmecorp.unseennetworks.ai/v1/chat/completions",
    headers={
        "Authorization": "Bearer YOUR_OPENAI_KEY",
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "model": "gpt-4",
        "messages": [{"role": "user", "content": "Hello!"}],
        "max_tokens": 100
    }
)

Webhooks

Get real-time notifications about security events, threats, and system status through webhooks.

Event Types

Unseen Networks can send webhooks for these event types:

Event Type Description Frequency
threat.detected Security threat blocked Real-time
request.processed Request successfully processed Optional
quota.warning Approaching usage limits Daily
compliance.violation Compliance rule triggered Real-time

Webhook Payload

Example webhook payload for a threat detection:

{
  "id": "evt_1234567890",
  "type": "threat.detected",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "threat_type": "prompt_injection",
    "severity": "high",
    "request_id": "req_abcdef123456",
    "user_id": "user_789",
    "blocked": true,
    "pattern_matched": "ignore previous instructions",
    "template_triggered": "injection_defense"
  }
}

Setting Up Webhooks

Configure webhooks through the dashboard or API:

POST /v1/webhooks
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "url": "https://your-app.com/webhooks/firewall",
  "events": ["threat.detected", "compliance.violation"],
  "active": true,
  "secret": "your-webhook-secret"
}

Webhook Security

Verify webhook authenticity using HMAC signatures:

import hmac
import hashlib

def verify_webhook(payload, signature, secret):
    expected = hmac.new(
        secret.encode('utf-8'),
        payload.encode('utf-8'),
        hashlib.sha256
    ).hexdigest()
    
    return hmac.compare_digest(
        signature,
        f"sha256={expected}"
    )

Compliance Templates

Pre-built templates provide instant compliance with major regulations and standards.

Available Templates

GDPR Template

Comprehensive GDPR compliance covering all major articles:

  • PII Detection: Automatic detection of 25+ PII types
  • Data Minimization: Enforce minimal data collection
  • Right to Erasure: Automatic data deletion workflows
  • Consent Tracking: Monitor and log consent status
  • Breach Notification: Automatic alerts for data exposure
{
  "template": "gdpr",
  "config": {
    "pii_detection": {
      "enabled": true,
      "sensitivity": "high",
      "redaction_method": "hash"
    },
    "data_minimization": {
      "enabled": true,
      "retention_period": "2_years"
    },
    "consent_tracking": true,
    "breach_alerts": true
  }
}

HIPAA Template

Healthcare-specific protections for PHI (Protected Health Information):

  • PHI Detection: All 18 HIPAA identifiers
  • De-identification: Safe Harbor and Expert Determination
  • Audit Trails: Complete access logging
  • Business Associate Controls: Third-party data sharing rules

SOC 2 Template

Trust Service Criteria compliance for service organizations:

  • Security: Access controls and monitoring
  • Availability: System performance monitoring
  • Processing Integrity: Data accuracy validation
  • Confidentiality: Sensitive information protection
  • Privacy: Personal information lifecycle management

Template Configuration

Customize templates to match your specific requirements:

POST /v1/templates/gdpr/configure
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "pii_patterns": {
    "custom_id": "\\b[A-Z]{2}[0-9]{6}\\b",
    "employee_id": "EMP-[0-9]{4}"
  },
  "redaction_rules": {
    "email": "partial", // Shows: j***@example.com
    "phone": "full",    // Shows: [REDACTED]
    "ssn": "hash"       // Shows: [HASH:abc123]
  },
  "exceptions": {
    "admin_users": ["admin@company.com"],
    "whitelisted_domains": ["company.com"]
  }
}

Multi-Template Stacking

Apply multiple templates simultaneously for comprehensive protection:

{
  "templates": [
    {
      "name": "gdpr",
      "priority": 1,
      "config": {...}
    },
    {
      "name": "pii_protection", 
      "priority": 2,
      "config": {...}
    },
    {
      "name": "injection_defense",
      "priority": 3,
      "config": {...}
    }
  ]
}

Custom Rules

Create custom security rules tailored to your specific requirements and industry.

Rule Types

Unseen Networks supports several types of custom rules:

Rule Type Description Use Case
Pattern Rules Regex-based content matching Custom PII, proprietary data formats
Keyword Rules Simple keyword blocking Profanity, competitor names
Semantic Rules AI-powered context analysis Intent detection, topic filtering
Rate Limit Rules Request frequency limits API abuse prevention

Pattern Rules

Use regular expressions to match custom data patterns:

{
  "rule_name": "company_id_protection",
  "type": "pattern",
  "pattern": "\\bCID-[0-9]{6}-[A-Z]{2}\\b",
  "action": "redact",
  "replacement": "[COMPANY_ID]",
  "confidence": 0.95,
  "description": "Detect and redact company IDs"
}

Semantic Rules

AI-powered rules that understand context and meaning:

{
  "rule_name": "financial_advice_block",
  "type": "semantic",
  "intent": "financial_advice",
  "keywords": ["investment", "stock", "trading", "financial"],
  "context_required": true,
  "action": "block",
  "message": "Financial advice requests are not permitted",
  "confidence_threshold": 0.8
}

Rule Actions

Define what happens when a rule is triggered:

  • Block: Stop the request and return an error
  • Redact: Remove or mask the detected content
  • Log: Record the event but allow the request
  • Alert: Send a notification but continue processing
  • Transform: Modify the content before forwarding

Rule Testing

Test your custom rules before deployment:

POST /v1/rules/test
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "rule": {
    "type": "pattern",
    "pattern": "\\b[A-Z]{2}[0-9]{6}\\b"
  },
  "test_cases": [
    "My ID is AB123456",
    "Reference number: XY789012", 
    "No sensitive data here"
  ]
}
Best Practice: Always test rules with real data samples to ensure they work as expected without false positives.

Visual Rule Builder

Create and manage custom security rules using our intuitive visual interface.

Rule Builder Interface

The visual rule builder allows you to create complex security rules without writing code:

  • Drag & Drop Components: Build rules by connecting visual components
  • Real-time Testing: Test rules against sample data as you build
  • Template Integration: Combine custom rules with compliance templates
  • Version Control: Track changes and roll back to previous versions

Rule Components

Component Function Use Case
Pattern Matcher Regex-based content detection Custom data formats, IDs
Keyword Filter Simple word/phrase blocking Profanity, competitor names
Context Analyzer AI-powered intent detection Topic filtering, sentiment
Rate Limiter Request frequency controls Abuse prevention

Rule Actions

Configure what happens when your rule is triggered:

{
  "rule": {
    "name": "financial_advice_blocker",
    "trigger": {
      "type": "semantic",
      "keywords": ["investment", "trading", "stock"],
      "confidence": 0.8
    },
    "action": {
      "type": "block",
      "message": "Financial advice requests are not permitted",
      "log_level": "warning"
    }
  }
}
Pro Tip: Use the test environment to validate your rules with real data before deploying to production.

Analytics & Reporting

Comprehensive analytics and reporting capabilities for security, compliance, and performance monitoring.

Dashboard Overview

The analytics dashboard provides real-time insights into your AI security posture:

  • Security Metrics: Threat detection rates, blocked attacks, false positives
  • Usage Analytics: Request volume, response times, error rates
  • Compliance Status: Template effectiveness, violation tracking
  • Cost Analysis: Usage costs, optimization recommendations

Key Metrics

Metric Description Alert Threshold
Threat Detection Rate % of malicious requests blocked < 95%
False Positive Rate % of legitimate requests blocked > 2%
Response Latency Average processing time > 100ms
PII Detection Accuracy % of PII correctly identified < 98%

Custom Reports

Generate detailed reports for compliance audits and security reviews:

GET /v1/analytics/reports?type=security&period=monthly
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_API_KEY

# Response includes:
{
  "report_id": "rpt_123456",
  "type": "security_summary",
  "period": "2024-01",
  "data": {
    "total_requests": 1234567,
    "threats_detected": 1234,
    "threats_blocked": 1230,
    "top_attack_vectors": [...],
    "compliance_violations": 12,
    "recommendations": [...]
  }
}

Data Export

Export analytics data in multiple formats:

  • CSV: Raw data for spreadsheet analysis
  • JSON: Programmatic access and integration
  • PDF: Executive summaries and compliance reports
  • API: Real-time data streaming for SIEM integration

Monitoring & Analytics

Comprehensive monitoring and analytics to track AI usage, security events, and system performance.

Dashboard Overview

The Unseen Networks dashboard provides real-time insights into your AI security posture:

  • Threat Detection: Live feed of security events and blocked threats
  • Usage Analytics: API call volume, success rates, and performance metrics
  • Compliance Status: Template effectiveness and regulatory compliance tracking
  • Cost Analysis: Usage costs and optimization recommendations

Metrics & KPIs

Key metrics tracked by Unseen Networks:

Metric Description Calculation
Threat Detection Rate % of malicious requests blocked Blocked threats / Total threats
False Positive Rate % of legitimate requests blocked False positives / Total requests
Latency Impact Additional processing time Firewall latency - Direct latency
PII Detection Rate % of PII successfully identified Detected PII / Actual PII

Custom Alerts

Set up custom alerts for important security events:

{
  "alert_name": "high_threat_activity",
  "conditions": {
    "threat_count": {
      "operator": "greater_than",
      "value": 10,
      "timeframe": "5_minutes"
    },
    "threat_types": ["prompt_injection", "jailbreak"]
  },
  "actions": [
    {
      "type": "email",
      "recipients": ["security@company.com"]
    },
    {
      "type": "webhook", 
      "url": "https://your-app.com/security-alert"
    }
  ]
}

Reporting

Generate detailed reports for compliance and security review:

  • Security Summary: Weekly/monthly threat activity reports
  • Compliance Report: Template effectiveness and coverage analysis
  • Usage Report: API consumption patterns and cost breakdown
  • Performance Report: System performance and availability metrics
GET /v1/reports/security?period=monthly&format=pdf
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_API_KEY

# Returns PDF report with:
# - Threat landscape analysis
# - Top attack vectors
# - Blocked vs allowed requests
# - Compliance violations
# - Recommendations

Troubleshooting

Common issues and solutions when integrating Unseen Networks.

Common Issues

401 Unauthorized Error

Error: HTTP 401 - Invalid API key

Causes & Solutions:

  • Missing API Key: Ensure x-api-key header is included
  • Invalid Provider Key: Check your OpenAI/Anthropic API key is valid
  • Expired Keys: Rotate expired keys in the dashboard
  • Wrong Environment: Ensure you're using the correct API endpoint

403 Forbidden - Threat Detected

Error: HTTP 403 - Request blocked by security policy

Solutions:

  • Review Request: Check if content contains potential threats
  • Adjust Templates: Fine-tune sensitivity settings
  • Add Exceptions: Whitelist legitimate use cases
  • Contact Support: Report false positives for improvement

High Latency

Issue: Requests taking longer than expected

Optimization Tips:

  • Use Regional Endpoints: Connect to the nearest data center
  • Optimize Templates: Disable unused security templates
  • Batch Requests: Use batch API for multiple requests
  • Check Network: Verify network connectivity and DNS resolution

Debug Mode

Enable debug mode for detailed request/response logging:

POST /v1/chat/completions
Host: acmecorp.unseennetworks.ai
Authorization: Bearer YOUR_PROVIDER_KEY
x-api-key: YOUR_API_KEY
X-Firewall-Debug: true
Content-Type: application/json

Debug mode returns additional headers:

  • X-Firewall-Debug-ID - Unique request ID for support
  • X-Firewall-Rules-Applied - List of triggered rules
  • X-Firewall-Processing-Time - Detailed timing breakdown

Health Check

Verify Unseen Networks service status:

GET /v1/health
Host: acmecorp.unseennetworks.ai

# Response:
{
  "status": "healthy",
  "version": "2.1.0",
  "uptime": "99.99%",
  "latency_p95": "45ms",
  "templates": {
    "gdpr": "active",
    "hipaa": "active", 
    "injection_defense": "active"
  }
}

Support Resources

Get help when you need it:

Pro Tip: Include the X-Firewall-Debug-ID header value when contacting support for faster resolution.

Admin Interface Previews

Visual previews of the Natural Language Firewall admin interface for dashboard monitoring, request tracing, and terminal chat.

Dashboard Overview

The main dashboard provides real-time metrics and system status at a glance.

Dashboard

Last updated: 2 minutes ago
Total Requests
12,847
+18.2% from last week
Policy Blocks
234
-5.3% from last week
Active API Keys
47
+2 this week
Avg Response Time
324ms
-12ms from last week

Request Trace Viewer

Real-time monitoring of all API requests with detailed trace information and policy decisions.

Recent Request Traces

req_2aB9Xx3mP1nK4vQ7
POST /v1/chat/completions
200 324ms
req_8zR5Kk1wN7xT9mL2
POST /v1/chat/completions
400 89ms
req_5dF3Jj8uM2qY6kP1
GET /v1/models
200 56ms

Terminal Chat Interface

Interactive WebSocket-powered terminal for real-time AI conversations with security monitoring.

Terminal Chat - GPT-4o
[15:42:18] User: Analyze this email: john.doe@company.com - urgent financial data
[15:42:19] Policy Decision: Email address detected and redacted
[15:42:21] Assistant: I can help analyze your email regarding [REDACTED] - urgent financial data. What specific aspects would you like me to focus on?
[15:42:21] Trace ID: req_terminal_9x3K2mP8
â–Š

API Reference (OpenAPI/Swagger)

Complete OpenAPI 3.0 specification for the Natural Language Firewall REST API with interactive examples.

POST /v1/chat/completions

Create a chat completion - Main endpoint for AI conversations with security processing

Request Headers
Authorization
string (required)

Your AI provider API key (OpenAI, Anthropic, etc.)

x-api-key
string (required)

Your Natural Language Firewall API key for authentication

Request Body
{ "model": "gpt-4o", "messages": [ { "role": "user", "content": "Hello, analyze this data for me." } ], "temperature": 0.7, "max_tokens": 1000 }
Response (200 OK)
{ "id": "chatcmpl-1234567890", "object": "chat.completion", "created": 1640995200, "model": "gpt-4o", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "I'd be happy to help analyze your data. Could you please provide more specific details about what type of analysis you need?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 25, "total_tokens": 37 }, "ai_proxy": { "traceId": "req_2aB9Xx3mP1nK4vQ7", "policy_decisions": { "prompt": { "action": "allow", "rules_triggered": 0 }, "completion": { "action": "allow", "rules_triggered": 0 } }, "redacted": false } }
Response (400 Policy Violation)
{ "error": { "message": "Request blocked by content policy", "type": "policy_violation", "param": "messages", "code": "content_blocked", "details": { "action": "block", "reasons": ["PII detected: email address"] } }, "ai_proxy": { "traceId": "req_8zR5Kk1wN7xT9mL2" } }
GET /v1/models

List available models - Get all supported AI models across providers

Request Headers
x-api-key
string (required)

Your Natural Language Firewall API key for authentication

Response (200 OK)
{ "object": "list", "data": [ { "id": "gpt-4o", "object": "model", "provider": "openai", "created": 1640995200 }, { "id": "gpt-4o-mini", "object": "model", "provider": "openai", "created": 1640995200 }, { "id": "claude-3-5-sonnet-20241022", "object": "model", "provider": "anthropic", "created": 1640995200 }, { "id": "llama-3.1-sonar-large-128k-online", "object": "model", "provider": "perplexity", "created": 1640995200 } ] }
GET /health

Health check - Verify API service status and connectivity

Response (200 OK)
{ "status": "ok", "timestamp": "2024-01-15T10:30:00.000Z", "version": "1.0.0", "traceId": "req_health_5dF3Jj8u" }
Interactive API Explorer: Use tools like Postman, curl, or our upcoming interactive API explorer to test these endpoints.