NeMo Guardrailsnemoguardrails 0.24.1 · Python 3.10+
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
37 small wins to finish your pathNext lesson →

Config folder

A config in NeMo Guardrails is the set of files that describe one guarded assistant: config.yml for the model, instructions and rails, and .co files for the Colang rules.

Last updated: 30 Sep, 2026 · NeMo Guardrails 0.24.1

The keyword guard lived inside the application. NeMo moves the rules into files, so they can be read, reviewed and changed without touching Python.

Loading the rails in an app · from the Multi-Modal Intelligence Systems marathon · 90:00 to 92:28

In the clip, the app imports RailsConfig and LLMRails. RailsConfig takes the rules, the Colang content and the YAML content; LLMRails hands those rules to the model. The app builds the config from two strings with RailsConfig.from_content.

Syntax:

python
config = RailsConfig.from_path("config")        # a folder: config.yml + any .co files
config = RailsConfig.from_content(                # or two strings, as in the video
    colang_content=COLANG, yaml_content=YAML)
rails = LLMRails(config)                          # the runtime that applies them

The folder

A config folder holds config.yml and any number of .co files, whose names are yours. Later lessons add config.py for Python the folder needs, and prompts.yml for prompts. This course keeps the files in the current folder and loads it with from_path(".").

text
my_assistant/
  config.yml     # model, instructions, which rails run
  rails.co       # Colang: define user / bot / flow
  main.py        # your code: RailsConfig.from_path(".")

config.yml

The model entry and the video's instructions for the IT assistant. The next two lessons explain each block.

yaml
models:
  - type: main
    engine: openai
    model: openai/gpt-oss-120b
    api_key_env_var: GROQ_API_KEY
    parameters:
      base_url: https://api.groq.com/openai/v1
      temperature: 0

instructions:
  - type: general
    content: |
      You are an Enterprise IT Assistant specialising in Kubernetes,
      Intel hardware, and enterprise networking.
      Only answer questions about these topics.
      Answer in one or two short sentences.

Loading the folder

Example
from nemoguardrails import RailsConfig

config = RailsConfig.from_path(".")
print(config.models[0].engine, config.models[0].model)
print(config.instructions[0].content.splitlines()[0])
print(config.colang_version)

What was loaded

  • The model: engine openai, model openai/gpt-oss-120b.
  • The instructions, read from the YAML block.
  • Colang 1.0, the version this course uses. It is the default when colang_version is not set.

Loading the same config from a string

The video's notebook and app use from_content with YAML and Colang held in Python strings, which is handy in a notebook. The result is the same object.

Example
from nemoguardrails import RailsConfig

YAML_BASE = open("config.yml").read()
config = RailsConfig.from_content(yaml_content=YAML_BASE)
print(config.models[0].model)
print(config.rails.input.flows)

[] is the list of input rails: none yet. The first one arrives in Input rails.

from_path vs from_content

from_pathfrom_content
Rules live inFiles in a folderPython strings
Good forApplications, code review, the serverNotebooks and quick tests
Python actionsconfig.py in the folder loads itselfRegistered by hand

Where each fits

  • A notebook experiment, as the video's notebook builds one config per experiment with from_content.
  • An application or the NeMo server, which reads folders.
Watch out. from_path reads every .yml and .co file in the folder. A stray .co file left from an experiment is loaded too, and its flows run.
Try it yourself
  • Add colang_version: "2.x" to config.yml and print config.colang_version.
  • Rename config.yml to settings.yml and load the folder again.

This is what real progress feels like.