> 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.

# List Guardrail Configurations

> Retrieve available guardrails configurations from the server.

Use the `/v1/rails/configs` endpoint to retrieve the list of available guardrails configurations from the server.

## Request

```bash
curl http://localhost:8000/v1/rails/configs
```

## Response

The endpoint returns an array of configuration objects, each with an `id` field:

```json
[
  {"id": "content_safety"},
  {"id": "jailbreak_detection"},
  {"id": "topic_safety"}
]
```

## Using Python

```python
import requests

base_url = "http://localhost:8000"

response = requests.get(f"{base_url}/v1/rails/configs")
configs = response.json()

print("Available configurations:")
for config in configs:
    print(f"  - {config['id']}")
```

**Example output:**

```text
Available configurations:
  - content_safety
  - jailbreak_detection
  - topic_safety
```

## Use a Configuration

After retrieving the available configurations, use a configuration ID in your chat requests:

```python
# Get available configs
response = requests.get(f"{base_url}/v1/rails/configs")
configs = response.json()

# Use the first available config
if configs:
    config_id = configs[0]["id"]

    response = requests.post(f"{base_url}/v1/chat/completions", json={
        "model": "meta/llama-3.1-8b-instruct",
        "messages": [{"role": "user", "content": "Hello!"}],
        "guardrails": {
            "config_id": config_id
        }
    })
    print(response.json())
```

## How Configurations Are Discovered

The server discovers configurations based on how it was started:

**Multi-config mode** (default): The server scans the configuration directory for sub-folders containing a `config.yml` or `config.yaml` file.
Each sub-folder becomes an available configuration with its folder name as the ID.

```text
examples/configs/
├── content_safety/        → config_id: "content_safety"
│   └── config.yml
├── jailbreak_detection/   → config_id: "jailbreak_detection"
│   └── config.yml
└── topic_safety/          → config_id: "topic_safety"
    └── config.yml
```

**Single-config mode**: If the server is pointed to a folder containing a `config.yml` file directly (not in sub-folders), only that configuration is available.
The folder name becomes the configuration ID.

```bash
nemoguardrails server --config examples/configs/content_safety
```

The endpoint returns:

```json
[{"id": "content_safety"}]
```

## Related Topics

* [Run the Guardrails Server](/run-guardrailed-inference/using-fastapi-server/run-guardrails-server)
* [Chat with a Guardrailed Model](/run-guardrailed-inference/using-fastapi-server/chat-with-guardrailed-model)
* [List Guardrails Configurations](api:GET/v1/rails/configs)