Skip to content

Welcome to Defense API

Defense API is a security solution designed to protect LLMs, i.e. AI Agents, API endpoints from malicious attacks and unauthorized access. It acts as a protective layer between your applications and AI services, providing enhanced security without changing your existing code.

What is Defense API?

Defense API helps organizations secure their AI API integrations by providing:

  • API Endpoint Protection: Secure your LLM endpoints in agentic workflows.
  • Request Filtering: Block malicious requests before they reach your AI services
  • Access Control: Manage and monitor API access across your organization
  • Attack Prevention: Protect against prompt injection and other AI-specific attacks

How It Works

Simple Integration

Defense API works by simply changing your API endpoint URL and key - no code changes required. Defense API is fully compatible with all common APIs from providers like OpenAI, Mistral, and Anthropic.

Denfense API Integration

Replace your direct API calls with Defense API's protected endpoint

Quick Setup

Integrating Defense API is incredibly simple! Just configure your LLM Firewall at app.dapi.smart-labs.ai and update two configuration values:

Before (Direct OpenAI):

from openai import OpenAI

client = OpenAI(
    api_key="sk-your-openai-key"
)

response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[{"role": "user", "content": "Hello, world!"}]
)

After (Protected with Defense API):

from openai import OpenAI

client = OpenAI(
    api_key="defense-api-your-proxy-key"
    base_url="your-defense-api-proxy-url"
)

response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[{"role": "user", "content": "Hello, world!"}]
)

That's it! Your API calls are now protected through Defense API. Configure your proxy endpoint and get your Defense API key from our website dashboard. And it works not only with OpenAI but also with many other API-compatible service. Check it out now!

Real-World Protection

Consider this scenario: An AI agent with web search capabilities visits a malicious website that attempts to inject harmful prompts. Our latest research demonstrates how these exploits can compromise sensitive data, but with Defense API you can protect your sensitive data from such exploits.

Attack Prevention

Defense API blocks malicious prompt injections from compromised web sources

Key Benefits

  • Zero Code Changes: Drop-in replacement for existing API integrations
  • Real-time Protection: Monitor and block threats as they happen
  • Enterprise Ready: Scalable security for production environments
  • OpenAI Compatible: Works with any OpenAI API-compatible service

Getting Started

Ready to secure your AI APIs? Check out our Get-started guide to begin protecting your endpoints in minutes.

For more information, visit our website.