Define and enforce conversational guardrails with NVIDIA NeMo Guardrails using Colang flows

domain: docs.nvidia.com/nemo/guardrails · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install nemoguardrails and create a config directory with a config.yml file that specifies your LLM engine configuration and sets the Colang version (1.0 or 2.x)
  2. Write .co files in the config directory containing Colang flow definitions that handle prohibited intents, such as redirecting off-topic requests or refusing sensitive queries
  3. Define canonical message forms in the .co files for user intents and bot responses that your flows reference
  4. Instantiate RailsConfig.from_path() pointing to your config directory, then create an LLMRails instance from the config
  5. Call rails.generate(messages=[...]) to run a conversation through the guardrails; Colang flows intercept and reroute any matching patterns
  6. Test edge cases by providing adversarial inputs and confirm the guardrail flows trigger the expected bot responses rather than passing through to the LLM

Known gotchas

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans