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

# Configuration

> Configure RAXE for your use case

## Configuration File

RAXE uses YAML configuration at `~/.raxe/config.yaml`:

```yaml theme={null}
# Detection settings
detection:
  l1_enabled: true      # Rule-based detection
  l2_enabled: true      # ML-based detection
  block_on_threat: false # Block threats (vs monitor)

# Telemetry (anonymous detection metadata)
telemetry:
  enabled: true         # Disabling requires Pro+ tier

# Performance
performance:
  mode: balanced        # fast | balanced | thorough
```

## Environment Variables

Override any setting with environment variables:

```bash theme={null}
# Detection
export RAXE_L1_ENABLED=true
export RAXE_L2_ENABLED=true

# Logging
export RAXE_LOG_LEVEL=INFO  # DEBUG, INFO, WARNING, ERROR

# Database
export RAXE_DB_PATH=~/.raxe/raxe.db
```

## Programmatic Configuration

Configure via the SDK:

```python theme={null}
from raxe import Raxe

raxe = Raxe(
    l1_enabled=True,
    l2_enabled=True,
    log_level="DEBUG"
)
```

## Performance Modes

| Approach                      | L1 Rules | L2 ML | Latency         | Use Case                       |
| ----------------------------- | -------- | ----- | --------------- | ------------------------------ |
| `l2_enabled=False`            | All      | Off   | \~5-15ms        | Low-latency sync scanning      |
| Default                       | All      | On    | \~200ms         | Full threat detection          |
| `execution_mode="background"` | All      | On    | \~0.03ms caller | Fire-and-forget (non-blocking) |

```python theme={null}
# L1-only (fast sync scanning)
raxe = Raxe(l2_enabled=False)

# Or use scan_fast() for one-off L1 scans
result = raxe.scan_fast(text)

# Background mode (non-blocking, full L1+L2)
from raxe.sdk.agent_scanner import AgentScannerConfig, create_agent_scanner
scanner = create_agent_scanner(raxe, AgentScannerConfig(execution_mode="background"))
scanner.scan_prompt(text)  # Returns in <1ms, scan runs in background
```

## Telemetry

RAXE collects **anonymous detection metadata** to improve the engine:

**What we collect:**

* Detection counts and severity levels
* Performance metrics (scan latency)
* Rule IDs that triggered
* SHA-256 hash of prompts (not reversible)

**What we NEVER collect:**

* Raw prompts or responses
* Matched text content
* Personal information
* Your API keys

<Note>
  Telemetry is enabled by default in Community Edition.
  Disabling telemetry requires a Pro+ tier license.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Detection Rules" icon="shield" href="/rules/overview">
    Explore detection rules
  </Card>

  <Card title="Policies" icon="file-contract" href="/concepts/policies">
    Configure threat handling
  </Card>
</CardGroup>
