How to Disable Safety Guardrails in Cosmos 3 Generation Requests
Set "guardrails": false in the extra_params JSON payload for individual requests, use the --no-guardrails CLI flag for command-line runs, or deploy a no_guardrails.yaml configuration file to disable guardrails server-wide for all subsequent generation calls.
Cosmos 3 by NVIDIA includes built-in safety guardrails that screen prompts for disallowed content and automatically blur faces in generated video outputs. These protective measures are enabled by default (guardrails: true) in the NVIDIA/cosmos repository, but developers can disable safety guardrails in Cosmos 3 generation requests when building controlled research environments or specialized applications requiring unfiltered outputs. The repository provides three distinct scoping levels for this configuration: per-request, CLI invocation, or global server deployment.
What Cosmos 3 Safety Guardrails Do
According to the source documentation in README.md (lines 393-421), the guardrails system performs two critical safety functions:
- Prompt screening: Analyzes input text for disallowed content categories before generation begins
- Face blurring: Applies privacy-preserving blur effects to human faces detected in the final visual output
When active, these models run automatically on every generation request unless explicitly disabled.
Method 1: Per-Request Disabling via REST API
For individual generation calls without affecting other users or requests, add "guardrails": false to the extra_params JSON object. This override applies only to the current API call.
cURL Example
curl -X POST https://<your-endpoint>/v1/chat/completions \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
--form-string 'messages=[
{"role":"system","content":"You are a helpful assistant."},
{"role":"user","content":"Generate a video of a robot pouring water."}
]' \
--form-string 'extra_params={"guardrails":false,"use_resolution_template":false,"use_duration_template":false}'
Python SDK Example
The following pattern appears in cookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb, where robotics forward-dynamics workflows disable guardrails for specific experimental runs:
import requests, json, os
endpoint = "https://<your-endpoint>/v1/chat/completions"
headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}
payload = {
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Generate a video of a robot pouring water."}
],
"extra_params": {
"guardrails": False, # <-- disables safety checks
"use_resolution_template": False,
"use_duration_template": False
}
}
resp = requests.post(endpoint, headers=headers, json=payload)
print(resp.json())
Method 2: Command-Line Interface Override
When using the Cosmos CLI client, pass the --no-guardrails flag or the equivalent --extra_params='{"guardrails":false}' argument. This disables guardrails for that specific CLI invocation only, leaving the default enabled behavior intact for other processes.
As demonstrated in cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb (lines 864-1199):
cosmos-cli generate \
--model cosmos3-nano \
--prompt "A robot pours water into a cup." \
--extra_params '{"guardrails":false}'
# Or equivalently using the convenience flag
cosmos-cli generate --model cosmos3-nano --prompt "A robot pours water into a cup." --no-guardrails
Method 3: Server-Wide Deployment Configuration
To disable guardrails for all subsequent requests across your entire deployment, create a YAML configuration file and load it at server startup. This approach prevents the guardrail models from loading entirely, conserving GPU memory.
Create a file named no_guardrails.yaml:
# no_guardrails.yaml
guardrails: false
offload_guardrail_models: false # optional - frees GPU memory by not loading models
Start the server with the deployment configuration:
cosmos-server --deploy-config no_guardrails.yaml
Important limitation: When guardrails are disabled via server-wide configuration, the per-request extra_params override cannot re-enable them. Because the guardrail models remain unloaded in GPU memory, individual API calls cannot activate safety features until you restart the server without the disable configuration.
Key Configuration Files
The following source files in NVIDIA/cosmos govern guardrail behavior:
README.md(lines 393-421): Documents theextra_paramsJSON flag and server-wide deploy config optionscookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb: Demonstrates the--no-guardrailsCLI flag usage in interactive notebook environmentscookbooks/cosmos3/generator/action/run_fd_with_vllm.ipynb: Shows Python SDK implementation patterns withextra_params={"guardrails": False}for robotics applications
Summary
- Per-request: Add
"guardrails": falseto theextra_paramsJSON payload for single-call disabling without affecting other users - CLI: Use the
--no-guardrailsflag for convenient command-line generation tasks - Server-wide: Deploy a
no_guardrails.yamlfile withguardrails: falseto prevent safety model loading entirely and free GPU resources - Default state: Guardrails are enabled (
guardrails: true) for all generation requests unless explicitly configured otherwise - Irreversibility: Server-wide configuration overrides per-request settings; you cannot re-enable guardrails via API calls if the server started with them disabled
Frequently Asked Questions
Can I re-enable guardrails for a single request if the server started with them disabled?
No. According to the NVIDIA/cosmos source code, when you deploy using a server-wide configuration file that sets guardrails: false, the guardrail models are never loaded into GPU memory. Because these safety models are absent from the deployment, per-request extra_params cannot instantiate or re-enable the functionality. You must restart the server without the no_guardrails.yaml configuration to restore guardrail capabilities.
Does disabling guardrails improve generation performance?
Potentially. Setting offload_guardrail_models: false in your deployment configuration frees GPU memory that would otherwise be allocated to the safety screening and face detection models. For high-throughput applications cited in the repository's cookbooks, eliminating these model loads can reduce latency and memory overhead, though the primary purpose of disabling is functional rather than performance optimization.
What content gets blocked when guardrails are enabled?
The guardrails screen prompts for disallowed content categories and apply automated face blurring to protect privacy. Based on the implementation described in README.md, the system checks input text against safety policies and post-processes generated video to obscure identifiable human faces. The specific disallowed content categories depend on the deployed safety model version and configuration policies set by your organization.
Is the --no-guardrails CLI flag equivalent to the JSON parameter?
Yes. The --no-guardrails flag is a convenience wrapper that internally sets extra_params={"guardrails":false}. As shown in cookbooks/cosmos3/generator/action/run_fd_with_cosmos_framework.ipynb, both approaches achieve identical per-invocation disabling effects, though the flag syntax requires less typing for interactive command-line usage.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →