> ## Documentation Index
> Fetch the complete documentation index at: https://docs.continum.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> Understanding Continum's distributed compliance architecture

## System Overview

Continum uses a distributed architecture to achieve zero-latency compliance monitoring. The system is designed around the principle of "sovereignty-first" - your API keys stay on your server, and compliance runs asynchronously.

```
Your Application (SDK)
      │
      ├─→ [Direct] → OpenAI/Claude/Gemini → Response (instant) ⚡
      │
      └─→ [Async] → Continum Platform
                        ↓
                    Compliance Monitoring
                        ↓
                    Evidence & Signals
                        ↓
                    Dashboard
```

## How It Works

### 1. SDK Integration

The Continum SDK integrates into your application and manages:

1. **Direct LLM Calls**: Your application calls LLM providers directly using your API keys
2. **Guardian Protection**: Optional pre-LLM detection and redaction (\< 100ms)
3. **Async Monitoring**: Sends interaction details to Continum for compliance checking (non-blocking)

**Key insight**: The SDK never waits for compliance results before returning the LLM response to your users.

### 2. Continum Platform

The Continum Platform provides:

* Account and API key management
* Monitoring configuration (sandboxes)
* Compliance signal storage
* Evidence generation
* Dashboard access

### 3. Compliance Monitoring

Your interactions are monitored for compliance:

* Analyzes prompts and responses for violations
* Applies your configured monitoring rules
* Generates risk assessments and violation reports
* Creates cryptographically-signed evidence records

**Privacy**: Each monitoring check runs in isolation with no data retention beyond compliance signals.

### 4. Dashboard & Evidence

Access your compliance data:

* Real-time signal viewing
* Risk level breakdown
* Incident management
* Evidence package generation
* Regulatory attestations

## Data Flow

### 1. LLM Call with Monitoring

```typescript theme={null}
import { protect } from '@continum/sdk';
import OpenAI from 'openai';

const openai = new OpenAI();

const response = await protect(
  () => openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{ role: 'user', content: 'Hello' }]
  }),
  {
    apiKey: process.env.CONTINUM_API_KEY!
  },
  {
    preset: 'customer-support'
  }
);
```

**What happens**:

1. SDK calls OpenAI directly → response in \~500ms
2. SDK returns response to your app immediately
3. SDK sends interaction to Continum for monitoring (non-blocking)

### 2. Compliance Monitoring

Your interaction is monitored asynchronously:

1. Continum receives interaction details
2. Applies your monitoring configuration
3. Analyzes for compliance violations
4. Generates risk assessment
5. Creates compliance signal

### 3. Evidence Creation

Compliance signals become evidence:

1. Signal cryptographically signed
2. Linked to previous signals (hash chain)
3. Mapped to regulatory requirements
4. Available in dashboard
5. Included in evidence packages

### 4. Access & Reporting

View and use your compliance evidence:

* Dashboard: Real-time signal viewing
* API: Programmatic access
* Evidence Packages: Audit-ready reports
* Auditor Access: External auditor tokens

## Security & Privacy

### Your Data Sovereignty

* **Your API Keys**: Never leave your server - stored only in your environment
* **Direct LLM Calls**: Your application calls LLM providers directly
* **Monitoring Data**: Only interaction details sent to Continum for compliance checking
* **No Data Storage**: Continum stores only compliance signals, not your full data

### Compliance Evidence Security

* **Cryptographic Integrity**: Every signal linked in tamper-proof hash chain
* **Encrypted Storage**: Military-grade encryption for all compliance data
* **Access Controls**: Role-based access with audit logging
* **Auditor Tokens**: Time-limited, permission-scoped external access

### Regulatory Compliance

Continum itself adheres to:

* SOC 2 Type II compliance
* GDPR data protection requirements
* CCPA privacy standards
* Industry-standard encryption (AES-256)

## Performance

### User Experience

* **User Latency**: 0ms added (direct LLM call)
* **Guardian**: \< 100ms for pre-LLM detection
* **Monitoring**: 2-5 seconds (async, user doesn't wait)
* **Dashboard**: \< 100ms query response

### Scalability

* **SDK**: Runs on your servers (scales with your app)
* **Platform**: Auto-scales based on traffic
* **Monitoring**: Processes thousands of checks concurrently
* **Dashboard**: Optimized for fast queries

## Integration

### SDK Setup

Install the SDK in your application:

```bash theme={null}
npm install @continum/sdk
```

Configure with your API key:

```typescript theme={null}
import { continum } from '@continum/sdk';

continum.configure({
  apiKey: process.env.CONTINUM_API_KEY!,
  preset: 'customer-support'
});
```

### Environment Variables

**Your Application**:

```bash theme={null}
CONTINUM_API_KEY=ctn_live_xxx
OPENAI_API_KEY=sk-xxx
ANTHROPIC_API_KEY=sk-ant-xxx
GOOGLE_API_KEY=xxx
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Zero Latency" icon="bolt" href="/concepts/zero-latency">
    Learn how zero-latency monitoring works
  </Card>

  <Card title="Presets" icon="shield-check" href="/sdk/presets">
    Understand automatic detection configuration
  </Card>

  <Card title="Evidence" icon="file-certificate" href="/concepts/evidence">
    Transform monitoring into audit-ready evidence
  </Card>

  <Card title="Alerts" icon="bell" href="/sdk/alerts">
    Configure real-time notifications
  </Card>

  <Card title="Signal" icon="signal" href="/concepts/signal">
    Understand monitoring results
  </Card>

  <Card title="Incidents" icon="triangle-exclamation" href="/concepts/incidents">
    Track and resolve compliance incidents
  </Card>
</CardGroup>
