When a managed moderation API belongs inside your NeMo Guardrails rails
A team should put a managed moderation API inside its NeMo Guardrails rails only after its security and privacy owners have approved that each request leaves the client network. Calling ActiveFence, Clavata, PolicyAI or GCP from a rail is possible, but every call sends the prompt or response text to a service outside your infrastructure, so the approval is a data-flow decision before it is a technical one. NeMo Guardrails is an Apache 2.0 library, and the rail decides what happens with a provider's verdict: block, rewrite, log or allow. The provider's score is one input to that rail. It does not replace the rail's own logic, its fallback behavior or its audit record.
Before you write the integration, confirm three things for each provider against its own documentation and the NeMo Guardrails version you run. First, which content categories and languages it covers. Second, its default risk thresholds, how they are set, and whether you may override them in the configuration the library passes to the provider. Third, which directions it supports: checks on user input, checks on model output, or both. Record these answers in the same change that adds the rail, because a provider can change its categories or thresholds on its own schedule, separately from the library's releases.
Pin the library version as part of that review. The current release is 0.25.0, published on 19 November 2026, and it requires Python 3.11, 3.12 or 3.13. Read the release notes for changes to provider integrations between versions before you upgrade. Then ask your security team where the provider's API keys will be stored, who can rotate them, and whether your egress policy allows the outbound destination. Finally, decide in advance whether the rail fails open or fails closed when the provider is slow or unavailable. Those answers belong in the approval record before the rail reaches production.
Where a user message goes when an input rail calls a managed moderation service
The diagram starts with a user message entering your application, which passes it to the NeMo Guardrails input rail running in your network. The rail sends the message to the moderation provider's cloud, and that outbound request is the point where data leaves your boundary. The provider's verdict returns to the rail, which allows, refuses or modifies the message before the application responds. Check which request fields cross the boundary and whether a self-hosted safety model would keep that arrow inside your network.
Data flow for a managed moderation call, with the client network boundary marked.
How ActiveFence, Clavata, PolicyAI and GCP differ for a rail owner
ActiveFence is a managed trust and safety service that a NeMo Guardrails rail would call over the network. Treat it as an external processor of every text the rail sends, and settle its account, threshold and direction details in writing before the rail design is fixed.
- Account and key: Confirm how API credentials are issued, scoped and rotated, and whether separate keys can be used for input and output rails.
- Default thresholds: Confirm the default risk score or confidence cutoff, where the integration sets it, and whether each rail can override it.
- Directions: Confirm whether the integration checks user input, model output, retrieved content or some combination of these.
- Categories: Ask for the full list of policy categories and labels returned, and how your configuration maps each one to a block, mask or flag decision.
- Data sent: Ask which fields leave your network (prompt text, model output, session or user identifiers, metadata), where processing happens and how long the provider retains them.
Check each point against the vendor's current documentation and contract before you set thresholds or send production traffic.
Clavata is a managed content classification service that a NeMo Guardrails rail would call as an external dependency. Its label model shapes how the rail reads results, so confirm the labeling approach before you write any Colang or action code that depends on it.
- Account and key: Confirm how workspaces, API keys and user roles are organized, and whether one key can serve several applications or environments.
- Default thresholds: Confirm whether the service returns a score, a label, or both, and whether a default cutoff applies before your rail sets its own.
- Directions: Confirm which directions the integration covers for input, output and retrieved content, and whether any direction needs a separate configuration.
- Categories: Ask whether labels come from a fixed taxonomy or from policies your team defines in the vendor console, and who maintains those definitions over time.
- Data sent: Ask what each request carries (the message text, surrounding context, metadata), where it is processed, whether it is stored and for how long.
Record the answers to these questions in the design document, because they determine what your audit trail can show about each blocked or allowed message.
PolicyAI is a managed policy evaluation service that a NeMo Guardrails rail would call with text for a policy decision. Confirm how it expresses policy results, because that determines whether the rail can use the output directly or needs its own mapping layer.
- Account and key: Confirm how accounts, projects and API keys are issued, and whether keys can be restricted to particular policies or environments.
- Default thresholds: Confirm whether decisions come as a fixed allow or deny result or as scores, and which default cutoff applies if the rail does not set one.
- Directions: Confirm whether input checks, output checks and retrieved content checks are each supported, and whether they need different request formats.
- Categories: Ask which policy names and categories are returned, whether your organization can add its own policies, and how changes to policies are versioned.
- Data sent: Ask which parts of the conversation are included in each request, where the data is processed, the retention period, and whether the provider uses customer data for model training.
Before production, test how the provider handles multilingual text and long inputs, since the rail's behavior depends on those answers.
The Google Cloud moderation option is a managed service inside a Google Cloud project, so its credentials, region and logging follow your cloud account rather than a separate vendor account. Confirm which Google Cloud service the rail will call, because the authentication, pricing and data terms depend on that choice.
- Account and key: Confirm whether the rail authenticates with a service account and IAM roles, or with an API key, and how the credential is stored and rotated.
- Default thresholds: Confirm the default confidence or category scores returned, and whether the rail can set its own cutoff per category.
- Directions: Confirm which checks apply to user input, model output and retrieved content, and whether the chosen service supports each direction.
- Categories: Ask for the exact safety categories returned, their names and how each maps to your block or mask decision in the rail configuration.
- Data sent: Confirm which processing location is used, whether the request stays in the region you select, what logs the project records and what retention applies under the service terms.
Review the current Google Cloud documentation and your organization's data processing terms before choosing the region and logging settings for production.
Configuration options for keys, thresholds and rail direction
This table compares the configuration choices a team makes for each managed moderation call from NeMo Guardrails, including key storage, threshold handling, rail direction and error behavior. Read each row as a decision: the first column names the choice, the middle columns show the options and their trade-offs, and the last column shows when each option fits.
| Configuration choice | Options and trade-offs | When it fits |
|---|---|---|
| API key storage | Environment variable is simple to inject into containers but is visible to anyone who can read the process environment. A secret store adds a lookup at startup and an extra dependency, but supports rotation and access logging. | Environment variables suit small single-host deployments. A secret store suits regulated environments where key rotation and audit trails are expected. |
| Default threshold | Keeping the provider default is fastest to deploy and easiest to explain, but the default may not match your policy. Overriding it puts your own risk level in version-controlled configuration and makes every change a reviewed decision. | Keep the default for a first pilot and record its behavior. Override only after you have test evidence showing which content the default misses or wrongly refuses. |
| Threshold testing | Test with labeled safe and unsafe prompts from your own use case, and compare refusal counts before and after each change. Skipping this step means threshold changes reach production without evidence. | Use a fixed test set kept in the same repository as the rail configuration, and run it on every threshold change and library upgrade. |
| Rail direction | Input rails screen user messages before the model sees them, and output rails screen responses before users see them. Retrieval rails check retrieved chunks, and dialog rails decide flow. Each direction sends different data to the provider and adds latency at a different point. | Attach input rails where user text is the risk, output rails where generated text is the risk, and retrieval rails for RAG content. Confirm with the provider which content types each service accepts. |
| Provider error handling | Failing closed blocks requests when the provider is unreachable, which protects content but adds dependency on provider availability. Failing open allows requests through, which keeps the assistant running but leaves screening gaps. | Fail closed for high-risk assistants in regulated settings. Fail open only where a documented decision accepts unscreened traffic during an outage. |
| Timeout setting | A short timeout limits delay but can produce false refusals on slow responses. A long timeout protects accuracy but raises latency for every user during an outage. | Set the timeout from measured latency in your own environment, and confirm the provider's expected response times with its documentation or account team. |
| Configuration location | Keeping overrides in the rail configuration under version control makes changes reviewable and reproducible. Settings held only in a running container are hard to audit or restore. | Always store threshold overrides in the version-controlled rail configuration, and rerun threshold tests after any NeMo Guardrails library upgrade. |
What data leaves your network with each moderation request
Every call from a NeMo Guardrails rail to a managed moderation service sends data outside your environment. The cards below cover the fields that travel in each request and the provider terms that govern them, so privacy and security owners can decide what each field needs before any production traffic is sent.
The user message text
The raw prompt is the field most often sent to a moderation API, and it is where personal data, credentials and confidential business details tend to appear. Each input rail call sends this text to the provider in full unless you change the rail configuration. Decide whether the text is sent as is, redacted first with a local PII rail, or not sent at all for certain request types, and record that decision with the privacy owner.
Conversation history and system context
Dialog rails and multi-turn assistants can attach earlier turns, retrieved documents or system instructions to the moderation call, depending on how the rail is written. Those attachments often carry more personal data than the latest message. Check the rail configuration and a captured sample request to see exactly which fields are included, and confirm that system prompts containing internal logic or policy text are not forwarded unless you intend it.
Model output sent on output rails
Output rails send the model's response to the moderation service, which may include content generated from your internal documents or retrieved records. This is a second outbound path, separate from the user's input, and it is easy to overlook during review. Confirm whether output checks run on every response or only on selected flows, and treat retrieved content quoted in a response as data that leaves your network too.
User and session identifiers
Request headers, metadata fields or tracing context can carry user IDs, session tokens or account numbers. These identifiers may be sent to the provider even when the message text is clean. Review which headers your HTTP client and NeMo Guardrails configuration add to outbound calls, strip anything that identifies a person or account, and keep provider-side logs free of values you would not share.
Provider retention, training and sub-processors
Retention periods, whether submitted content is used to train or improve models, and which sub-processors handle the data are set by each provider's contract and documentation, not by NeMo Guardrails. Ask ActiveFence, Clavata, PolicyAI and Google Cloud for these terms in writing, and confirm them against the data processing agreement or equivalent before production traffic is sent. Do not rely on defaults you have not seen in the signed terms.
Approval and review of each field
Each field in the outbound request needs one of three decisions: send, redact before sending, or do not call the provider for that path. Privacy and security owners should sign off on that mapping, and the decision should be revisited whenever a rail, prompt or model changes. Keep the approved field list with the configuration in version control so auditors and reviewers can see what was agreed and when.
How to wire a managed moderation provider into a rail
This sequence takes a managed moderation service from contract review to a tested NeMo Guardrails rail, so each provider call is authorized, keyed safely, mapped to a clear outcome and proven against known safe and unsafe inputs before it reaches users.
Confirm the provider contract and data terms
Before any code is written, the legal, privacy and security owners review the agreement with the moderation provider. Confirm which prompts and responses are sent to the provider, where they are processed, how long they are retained, whether they are used for model training, and what sub-processors are involved. Record the answers, because every request you send will leave your network and carry that data. The step is done when the security owner signs off on the data flow and the provider's terms match what your policy allows for the content category involved.
Create a test key and store it in a secret manager
Ask the provider for a separate test key with its own usage limits, so a leaked or misconfigured key cannot affect production traffic. Store the key in your approved secret manager, not in config.yml, source control or container images, and inject it at runtime as an environment variable. Confirm the exact variable name the integration expects in its documentation for your version. The check is that a grep of the repository and image layers finds no key value, and the application starts with the key supplied only from the secret store.
Install a supported NeMo Guardrails version
Install the nemoguardrails package from PyPI on Python 3.11, 3.12 or 3.13, pinned to a version that includes the integration you plan to use. The current release is 0.25.0, published on 19 November 2026 under Apache-2.0, and the previous release is 0.24.1. Confirm in the integration documentation for that version whether the provider needs an extra package or environment setting. The check is that the pinned version reports the expected release from the command line and the application imports the library without errors.
Declare the provider in configuration
Add the provider to your config folder, alongside config.yml, following the provider entry format in the integration documentation for your version. Reference the key through the environment variable rather than a literal value, and set a timeout and a fallback behavior for when the provider does not respond. Keep the provider's default risk thresholds visible in the file, and document any override you set, with a reason. The check is that the server or Python API loads the configuration without validation errors and logs the provider as registered.
Attach the call to an input or output rail
Wire the provider into a rail in your Colang flows or config, choosing the direction it supports. Use an input rail when you want to screen user messages before the application model runs, and an output rail when you want to screen model responses before they reach the user. Confirm in the provider documentation which directions it covers, because a provider may check only one. The check is that a flow trace shows the rail executing the provider call for the expected direction and not for the other.
Map the provider verdict to a refusal or a pass
Translate the provider's response into a rail outcome: a pass lets the message continue, and a flagged result triggers a refusal with a configured message. Decide how ambiguous results and errors are handled, and make sure a timeout returns the fallback you defined rather than an unhandled exception. Record which categories cause a refusal, since those choices are part of your policy and will be reviewed by compliance. The check is that a flagged test returns the refusal message and a timeout returns the configured fallback.
Log requests with keys redacted
Enable logging for the provider call so you can see the request, the verdict and the latency, but configure the logger so the API key and any sensitive message content are redacted or omitted according to your data policy. Confirm where the logs are stored and who can read them. The check is a logged request that shows the provider name, direction, verdict and timing, with the key value absent from every log line.
Test with safe and unsafe prompts
Build a small test set with prompts that should pass, prompts that should be refused for each category you enforce, and boundary cases. Run them through the configured rail and record the outcome for each. Include at least one timeout test by pointing the rail at an unreachable endpoint in a test environment. Treat the test set as illustrative until your own policy owners approve the expected outcomes. The check is that every known unsafe test case returns a refusal, every safe case passes, and the timeout test returns the configured fallback.
Why default thresholds need calibration on your own traffic
A provider's default risk threshold reflects that provider's policy, not your acceptable use policy. Treat the default as a starting point and never as a validated setting. The right value depends on who uses your application, which languages they write in, and how much you are willing to trade false refusals against missed harm. A threshold that suits a general consumer chatbot may block legitimate questions in a clinical, legal or security-research context, or let through content your policy prohibits. Confirm with each provider which categories its score covers and how the score maps to the decision the rail makes, because those details vary between services.
Calibration is a plain, repeatable process. First, collect a labeled test set drawn from your application's own domain, including prompts from real or realistic user flows, adversarial examples and borderline requests your policy owner cares about. Second, run that set through the rail at the provider's default and at each candidate threshold, recording the score and the decision for every item. Third, review false positives and false negatives with the policy owner, not only with the engineers who wired the rail. Fourth, record the chosen value in configuration with the test set version, the results at each threshold, the reviewer's sign-off and the date. The record is the evidence an assessor or internal risk team will ask for.
Calibration is not a one-time task. Re-run the full test set whenever a provider changes its models or scoring, and whenever you upgrade NeMo Guardrails, because the library's handling of rail outputs can change between releases. Check the release notes for each version you plan to adopt, and confirm with the provider how it announces model changes and whether you can pin a model version. Until this work is complete and documented, describe the threshold as the provider default in internal and external material, not as a tuned or validated control.
What to confirm with each provider before production
Each managed moderation service sets its own boundaries for languages, traffic, latency, hosting and failure handling, and those boundaries shape the rail design more than the NeMo Guardrails configuration does. Confirm them in writing before you build, because the moderation call leaves your network on every request it makes.
Languages and content types
Ask each provider which languages and content types its classifiers cover, including code, images, and mixed-language text. Coverage often differs by category, so a provider that is strong in English may be weak in the languages your users write in. Test with a sample of real traffic from your own environment before you rely on the verdicts for blocking decisions.
Rail directions covered
Confirm whether the integration supports input, output, and retrieval checks, or only some of them. A service that covers user prompts but not model responses leaves output rails without a managed check, so the gap has to be closed by another rail. Get the answer for each direction in writing.
Rate limits and quotas
Ask for the request rate limits, daily or monthly quotas, and what happens when you exceed them. Moderation runs on every prompt and response, so a quota that is reached during peak traffic can block the whole assistant. Ask how quota overages are billed and who approves increases.
Latency and timeout behavior
Ask for typical and worst-case response times, the default timeout, and whether the call can be retried. Each rail adds its latency to the user's wait, so the timeout you set in your configuration determines whether a slow verdict blocks a message or lets it pass. Decide the fail-open or fail-closed choice for each rail before you test.
Regional hosting and data residency
Ask where requests are processed and stored, which regions are available, whether retention can be shortened or disabled, and whether logs are kept for provider use. Every moderation request carries user text outside your network, so this answer may decide whether the integration is allowed for your data classes at all.
Outage behavior and maintenance
Ask how the provider communicates outages, what status and support channels exist, and whether the integration is kept current with the NeMo Guardrails release line you chose. Also confirm where the call will run: the NeMo Guardrails microservice has been sunset, so the library is the supported path and you should confirm your deployment model before design.
NeMo Guardrails releasesWhat does a managed moderation integration cost and take to set up?
What drives the cost of a managed moderation integration?
The cost follows the written scope and each provider's own pricing. The main drivers are how many rails and directions are involved (input, output, retrieval, dialog or execution), how many languages the moderation must cover, how much data review your privacy and legal reviewers require, how much threshold calibration is needed, and how much testing and evidence your security and compliance teams expect. Each rail and direction adds configuration, test cases and review. Provider usage fees are a separate cost paid to the moderation vendor, typically based on subscription or request volume, so ask each provider for its pricing in writing. DeployOpen quotes its own work from a written scope and does not publish a price list.
Which moderation costs are one-time and which recur after go-live?
One-time costs cover the initial integration: setting up API keys, wiring each provider into the relevant rails, reviewing default risk thresholds, calibrating them against a labeled test set, completing the data review, and running the first round of security testing and evidence collection. Recurring costs include the provider's subscription or metered usage fees, which continue for as long as traffic passes through the service. Other recurring work includes re-calibration after NeMo Guardrails upgrades or provider model changes, monitoring of block and false-positive rates, and any retainer for continuous testing. Ask each provider which charges are committed, which are metered, and whether model updates can change scores.
What must our team provide before a moderation integration starts?
Five inputs decide whether the work can start on schedule:
- A contract with each moderation provider, with API access for every environment in scope
- Written approval from your data owners and privacy or legal reviewers for each request type that leaves your network
- A labeled test set of prompts and responses drawn from your traffic, in the languages you serve
- Named policy owners who decide what each category should block and what counts as a false positive
- A security reviewer who signs off on key storage, request logging and egress rules
Missing any of these usually moves the schedule more than the engineering does, so confirm each one before the written scope is signed.
Can our own engineering team set up managed moderation without a partner?
Yes, a capable internal team can do the work if it has three things: a security reviewer who owns the decision, a labeled test set that reflects your traffic, and time to run calibration and regression tests after each change. A team that already runs NeMo Guardrails in its own infrastructure can usually handle the configuration itself, since the rails are defined in a config.yml file and optional Python actions. A partner adds the most value when provider onboarding is slow, when several rails and directions must be tested together, or when the evidence must be assembled for an external assessment. The decision is about capacity and evidence, not about whether the code is hard.
How long does setup take, and what can delay it?
The duration is set mainly by provider access and approvals, and only secondarily by the code. The common delays are provider account onboarding and API key issuance, data processing approvals from your privacy and legal teams, the time needed to label a test set, and calibration cycles in which thresholds are tuned and tests are rerun. Ask each provider for its onboarding steps and expected lead time in writing. No duration is given here because the figure depends on those inputs. DeployOpen states timelines in the written scope, agreed before work starts, once the provider access and approval dependencies are known.
Who should own the provider accounts and API keys after handover?
Your organization should own the provider contracts, the accounts that issue the API keys, and the keys themselves, so access can be rotated or revoked without depending on the implementer. Keys should be held in your own secrets store and injected at runtime, not written into configuration files kept in a source repository. Document who can request a new key, who approves rotation, and who is alerted when a provider changes its service terms or endpoints. Keep this record with the test set and calibration notes so the next team can take over the integration.
What should we confirm in writing before signing a moderation provider contract?
Confirm what data each request carries, how long the provider retains prompts and responses, where processing happens, which subprocessors touch the data, and whether customer content is used to train models. Also confirm the deletion process, the notice period for security incidents, and how the provider handles changes to its models or scoring. Each answer determines what your data owners must approve, because every request that goes to a managed service leaves your network. Ask for these terms in the contract or a data processing addendum rather than relying on a general web page, and have your security reviewer check them against your data classification.
How DeployOpen scopes and delivers third-party moderation rails
DeployOpen plans and builds third-party moderation rails in NeMo Guardrails as part of a written, fixed scope, so the managed moderation services, their keys, thresholds and data flows are agreed before any rail reaches production. The work runs inside your own NeMo Guardrails deployment, and the outbound data decisions are documented for your security and compliance reviewers.
How we scope
- Map which rails will call ActiveFence, Clavata, PolicyAI or Google Cloud moderation, and in which direction each runs.
- Record the data each request sends outside your network and who approves that flow.
- Agree in writing how API keys will be issued, stored and rotated under your secrets policy.
How we build
- Configure each provider rail in config.yml with explicit risk thresholds rather than relying on undocumented defaults.
- Test input and output paths with safe and unsafe samples, including failure behavior when the external service is unreachable.
- Review egress rules and timeouts so blocked-request handling is predictable under load.
How we hand over
- Deliver the configuration files, threshold decisions and a data flow record listing every external call.
- Document the override steps, key rotation procedure and the retest plan for each provider.
- Walk your security, platform and compliance teams through the evidence before go-live.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover.
- Re-check provider settings and NeMo Guardrails version changes against the agreed scope.
- Retest rails after threshold changes, provider updates or new policy categories are added.

