Skip to main content

Installation

KoreShield can be used in two ways: as a standalone proxy (recommended for production) or as an SDK integrated directly into your application code.
The standalone proxy sits between your application and LLM providers. This is the most secure deployment method as it operates independently of your application logic.

Installation Methods

1

Choose Your Deployment Method

Select between Proxy Mode (recommended for production) or SDK Mode (for direct integration)
2

Install Dependencies

Install Docker for proxy deployment or install the SDK for your programming language
3

Configure Environment

Set up your API keys and configuration settings
4

Verify Installation

Test that KoreShield is working correctly

1. Proxy Installation (Docker)

The standalone proxy sits between your application and LLM providers, providing the most secure deployment method.
1

Pull the Docker Image

Download the official KoreShield Docker image:
docker pull Koreshield/Koreshield
2

Run the Container

Start the KoreShield proxy service:
docker run -p 8000:8000 Koreshield/Koreshield
The proxy will be available at http://localhost:8000
For production deployments, make sure to configure environment variables for your LLM provider API keys.

System Requirements (Proxy)

Docker

Engine 20.10 or higher

Memory

512MB minimum recommended

Network

Outbound HTTPS access to LLM providers

2. SDK Installation

The SDKs allow you to integrate KoreShield features (sanitization, scanning) directly into your codebase or interact with a deployed KoreShield Proxy.

Install Python SDK

Install the KoreShield Python package using pip:
pip install Koreshield

Verify Installation

Check that the Python SDK has been installed successfully:
python -c "import Koreshield; print(Koreshield.__version__)"

Basic Usage

from Koreshield import KoreshieldClient

# Connect to your KoreShield proxy
client = KoreshieldClient(base_url="http://localhost:8000")

# Scan a prompt for security threats
result = client.scan_prompt("Hello, how are you?")

if result.is_safe:
    print("Prompt is safe to send to LLM")
else:
    print(f"Threat detected: {result.threat_type}")

Quick Start with Docker Compose

For a complete setup with environment variables and configuration:
docker-compose.yml
version: '3.8'

services:
  koreshield:
    image: Koreshield/Koreshield:latest
    ports:
      - "8000:8000"
    environment:
      - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - KORESHIELD_API_KEY=${KORESHIELD_API_KEY}
      - SECURITY_SENSITIVITY=medium
      - DEFAULT_ACTION=block
    restart: unless-stopped
Run with:
docker-compose up -d

Environment Configuration

Never commit API keys to version control. Always use environment variables or secrets management.
Configure KoreShield using environment variables:
VariableDescriptionRequired
DEEPSEEK_API_KEYYour DeepSeek API keyOptional
OPENAI_API_KEYYour OpenAI API keyOptional
ANTHROPIC_API_KEYYour Anthropic API keyOptional
KORESHIELD_API_KEYAPI key to protect KoreShield proxyRecommended
SECURITY_SENSITIVITYSecurity level: low, medium, or highOptional (default: medium)
DEFAULT_ACTIONDefault action: block, warn, or allowOptional (default: block)

Deployment Options

Docker

Deploy with Docker containers

Kubernetes

Deploy on Kubernetes clusters

AWS

Deploy on Amazon Web Services

Railway

One-click Railway deployment

Next Steps

Quick Start

Secure your first LLM integration with a complete working example

Configuration

Configure security policies and customize KoreShield behavior

Build docs developers (and LLMs) love