Replacing Bedrock Guardrails without losing policy coverage
If you run Bedrock Guardrails in front of Bedrock models and want the policy layer inside your own infrastructure, NeMo Guardrails and Guardrails AI cover most of the content filter, denied topic, word filter and PII policies, but Automated Reasoning checks have no open-source equivalent. Treat that gap as a decision point, not a footnote: list every guardrail policy in your current configuration and mark each one as a direct mapping, a rebuild, or a policy you will retire or move to a different control. Bedrock's Automated Reasoning checks verify model responses against formal rules, and neither open-source library provides that capability, so confirm with your compliance team whether any control depends on it before you plan the cutover.
The right tool depends on the shape of the policy. NeMo Guardrails configures input, dialog, retrieval, execution and output rails in the Colang language, which suits conversational flows such as scripted refusals, topic steering and tool-use limits. Guardrails AI builds guards from validators on Guardrails Hub, such as regex matching or toxicity detection, which can be chained and suits filtering, PII checks and structured output validation. Many teams use both: validators for deterministic checks on inputs and outputs, and dialog rails where the conversation itself must follow a defined path. Confirm the licensing and release status of each project in your own environment before you standardize on one.
The policy layer is independent of the model layer, so you can change either without touching the other. Point the guardrail server at whichever model endpoint serves your traffic, and keep the policy configuration in version control so reviews, approvals and rollbacks are recorded. Before cutover, run your existing blocked-prompt and redaction test set through both systems, compare the decisions line by line, and record every difference. Those results, not the vendor documentation, should decide whether the replacement covers your policies.
Which Bedrock Guardrails policies map to open source
This table maps each Amazon Bedrock Guardrails capability to a NeMo Guardrails rail, a Guardrails AI validator, or a gap that needs custom work. Read the coverage note before planning, because most mappings are partial and need your own policy export, test set and tuning. The main takeaway is that content and topic controls map well, while Automated Reasoning checks have no open-source equivalent in the set reviewed here.
| Bedrock Guardrails capability | Open-source mapping | Coverage note |
|---|---|---|
| Content filters | NeMo Guardrails self-check input and output moderation, plus the NVIDIA content safety model | Closest direct match. Confirm category coverage and thresholds against your Bedrock filter settings. |
| Denied topics | NeMo Guardrails dialog rails and topic safety model, defined in Colang | Partial. You write the topic definitions and must test refusals against your own denied-topic list. |
| Word filters | Guardrails AI regex validators, or simple input rules in NeMo Guardrails | Direct for exact terms and patterns. Word lists need an owner, versioning and case and language handling. |
| Sensitive information filters (PII masking) | A PII validator from Guardrails Hub or a dedicated PII detection library | Partial. Confirm entity types, masking behavior and detection accuracy on your own data before cutover. |
| Contextual grounding | NeMo Guardrails fact-checking, hallucination detection and retrieval rails for RAG chunks | Partial. Retrieval rails depend on your chunking pipeline, and the extra checks add model calls and latency. |
| Automated Reasoning checks | No open-source equivalent in the set reviewed | Gap. Build custom execution rails or validators for formal rules, or document the control as out of scope with your risk owner. |
| Packaging and support | NeMo Guardrails Python library 0.25.0, Apache-2.0, instead of the retired NeMo microservice | NVIDIA has sunset the NeMo microservice container. Confirm the support path for any image you already run. |
| Testing the replacement | Replay a labeled set of your prompts and model outputs through both controls | Measure false positives and false negatives per policy. Record results as evidence before retiring Bedrock Guardrails. |
NeMo Guardrails or Guardrails AI: which fits which policy set
Both libraries are Apache-2.0 and run in your own infrastructure, but they solve different parts of a Bedrock Guardrails replacement. The choice depends on whether your policies are conversational flows that need dialog control or field-level checks on inputs, outputs and structured data. Check the NeMo microservice sunset before you commit to either path.
NeMo Guardrails for dialog policies
NeMo Guardrails is an Apache-2.0 library that configures input, dialog, retrieval, execution and output rails in the Colang language. It includes self-check input and output moderation, jailbreak and injection detection, and topic safety models, which map most directly to Bedrock's denied topics and content filters. The Colang learning curve is the main cost: your team must write and test flows, not only attach validators. Plan for that effort before you compare it with Guardrails AI.
- Current release
- 0.25.0
Guardrails AI for field-level validation
Guardrails AI is an Apache-2.0 framework whose guards chain validators from Guardrails Hub, such as regex matching or toxicity detection, on inputs and outputs. It maps closely to Bedrock word filters and PII masking, and teams can write custom validators. Validator composition is quicker to start than Colang, but it covers fewer conversational policies out of the box, so check each denied topic against the available validators.
Guardrails AI quickstartStructured output and Pydantic models
Guardrails AI generates output that matches Pydantic models through function calling or prompt optimization. This helps when your Bedrock use case depends on strict JSON fields, such as classification labels or extracted records, rather than free text moderation. Confirm that your chosen model supports the function calling approach you need, since results vary by model and prompt.
Standalone service deployment
Guardrails AI can run as a Flask REST service started with guardrails start and called through the OpenAI SDK, which suits a shared guardrail tier in front of several applications. NeMo Guardrails offers a Python API or a server that loads configurations from a folder and exposes HTTP, with a Dockerfile for a server image. Compare how each server handles authentication, logging and upgrades in your own environment before you pick one for production.
NeMo microservice sunset and NeMo Helix
NVIDIA has sunset the NeMo Guardrails microservice as of October 1, 2026, with no new releases, and points existing users to NeMo Platform. The linked NeMo Platform repository now resolves to NVIDIA-NeMo/nemo-helix, an Apache-2.0 control plane that runs NeMo Guardrails as an inference gateway middleware plugin. If you were on the container, plan a migration to the library or to NeMo Helix, and ask your NVIDIA account team about support for existing deployments.
NeMo Helix repositoryPick by policy inventory
Before choosing, list every Bedrock guardrail policy and mark it as a conversational rule, a field check or a reasoning check. Conversational rules and topic restrictions point toward NeMo Guardrails, while PII masking and pattern filters can start with Guardrails AI validators. Automated Reasoning checks have no direct open-source equivalent in either library, so plan those as separate work or as a documented gap in your compliance evidence.
How input and output guardrails wrap the model call
The illustrative flow starts with an application request that enters the client's trust boundary and passes input rails or input guards before any prompt reaches the model endpoint. The model's response then returns through output rails or output guards, and each decision is written to a policy log that the security team can review. Check that every path to the model goes through the guard layer, that blocked requests return a defined response, and that the log records enough to rebuild a decision without storing raw personal data. This is a pattern to adapt, not a fixed reference architecture.
Illustrative flow: guard checks wrap the model call inside the client's boundary.
Running guardrails alongside Bedrock and other tools
This pattern keeps Amazon Bedrock as the model provider while moving the policy checks into a service you operate. Your application sends the user prompt to a guardrail server first, the server applies input rails, and only accepted prompts are forwarded to Bedrock. The model output then returns through output rails before reaching the user. NeMo Guardrails can run as a guardrails server that loads configurations from a folder and exposes an HTTP API, and Guardrails AI can run as a standalone REST service, so either fits this flow without changing the model call itself.
- Enforcement point: the guardrail server sits in your network, so policy decisions happen before any prompt leaves your boundary.
- Model calls: Bedrock still receives the traffic that passes the checks, so Bedrock's own data retention and model terms still apply to those requests.
- Configuration control: keep the Colang or validator configuration in version control and deploy it through the same pipeline as application code.
- Latency: each request makes an extra network hop, so measure the added time on your own prompt sizes.
- Failure behavior: decide whether the application fails closed or open when the guardrail server is unavailable, and document that choice for reviewers.
Before you rely on this pattern, confirm with your security team which traffic must pass through the guardrail server and test that no direct path to Bedrock remains open from the application.
A gateway such as LiteLLM gives applications one OpenAI-compatible endpoint, and it can handle keys, budgets, rate limits, fallbacks and logging. You can place the guardrail check either in front of the gateway or in a callback that runs as part of the gateway request path. The choice determines which system sees the raw prompt, which system makes the block decision, and which system writes the record of that decision.
- Gateway-first placement: the guardrail runs before LiteLLM, so blocked requests never reach the gateway logs, which is simpler to explain but leaves no gateway-side record of the attempt.
- Gateway-integrated placement: the check runs inside the request path, so gateway logs can show blocked and allowed calls together with virtual key and team identity.
- Logging location changes: when traffic passes through a gateway, guardrail decisions may be logged in the guardrail server, the gateway, or both, so map each log source before audit.
- Access control: LiteLLM's enterprise directory has its own license and adds SSO, SAML and audit logs, so confirm which of these features your deployment actually needs.
- Key handling: confirm where Bedrock credentials are stored and which component can read them.
Ask your platform team to produce a diagram of the request path and a list of every component that writes a guardrail decision, then test one blocked prompt end to end.
Guardrail decisions are only useful to a security team if they can be searched, alerted on and retained. The usual options are to send events to an LLM tracing platform such as self-hosted Langfuse, or to export traces through OpenTelemetry to the monitoring stack you already run. Langfuse runs with Docker Compose for testing or Kubernetes with Helm for production, and it depends on PostgreSQL, ClickHouse, Redis or Valkey, and S3 or blob storage, so its operational footprint should be included in your planning.
- Event content: record the rail name, the decision, the policy version and a request identifier, and decide whether the raw prompt is stored or only a hash or redacted form.
- Retention: set separate retention periods for guardrail events and application traces, and align them with your data classification rules.
- Access: restrict who can read blocked prompts, since those can contain sensitive content that users typed by mistake.
- Open-core limits: some advanced Langfuse features need an enterprise license key, so confirm which features your team depends on.
- Correlation: pass one trace identifier from the application through the guardrail and the gateway so one incident can be followed across systems.
Before go-live, run a test set of allowed and blocked prompts and confirm that each decision appears once, with the right fields, in the system your security team monitors.
Moving policies from Bedrock Guardrails to open-source rails
This sequence turns Bedrock Guardrails configurations into tested, versioned open-source rails or validators, and proves they behave the same on real traffic before any application endpoint changes.
Export and version current guardrail configurations
Your platform or cloud team exports every Bedrock guardrail in use, including content filter strengths, denied topic definitions, word filters, sensitive information settings and any Automated Reasoning policies, along with the guardrail version each application calls. Store these exports in your own Git repository as the source of truth and record which version identifiers production uses. Keep the Bedrock guardrail versions and the Bedrock configuration unchanged until cutover, so you can always reproduce the baseline. The step is done when every application-to-guardrail-version mapping is written down and reviewed by the owner of each policy.
Classify each policy against the capability map
Compliance, security and product owners work through the exported policies one by one and mark each as a direct map, a partial map or no open-source equivalent. Content filters and denied topics typically map to NeMo Guardrails input and output rails or Guardrails AI validators, word filters map to regex-style validators, and PII masking needs an explicit detection and redaction choice. Automated Reasoning checks have no open-source equivalent in the sources reviewed, so flag them for a documented compensating control or an accepted risk decision. The step is done when each policy has a signed classification and every gap has a named owner.
Rebuild rails and validators in a non-production environment
Engineers build the NeMo Guardrails configuration, or the Guardrails AI guards with their validators from Guardrails Hub, in a staging environment that mirrors the production model endpoint. Pin library versions, confirm the Python version the chosen release supports, and keep configurations in the same repository as the exported baseline. Where a policy maps only partially, document exactly what the replacement catches and misses. The step is done when the replacement runs end to end in staging and each mapped policy has at least one test case.
Build a test set from recorded traffic
Use recorded or sampled prompts and completions, scrubbed of personal data under your own privacy controls, to create a labeled test set covering allowed requests, blocked requests, borderline cases and known jailbreak attempts. Include the categories each Bedrock policy was meant to stop, so the comparison measures the same outcomes. Agree in writing who labels results and what counts as a match. The step is done when the labeled set is stored with its version and reviewers have checked a sample of labels.
Run parallel evaluation against both guardrails
Send the same traffic through the Bedrock guardrail and the open-source replacement in parallel, without showing the replacement's output to end users. Compare blocked and allowed decisions, masked PII output, latency added by each path and any false positives that would stop legitimate work. Review every disagreement and decide whether the rails or the Bedrock baseline is wrong. Record results per policy so the gap list from the classification step is updated with evidence. The step is done when disagreement rates and latency figures are documented and each policy has an accept or fix decision.
Cut over the application endpoint with a rollback path
Change the application to call the self-hosted guardrail endpoint through a feature flag or gateway route, starting with a limited group of traffic, and watch blocked-request rates, error rates and latency. Keep the Bedrock guardrail version attached and the route for the previous path ready so the team can switch back without a code change. Confirm that logging, audit records and access controls on the new endpoint meet your internal requirements before expanding traffic. The step is done when the full traffic share runs on the new path, the rollback has been tested once, and the Bedrock guardrail is retired only after the owner signs off.
Document the final state and retain the baseline
Platform and compliance teams write down the final mapping of each policy to its rail or validator, the accepted gaps, the test results and the version pins for every library and model used. Keep the exported Bedrock configurations and their versions in your records for the period your own retention policy requires, so reviewers can trace why a control changed. Schedule a review of the open-source releases you depend on, since upstream versions change. The step is done when the documentation is stored in the same repository as the configurations and an assessor could follow the chain from policy to test evidence.
How to test the replacement before cutover
Start by recording the decisions you expect before you run anything. For each policy you currently enforce in Bedrock Guardrails, write down the sample inputs and outputs, the expected action (allow, block, mask or flag), and the owner who signed off on that expectation. Build the test set from your own prompts and logs, not from generic jailbreak lists, and include the edge cases your support and compliance teams have actually seen. Keep this expectation sheet separate from the test results so that a change in the open-source stack cannot quietly redefine what counts as correct. Once the sheet is fixed, run the same set through the existing Bedrock configuration and the candidate NeMo Guardrails rails or Guardrails AI validators, so you have a baseline for both.
Measure each policy category separately. For content filters, denied topics and word filters, count false positives (benign prompts that get blocked) and false negatives (violating prompts that pass), and report them per category rather than as one blended score. Add a jailbreak and prompt injection set that covers direct instructions, role-play framing, encoded payloads and instructions hidden in retrieved documents, since the NeMo Guardrails library includes jailbreak and injection detection and you should confirm how it performs on your traffic. For PII masking, use samples in the real formats your systems produce, such as account numbers, national identifiers, phone numbers and free-text fields, and check both that values are masked and that the masked output still supports the downstream task. Time each rail under realistic concurrency, because self-check moderation calls add model round trips and the added latency is what your users will feel.
Some Bedrock controls have no open-source equivalent. Automated Reasoning checks verify model responses against formal rules, and neither NeMo Guardrails nor Guardrails AI provides that capability, so you should document a compensating control before cutover. Options include human review of responses in the affected workflows, deterministic validation against your system of record, or a narrower scope that keeps those answers out of automated paths. Record who approves the compensating control and how you will evidence it to auditors. Before go-live, confirm the rail versions you test against, since NeMo Guardrails 0.25.0 deprecates the LLMRails class in favor of Guardrails, and pin the release you validated.
Questions buyers ask before replacing Bedrock Guardrails
What does replacing Bedrock Guardrails cost, and which components drive it?
The software is free to license under Apache-2.0 for both NeMo Guardrails and Guardrails AI, so the cost sits in people and infrastructure. The main components are engineering time to write rails or validators, selecting and tuning validators from Guardrails Hub, hosting the guardrail service and its model dependencies, building an evaluation set, and ongoing upgrades. One-time work covers design and testing. Recurring work covers patching, upgrades and re-evaluation after model changes. Ask any implementation partner for a quote that separates these items, states who performs each one, and lists what is included in retesting and handover.
How long does a migration off Bedrock Guardrails take?
The duration depends mostly on how many of your Bedrock guardrail policies map directly to open-source rails, how much custom policy text you have, and how many applications send traffic through the guardrail. Teams with simple content filters and PII masking usually have less to rebuild than teams with denied topics, contextual grounding and many applications. Testing against your own prompts and logs is often the longest phase. Ask for a written timeline tied to a defined scope, with the number of policies, applications and environments listed, rather than accepting a general estimate.
Can an internal team replace Bedrock Guardrails without outside help?
An internal team with Python experience and access to a model endpoint can build a working proof of concept with NeMo Guardrails or Guardrails AI. The harder part is operating it as a controlled service: defining policies in Colang or validator configuration, agreeing on false positive and false negative thresholds, wiring logging, running regression tests and keeping the service current. Check whether your team has capacity for ongoing security testing of the guardrails themselves. Many organizations use internal staff for the build and bring in an outside team for security testing, hardening, or a fixed-scope review before go-live.
What do Automated Reasoning check gaps mean for compliance evidence?
Automated Reasoning checks in Bedrock Guardrails have no direct open-source equivalent, so any claim that depended on them must be re-established with other controls. The practical step is to inventory every compliance statement, control or customer commitment that cites those checks, then decide how to evidence the same intent with tested rails, validators, logging and human review. Document the change, the residual risk and the test results. Auditors and certification bodies decide whether that evidence is sufficient. DeployOpen prepares systems, controls and evidence for compliance assessments but does not issue audit reports or certifications.
How do NeMo Guardrails version changes affect ongoing upkeep?
NeMo Guardrails 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a 0.25 migration guide. Any code that instantiates LLMRails should be moved in a planned change, tested, and pinned to a version you have validated. Also note that the NeMo microservice container has been sunset, so do not build on it. Ask your implementation partner to include upgrade handling, regression tests against your rails and a documented process for tracking future releases in the service contract.
Which Bedrock guardrail policies map directly to open-source options?
The following categories have the closest open-source counterparts:
- Content filters and harmful content: self-check input and output moderation and NVIDIA content safety models in NeMo Guardrails, or toxicity validators from Guardrails Hub.
- Denied topics: topic safety rails in NeMo Guardrails written in Colang.
- Word filters and regex-based blocking: regex validators in Guardrails AI.
- PII masking: validators or custom actions that detect and redact personal data, which you must select and test yourself.
Confirm each mapping against your own policy text, since detection quality differs across categories and languages.
How should we test the replacement before cutting over?
Build a test set from real or representative traffic that you are allowed to use, including benign requests that should pass, harmful requests that should be blocked, borderline cases and known jailbreak and injection patterns. Measure false positives and false negatives for each rail, and compare results with your existing Bedrock Guardrails outputs during a parallel run. Keep the test set under version control so each rail change is retested. Ask for security testing of prompt injection and bypass attempts, and confirm that the findings and retest are part of the agreed deliverables.
What compliance reviewers will ask for from guardrails
Compliance reviewers rarely accept a guardrail on its description alone. They will ask for evidence that the policy in force was the policy you intended, that it was tested, and that its decisions can be reconstructed later. For a self-hosted NeMo Guardrails or Guardrails AI deployment, that evidence comes from four artifacts: the guardrail configuration files (Colang flows and model settings for NeMo Guardrails, or the validator chain and its parameters for Guardrails AI), a versioned record of each policy change, the results of the test suite run against that version, and logs of what each rail blocked, masked or passed. Keep configuration in Git so each change has an author, a reviewer and a timestamp, and tag the release that reached production.
Test results matter as much as the configuration. Reviewers will want to see the adversarial and regression cases you ran, which policy version they were run against, and the pass and fail outcomes you recorded before go-live and after each change. Decision logs need a defined retention period, access restricted to the security and compliance roles, and a rule for whether prompts and completions are stored in full or only as hashes and rail identifiers, since stored prompts can themselves contain personal data. Confirm with your assessor which control frameworks apply and what sampling, retention and access evidence they expect, because the wording of those requirements differs by framework and by audit scope.
DeployOpen can prepare these controls and evidence for an assessment, including configuration repositories, change records, test reports and log design. DeployOpen does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations, so the first step is to ask your assessor to confirm the required evidence in writing before the scope of the guardrail work is agreed.
How DeployOpen scopes guardrail replacements
This sequence turns a Bedrock Guardrails configuration into a written, fixed-scope plan for a self-hosted replacement, with tested evidence that the policies work inside your own infrastructure.
Inventory current Bedrock Guardrails policies
DeployOpen reviews every guardrail attached to your Bedrock workloads, including content filter strengths, denied topics, word filters, sensitive information rules and any Automated Reasoning checks, and records which applications and models each one protects. The output is a policy inventory that marks each control as a direct mapping, a partial mapping or a gap with no open-source equivalent. Your team confirms the inventory against the live configuration before work continues.
Map policies to open-source rails
DeployOpen matches each mapped policy to a candidate framework, such as NeMo Guardrails input, dialog and output rails or Guardrails AI validators from Guardrails Hub, and notes where a control needs custom code. Controls with no equivalent, including Automated Reasoning checks, are listed with the compensating control the client would accept, such as a deterministic validator or a human review step. The output is a signed-off mapping document that states the framework and version tested.
Confirm platform and runtime requirements
DeployOpen checks the target environment against the framework requirements, including the supported Python versions for the chosen NeMo Guardrails release, whether the service will run as a library inside an application or as a standalone server, and how it connects to the model endpoints your teams already use. Your platform team confirms network paths, container registry access and whether the environment is connected or air-gapped. The output is an architecture note listing components, interfaces and open questions.
Implement and harden the guardrail service
DeployOpen builds the guardrail configurations as version-controlled files, deploys the service into your infrastructure, and applies access control, secrets handling, logging and resource limits. Where a configuration depends on a model or a validator package, the team pins the version and records how updates will be reviewed. The output is a deployed service in a staging environment with a hardening checklist and configuration repository your team can review.
Test prompt injection and data exposure
DeployOpen runs adversarial tests against the replacement, covering prompt injection and jailbreak attempts, denied topic bypasses, harmful content, PII leakage in inputs and outputs, and retrieval content that carries hostile instructions. Each test is compared with the Bedrock baseline captured in the first step, so the team can see where the replacement is weaker or stronger. The output is a findings report with reproducible test cases and severity ratings.
Document controls and evidence
DeployOpen writes the operating documentation: the policy mapping, configuration change procedure, known gaps, test results and the evidence your compliance and security reviewers will ask for. This material supports your own assessment process, and DeployOpen does not issue audit reports or certifications, so independent auditors remain responsible for any attestation. The output is a documentation package your teams can hand to reviewers.
Agree support and retesting in writing
DeployOpen delivers the fixes identified in testing, retests them, and then agrees a support path in writing. The scope is fixed before work starts, and the quote follows from that written scope. Ongoing upgrades to framework releases, new validators and continuous testing can be covered by a retainer, which you should size against how often your policies and models change. The output is a signed scope, a retest record and an agreed support arrangement.

