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

# Configure Guardrails

> Detailed configuration options for Dome Guards and Detectors.

Dome's configuration system lets you precisely control which Guards run, how they execute, and what Detectors they use. This guide covers all configuration options.

## Configuration Hierarchy

Dome organizes protection in three levels:

```
Guardrail (input/output)
    └── Guard (security, moderation, privacy)
            └── Detector (specific detection method)
```

Each level has its own configuration options that can be customized.

## Guardrail Configuration

### Guardrail Options

| Option                | Type    | Default | Description                   |
| --------------------- | ------- | ------- | ----------------------------- |
| `input-guards`        | List    | \[]     | Guards to run on input        |
| `output-guards`       | List    | \[]     | Guards to run on output       |
| `input-early-exit`    | Boolean | True    | Stop on first input flag      |
| `input-run-parallel`  | Boolean | False   | Run input Guards in parallel  |
| `output-early-exit`   | Boolean | True    | Stop on first output flag     |
| `output-run-parallel` | Boolean | False   | Run output Guards in parallel |

### Execution Modes

* **Early Exit (default)**: Stops processing when the first Guard flags content. Faster for rejecting clearly malicious input.

* **Complete Execution**: Runs all Guards regardless of flags. Useful for comprehensive logging.

**Parallel Execution**: Runs Guards simultaneously for lower latency.

## Guard Configuration

### Guard Types

| Type         | Use Case            | Available Detectors                  |
| ------------ | ------------------- | ------------------------------------ |
| `security`   | Adversarial attacks | Prompt injection, encoding detection |
| `moderation` | Harmful content     | Toxicity, profanity, hate speech     |
| `privacy`    | Sensitive data      | PII detection, secrets               |
| `integrity`  | Data quality        | Format validation (experimental)     |
| `generic`    | Custom logic        | User-defined Detectors               |

### Guard Options

| Option             | Type    | Default  | Description                 |
| ------------------ | ------- | -------- | --------------------------- |
| `type`             | String  | Required | Guard category              |
| `methods`          | List    | Required | Detectors to use            |
| `early-exit`       | Boolean | True     | Stop on first Detector flag |
| `run-parallel`     | Boolean | False    | Run Detectors in parallel   |
| `blocked-response` | String  | Default  | Custom block message        |

## Detector Configuration

Here are some of the available Detectors:

**Security Detectors:**

| Detector                           | Description             | Options              |
| ---------------------------------- | ----------------------- | -------------------- |
| `prompt-injection-mbert`           | Multilingual BERT model | `threshold`          |
| `prompt-injection-deberta-v3-base` | DeBERTa v3 model        | `threshold`          |
| `encoding-heuristics`              | Base64, Unicode tricks  | None                 |
| `security-embeddings`              | Semantic similarity     | `threshold`, `top_k` |
| `security-llm`                     | LLM-based detection     | `model_name`         |

**Moderation Detectors:**

| Detector                | Description                | Options     |
| ----------------------- | -------------------------- | ----------- |
| `moderation-flashtext`  | Fast keyword matching      | `wordlist`  |
| `moderation-deberta`    | Neural toxicity classifier | `threshold` |
| `moderations-oai-api`   | OpenAI Moderation API      | None        |
| `moderation-llamaguard` | Llama Guard model          | `threshold` |

**Privacy Detectors:**

| Detector           | Description            | Options                 |
| ------------------ | ---------------------- | ----------------------- |
| `privacy-presidio` | PII entity recognition | `entities`, `threshold` |
| `detect-secrets`   | Credential detection   | None                    |

<Card title="Work in Progress" icon="pickaxe" badge="Private preview">
  The programmatic protection capabilities and Dome integrations are currently in private preview and subject to change.
</Card>

## Next Steps

<CardGroup cols={1}>
  <Card title="Use Guardrails" icon="train-track" href="/developer-guide/protect/using-guardrails">
    Runtime integration patterns
  </Card>

  <Card title="Custom Detectors" icon="wrench" href="/developer-guide/protect/custom-detectors">
    Build your own Detectors
  </Card>

  <Card title="Observability" icon="eye" href="/developer-guide/protect/observability">
    Monitoring and tracing
  </Card>
</CardGroup>
