> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# Configuring YAML File

> Define models, guardrails, prompts, and tracing settings in the config.yml file.

This section describes the `config.yml` file schema used to configure the NeMo Guardrails library.
The `config.yml` file is the primary configuration file for defining LLM models, guardrails behavior, prompts, knowledge base settings, and tracing options.

## Overview

The following is a complete schema for a `config.yml` file:

```yaml
# LLM model configuration
models:
  - type: main
    engine: openai
    model: gpt-4o

# Instructions for the LLM (similar to system prompts)
instructions:
  - type: general
    content: |
      You are a helpful AI assistant.

# Guardrails configuration
rails:
  input:
    flows:
      - self check input
  output:
    flows:
      - self check output
  ... # Other rail configurations

# Prompt customization
prompts:
  - task: self_check_input
    content: |
      Your task is to check if the user message complies with policy.

# Knowledge base settings
knowledge_base:
  embedding_search_provider:
    name: default

# Tracing and monitoring
tracing:
  enabled: true
  adapters:
    - name: FileSystem
      filepath: "./logs/traces.jsonl"
```

## Configuration YAML Schema Reference

For a complete, consolidated reference of all configuration options, see the [YAML Schema Reference](/configure-guardrails/configuration-reference).

## Configuration Sections

The following sections provide detailed documentation for each configuration section of the overall `config.yml` file:

Configure LLM engines, embedding models, and task-specific models in config.yml.

Reference

Configure input, output, dialog, retrieval, and execution rails in config.yml to control LLM behavior.

Reference

Customize prompts for self-check, fact-checking, and intent generation tasks.

Reference

Configure FileSystem and OpenTelemetry tracing adapters to monitor guardrails.

Reference

Configure streaming for LLM token generation and output rail processing in config.yml.

Reference

## File Organization

Configuration files should be organized in a `config` folder with the following structure:

```text
.
├── config
│   ├── config.yml        # Main configuration file
│   ├── prompts.yml       # Custom prompts (optional)
│   ├── rails/            # Colang flow definitions (optional)
│   │   ├── input.co
│   │   ├── output.co
│   │   └── ...
│   ├── kb/               # Knowledge base documents (optional)
│   │   ├── doc1.md
│   │   └── ...
│   ├── actions.py        # Custom actions (optional)
│   └── config.py         # Custom initialization (optional)
```