Skip to main content

nemoguardrails-revsec: RevSec rails for NVIDIA NeMo Guardrails

One set of AI policies for every NeMo Guardrails app, managed in one place.

NeMo Guardrails lets each app check what goes in and out of its model. RevSec adds the rails that apply your organization's policies, the same ones it applies to your other agents, AI tools and MCP servers, and keeps a record of what every app did. Your security team changes a policy once in the RevSec console; every app that uses these rails follows it without a redeploy.

What it does for your business

  • Stops risky actions before they happen. Each tool call the model asks for is checked before your app runs it. A refund above a limit, a delete, or a call that would carry a secret or a card number is taken out, and the reply says why.
  • Keeps prompt injection and leaked data away from your model. The user's message is checked before the model sees it, and what each tool hands back (web pages, documents, database rows) is checked before the model reads it: instructions aimed at the model, secrets and personal data.
  • Checks the reply before anyone uses it. Secrets or personal data in a reply, and payloads aimed at a database, a template, a shell or a browser that would run or render it, are withheld.
  • Gives you one view of every app. Each app appears in your RevSec console as an agent with its model, the tools it has called, its risk rating, and its decisions. Replay any conversation in Activity Explorer.
  • Proves control. Frameworks shows which controls in the EU AI Act, ISO/IEC 42001, NIST AI RMF, SOC 2 and more your policies are mapped to, and Evidence Packs gather the evidence for a customer's security review or auditor.
  • Works alongside your own rails. Keep NeMo Guardrails' built-in rails and your own flows; list the RevSec flows next to them.

Quick start

pip install nemoguardrails-revsec
export REVSEC_API_KEY=rsk_...
export REVSEC_BASE_URL=https://app.revsec.app/fcc

Get a key from the RevSec console (Customer accounts → New key in a builder account, or Settings → SDK). Then add the rails to your app's config.yml:

models:
  - type: main
    engine: nim
    model: meta/llama-3.3-70b-instruct

import_paths:
  - nemoguardrails_revsec/rails

rails:
  input:
    flows: [revsec check input]
  output:
    flows: [revsec check output]
  tool_call:
    flows: [revsec check tool calls]
  tool_result:
    flows: [revsec check tool results]

custom_data:
  revsec:
    agent_name: support-assistant

That's all. The first conversation registers the app in RevSec. From then on its messages, tool calls, tool results and replies are checked, and the decisions show in the console. List only the flows you want; each one works on its own.

If NeMo Guardrails can't find nemoguardrails_revsec/rails (a package installed outside NeMo Guardrails' site-packages), use the absolute path:

python -c "import nemoguardrails_revsec; print(nemoguardrails_revsec.RAILS_PATH)"

What RevSec checks

Flow When If RevSec stops it
revsec check input The user's message, before the model sees it The model is never called; the reply says the request was blocked and why
revsec check tool calls Each tool call the model asks for, before your app runs it The call is taken out of the reply, so your app never runs it; when every call is stopped, the reply says why
revsec check tool results What a tool handed back, before the model reads it The model gets "withheld" instead of the content
revsec check output The model's reply, before your app uses it The reply is replaced with one saying it was withheld

With enable_rails_exceptions: true in config.yml, a stop is returned as a RevSecRailException (with the reason as its message) instead of a reply, as NeMo Guardrails' own rails do.

Tool calls are checked as the app's own tools, against the tool-call policies in RevSec's Agent Security (for example the "NVIDIA NeMo agents: tool calls" pack), so a policy can name the app's tools and arguments.

Options

Everything under custom_data: revsec: is optional:

custom_data:
  revsec:
    agent_name: support-assistant    # default: nemo-guardrails-app
    description: Answers order questions and issues refunds
    owner_email: team@example.com
    environment: production
    customer_facing: true            # shown on the app and used in its risk rating
    failure_mode: fail_open          # or fail_closed: stop when RevSec can't be reached
    check_prompts: true              # false when model calls go through the RevSec AI gateway
    check_replies: true              # false when model calls go through the RevSec AI gateway
    check_tool_results: true
    dlp: false                       # true also scans each tool call's arguments for sensitive data
    register_agent: true
    enabled: true

api_key and base_url can be set here too; by default they come from REVSEC_API_KEY and REVSEC_BASE_URL.

To show one conversation's checks together in Activity Explorer, pass a conversation id as a context message:

await rails.generate_async(messages=[
    {"role": "context", "content": {"revsec_session_id": "ticket-4821"}},
    {"role": "user", "content": "Where is my order?"},
])

If RevSec can't be reached, checks let the app go on by default, so an outage never stops your product. Set failure_mode: fail_closed to stop it instead.

Requirements

  • Python 3.10 or later, and NeMo Guardrails 0.25 or later with Colang 1.0 (the default)
  • A RevSec account: start a free 30-day trial, no card needed

Licensed under Apache 2.0. RevSec is a product of RevUp AI LLC. NVIDIA and NeMo are trademarks of NVIDIA Corporation; this package is not made or endorsed by NVIDIA.

Metadata

Release files for nemoguardrails-revsec 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nemoguardrails-revsec 0.1.0
File Size Uploaded Provenance Actions
nemoguardrails_revsec-0.1.0.tar.gz 20.6 kB Without provenance Details for nemoguardrails_revsec-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nemoguardrails-revsec 0.1.0
File Interpreter ABI Platform Actions
nemoguardrails_revsec-0.1.0-py3-none-any.whl Python 3 none any Details for nemoguardrails_revsec-0.1.0-py3-none-any.whl

Total release size: 35.6 kB

Release files / nemoguardrails_revsec-0.1.0.tar.gz

Download URL nemoguardrails_revsec-0.1.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63458ef7b8dfbd18cad27758244700239943e0eee0353c96bc5610835166ddb0
BLAKE2b-256 checksum
How to use checksums
446b6ad4451173c7faa65243a0d7418f5dd88750cfea3acb269086e153b8b947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / nemoguardrails_revsec-0.1.0-py3-none-any.whl

Download URL nemoguardrails_revsec-0.1.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13fdc7c17e5be5e79f3768f6f1955739ccd62f8236efb11eb1afd60b4afe79f9
BLAKE2b-256 checksum
How to use checksums
6a66d41905bc709cbb972da06be8b3894859a19961ec3bb6705e9ec75aedf76d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for nemoguardrails-revsec 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page