Index of every page on this site: llms.txt
All skills
nvidia-nemo avatar

/guardrails-developer-create-guardrails

@5112cf1
by nvidia-nemonvidia-nemo/guardrails7.5k stars
904
Run it yourself

Helps developers create a NeMo Guardrails configuration for an LLM application. Use when users want to build, scaffold, configure, test, or iterate on input, output, retrieval, dialog, execution, Colang, or catalog-based guardrails. Trigger keywords - create guardrails, build guardrails, scaffold config, write rails, create config.yml, add input rails, add output rails, Colang flow, guardrails config, test guardrails.

Use this Skill: https://skilld.dev/gh/nvidia-nemo/guardrails/guardrails-developer-create-guardrails

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈115 tokens for metadata: the name and description. ≈1.1k when used: this file.

Description uses 5.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈462 characters, or 5.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Create Guardrails

Use this skill when a developer wants help creating a guardrails configuration, not just reading documentation. The goal is to produce a small, working configuration first, then iterate based on the user's risk, model, app, and test cases.

Use guardrails-developer-guide to look up canonical docs when needed. Do not duplicate full docs in this skill.

Documentation Source Rule

When using NVIDIA NeMo Guardrails library documentation, use the Markdown documentation under https://docs.nvidia.com/nemo/guardrails/. Use llms.txt and page URLs ending in .md when loading documentation for agent context. When presenting references or citations to users, use the canonical human-readable docs links without .md.

First Questions

Ask only what you need to choose a starting path:

  1. What kind of application are you guarding?
  2. Which model/provider or framework are you using?
  3. Which risk do you want to handle first?
  4. Do you want a quick catalog-based guardrail, a Colang flow, or a Python integration?

If the user is unsure, recommend starting with the smallest working input/output rail and one concrete test prompt.

Choose The Starting Pattern

User goal Starting pattern
Block harmful content Content safety input/output rails
Restrict topics Topic control or topical rails
Detect jailbreaks Jailbreak protection or heuristics
Mask or detect sensitive data PII detection rails
Reduce hallucinations in RAG Retrieval/output fact-checking rails
Control conversation flow Colang dialog flows
Guard tool calls or actions Execution rails and action validation
Integrate with LangChain or LangGraph RunnableRails, middleware, or documented integration path

Route to the relevant docs page through guardrails-developer-guide before filling in details that depend on the current docs.

Create A Minimal Config

Prefer a standard config folder layout:

config/
  config.yml
  prompts.yml
  rails.co
  actions.py

Only create files that are needed:

  • Use config.yml for models, rails, streaming, tracing, and configuration.
  • Use prompts.yml when the selected rail needs custom prompt templates.
  • Use .co files when the solution needs Colang flows.
  • Use actions.py only when Python actions are required.

When editing an existing app, preserve the user's project layout and avoid moving unrelated files.

Build Iteratively

  1. Start with one guardrail objective.
  2. Write the smallest config that exercises that objective.
  3. Add two or three test prompts:
    • a request that should pass,
    • a request that should be blocked or modified,
    • an edge case if the user has one.
  4. Run the config through the documented Python API, CLI chat, or server path that matches the user's setup.
  5. Inspect the result and adjust the rail, prompt, flow, or model configuration.

Do not silently introduce live provider calls. Ask before running commands that require network access, credentials, paid APIs, Docker, or long-running services.

Testing And Verification

For product users, verify with the smallest runnable example:

  • nemoguardrails chat --config <config-path> when using the CLI.
  • A short Python script with RailsConfig.from_path(...) and LLMRails(...) when embedding in an app.
  • The documented server endpoints when using the Guardrails API server.

For repository contributors, unit tests must not call live LLM or provider services. Use repository test doubles and mocks according to nemoguardrails/AGENTS.md.

Security And Credentials

  • Never ask users to paste real API keys, tokens, or provider credentials into chat.
  • Use placeholders such as <NVIDIA_API_KEY>, <OPENAI_API_KEY>, and <YOUR_ENDPOINT>.
  • Explain where secrets should be set locally.
  • Do not write secrets into committed config examples.

Output Format

When helping create guardrails, return:

  1. The chosen starting pattern and why.
  2. The files to create or edit.
  3. The proposed config or code snippets.
  4. The verification command or script.
  5. The test prompts and expected behavior.
  6. Follow-up improvements after the first working version.

Related Skills

  • Use guardrails-developer-guide for documentation lookup and product-usage questions. When editing this repository, follow AGENTS.md and any subtree AGENTS.md files that apply.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning4mo3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    The skill provides safe, structured guidance for developers building NVIDIA NeMo Guardrails configurations. It adheres to security best practices, such as instructing users to avoid pasting real API keys and providing placeholder examples for configuration files.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 5112cf1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 5 months ago

README badge

README badge for nvidia-nemo/guardrails/guardrails-developer-create-guardrails