How to capture prompts and responses in NeMo Guardrails traces without exposing PII
Content capture is the setting that decides whether prompts and responses are written into your traces, and it should be settled before you choose a tracing backend. A team running NeMo Guardrails in production often needs to see why a request was blocked or how a rail behaved on a specific turn. That evidence sits in the content: the user's message, the retrieved chunks, the model's draft answer and the text a rail rejected. The same content may contain names, account numbers, health details or other personal data, so capturing it turns your trace store into a copy of that data. Content capture adds the text itself to spans and events, which is most useful during debugging, incident review and rail tuning, and least useful for routine latency or error dashboards.
Decide the capture scope per environment before any trace leaves the guardrails server. A common pattern is to keep content off in production by default, enable it temporarily for a named investigation, and never enable it in a shared development backend that holds real customer data. Write down who may turn capture on, how long it may stay on, and which rails and fields are in scope. Then check whether your data protection obligations allow personal data to be copied into a telemetry system at all. Those answers shape the choice of backend, because a tracing store with short retention, restricted roles and encryption at rest is a very different risk from a general log platform that many teams can search.
The researched facts do not include the configuration keys for content capture in NeMo Guardrails, and the names and behavior can change between releases. Confirm the exact setting, its default and the span attributes it writes in the NeMo Guardrails documentation for the version you run, starting from the NeMo Guardrails documentation. Test the setting in a non-production environment with synthetic PII, then inspect the stored spans and the export path to confirm that masked or excluded fields are really absent from the backend, including any logs the Collector forwards.
Content capture options and when each fits
This table compares four levels of detail a team can record in NeMo Guardrails traces, from metadata only to captured content with redaction or sampling. Read each row for what it helps you debug, what personal data it can expose, and which environments it suits. Confirm the availability of each option against the NeMo Guardrails version and telemetry setup you run, since capture settings can change between releases.
| Capture level | What you can debug | Personal data exposure and fit |
|---|---|---|
| Metadata only | Request timing, configuration names, which rails ran and overall latency, without seeing any message text | Low exposure. Suits production by default and most shared observability backends |
| Rail outcomes and block reasons without message text | Which rail fired, whether a request was blocked, and the category of the block, so you can spot false positives in aggregate | Low to moderate. Block reasons can still hint at user intent. Suits production with access limited to operations staff |
| Full prompts and responses | Exact user input, model output and intermediate rail inputs, which is the fastest route to reproducing a blocked or wrong answer | High exposure. Personal data, credentials and regulated records can appear in traces. Suits development and tightly controlled staging only |
| Captured content with redaction or sampling | Enough message content to reproduce most issues, with fields masked or only a small share of requests stored | Reduced but not removed. Redaction rules miss unexpected personal data, so test them against sample traffic. Suits controlled production review with approval |
| Availability by NeMo Guardrails version | Confirm which content fields the OpenTelemetry adapter emits in your release and whether sampling is configurable | Confirm before you plan. Field names and defaults can differ between library versions and the guardrails server |
| Retention and access needs | Longer retention supports investigations and audits but widens the period in which personal data is held | Confirm your backend's retention and role controls match the most sensitive level you enable |
Where captured content travels between the guardrails server and the trace backend
The path starts at the client application, which sends a user prompt to the NeMo Guardrails server. The server runs input rails, calls the LLM, then runs output rails, and each step can add prompt or response text to a span. Before anything leaves the server, the OpenTelemetry exporter is the hand-off point where a redaction step can run, and the collector and backend sit behind further trust boundaries. Check who can query the backend storage at each boundary, because anyone with read access to traces can read whatever content was captured.
Content path from client prompt through guardrails rails to the trace backend and its readers.
What a guardrail trace contains and where prompts reach the backend
Every guardrail request produces a trace whose spans follow the path the request takes through the rails, so the places where message text can land are determined by that path. A request enters through the Python API or the guardrails server HTTP endpoint, passes through input rails, then dialog rails, then the LLM call, then output rails before the response returns. Each rail execution and each model call can become a span, and a parent span groups them under one request. Before you enable content capture, map this path against your own configuration: list which input and output rails are active, which custom actions run, and which model endpoints the configuration calls, because a span exists only where the library instruments that step.
Message text can enter a trace in more than one place. The user message reaches input rails and any self-check prompt, the model reply reaches output rails, and retrieved chunks reach retrieval rails. Each of those steps may write the prompt, the completion or the rail's intermediate text into span attributes, and a self-check rail sends the content to a second model call that has its own span. Moderation and PII checks therefore see the same text more than once. The OpenTelemetry tracing topic in this group covers the span names and GenAI attribute conventions, so use it as the reference rather than this page. The attributes that carry message content differ by version, so confirm the exact keys emitted by the release you have installed (0.25.0 is the current release on PyPI) by running a test request against a non-production exporter and inspecting the output.
Plan the backend as a place where prompts now live. Once content is captured, the trace store, the collector and any intermediate queue hold personal data and possibly confidential business text, so each of them needs the same classification as the application database. Ask your platform team which backend will receive spans, who can query it, how long traces are kept and whether the collector drops or redacts attributes before export. Write those answers down before the first capture, because changing them later means reprocessing data already stored.
Privacy risks that PII in traces creates
Captured prompts and responses carry whatever users, documents and tools put into them, so a trace store can become a second copy of personal data. The risks below follow the data from the moment a request arrives to the moment a stored trace is deleted, and each one names the control that narrows it without removing it entirely.
Personal data in user prompts
Users type names, account numbers, health details and addresses into assistants without thinking about where that text goes next. With content capture on, those fields are written to the trace backend alongside the rail and model spans. Before enabling capture, sample real traffic from a non-production environment and list the personal data categories that appear. Pair capture with an input PII rail where your policy requires masking before storage, and confirm that the rail runs before the trace exporter sees the content.
NeMo Guardrails docsPersonal data echoed from RAG chunks
Retrieval rails return document chunks that may contain customer records, case notes or employee data, and the model can repeat those details in its answer. The response is then captured even though the user never typed it. Identify which knowledge bases feed the assistant and whether their chunks are stored in traces. Check the output path as well as the input path, and ask whether masking applies to retrieved content as well as to the final response.
Credentials and secrets pasted into prompts
Engineers and support staff sometimes paste API keys, tokens, connection strings or session cookies into a chat to get help. Those values are not personal data in the usual sense, but they grant access once copied into a trace. Scan captured fields for secret patterns before export, and rotate any credential that appears in a trace. Treat this as an incident, not a debugging artifact, and document who receives the alert.
Copies that spread to collectors and backups
A single captured prompt can be copied to the OpenTelemetry Collector, a log pipeline, a search index, a data warehouse and nightly backups. Deleting it from the primary backend does not remove those copies. Map every hop the trace takes in your environment, including sidecars and any vendor exporter, and confirm which of them persist content. Ask the team that operates each hop for its retention and deletion procedure.
Broad query access by engineers
Most people who can open a trace dashboard can read every prompt in it, including those belonging to other teams or customers. Debugging access is often granted to whole engineering groups by default. Restrict the trace backend to named roles, separate production content from development content, and log who queries captured fields. Review these access logs on a schedule that your privacy and security teams agree on.
Content kept longer than review needs
Traces are often kept for the default retention of the backend because nobody set a shorter one for content-bearing spans. A trace captured for a single incident review may remain for months or years. Decide the review window with your privacy and legal teams, set a retention period on the backend for content attributes, and test that expiry actually deletes the stored content. Keep the decision and the test result as evidence.
Steps to turn on content capture in a test environment
This sequence moves content capture from an agreed purpose to a tested, documented setting in a non-production environment. Each step ends with a check that shows whether personal data stays out of traces before any real traffic is involved.
Agree the capture purpose and data classes
Before anyone changes a setting, the security owner, the privacy owner and the team that will read traces agree in writing why content is captured, such as debugging blocked requests. The record lists which data classes may appear in traces, who may read them and how long the team expects to need them. The step is done when both owners sign the record. Check that each named reader can state the allowed data classes without looking at the document. If the purpose is vague or the owners disagree, stop here.
Enable capture in a non-production configuration
Turn on content capture only in a non-production deployment that sends telemetry to its own backend, not to the production store. Find the exact setting name in the documentation for the NeMo Guardrails release you run, and confirm it there rather than copying it from another version or a blog post. The step is done when the change is recorded in version control. Check the configuration diff: the capture setting should appear in the test environment only, and the production configuration should be unchanged. A failure looks like one shared file deployed to both environments, or a test instance pointed at the production trace index.
Send synthetic personal data through test prompts
Prepare test prompts that contain fabricated names, email addresses, phone numbers, account numbers and card-like strings that belong to no real person. Send them through each path the application uses, including input rails, any dialog flows, retrieval steps and output rails. Record each synthetic value and the path it was sent through. Then search the trace backend for every value. The step is done when every test case has a recorded result. A failure looks like a synthetic value appearing in a span attribute, a log line or an exported file, which means the capture is exposing raw content.
Confirm redaction and exclusion controls work
Test each control your design relies on, such as masking rules, exclusion of specific attributes and the behavior for blocked requests. Confirm that the rail decision and its outcome remain visible while the personal data is removed. Repeat the synthetic test and check traces, logs and any other exported records, not only the trace viewer. The step is done when each synthetic value is masked or absent in every store. Treat a control that looks correct in the user interface but still leaves raw text in exported spans or logs as not ready, and keep capture off until it is fixed and retested.
Verify access and retention on the backend
Work with the trace backend owner to confirm who can query the store, whether query results and exports include content, and what retention period is configured. Ask the owner to show the access list and the retention setting, and compare them with the signed purpose record. The step is done when both match the record. Check that an account outside the reader list cannot view captured content. A failure looks like broad group access, default retention that nobody chose, or a backend with no named owner.
Document the setting and its owner
Write one record that lists the setting name, the NeMo Guardrails version, the environment, the named owner, the allowed data classes, the retention period, the access list and the date of each test. Attach the synthetic test cases and their results. Store the record where the security and privacy owners can review changes to it. The step is done when someone who did not run the tests can find the setting, its owner and the evidence. A failure looks like an owner listed as a team name with no individual accountable for it.
Plan the production change as a separate review
Only after the earlier steps pass, draft a production change request. It should repeat the synthetic tests against a production-like setup, name the approving owners and describe the rollback: turning the setting off and restricting or purging stored content, with the backend owner confirming how that is done. Submit the request for review as a separate change. The step is done when the approvers sign it. Check the request for the approvers, the test evidence and the rollback steps. A failure looks like a production enablement proposed without a retest or without a defined rollback.
Setting content capture retention and access controls on the trace backend
Development traces are usually built from synthetic or test data, which makes them the safest place to switch on full content capture while engineers learn how rails behave. The risk is less about the data itself and more about habit: developers copy real customer prompts into test cases, and a trace store left open to the whole engineering group becomes a quiet copy of production content. Keep the controls light but explicit, and write down which data is allowed in development.
- Retention period: Set a short window in your own policy, and confirm that the trace backend can enforce it automatically rather than relying on someone to clean up.
- Who may query: Limit access to the engineers building the configuration, not the whole company.
- Access grants: Use individual accounts or a development group in your identity provider, with no shared credentials.
- Encryption: Confirm whether the backend encrypts data at rest and whether connections use TLS, even on a laptop-hosted collector.
- Deletion requests: Confirm how the backend deletes traces by trace or by time range, and document who runs it.
Before enabling capture, confirm that developers have been told not to paste live customer data into test prompts.
Staging is where you test rails against realistic traffic, often with copies of production prompts or replayed requests. Captured content here may contain personal data even when the environment is not production, so it deserves more than development controls. The main decision is whether staging holds production-like content at all, and if it does, it should be governed as if it were production for access purposes.
- Retention period: Take the period from your data classification policy for non-production data that contains personal data, and keep it shorter than production unless a test cycle requires otherwise.
- Who may query: Restrict queries to the team running evaluations and the security reviewers who sign off on rail changes.
- Access reviews: Review the access list on a schedule you define, and remove accounts for people who have moved off the project.
- Encryption: Require encryption in transit between the guardrails server, collector and backend, and confirm encryption at rest for the storage volumes.
- Deletion requests: Confirm whether a deletion request from production reaches staging copies, since replayed content can carry the same personal data.
Check whether any staging trace store is reachable from outside the network segment that holds it.
In production, captured prompts and responses are personal data in most organizations, and the trace store becomes an additional system of record for it. Content capture should be enabled for specific debugging windows or specific configurations where the value justifies the exposure, rather than left on everywhere. Access should follow a named business purpose, and each query should be attributable to a person.
- Retention period: Set the period from your privacy notice and retention schedule, and confirm the backend can delete on that schedule per index, stream or tenant.
- Who may query: Restrict content queries to a small on-call and security group, separate from people who can read aggregate metrics.
- Access grants: Grant access through your SSO provider with role-based groups, time-limited elevation for incident work, and logged approvals.
- Encryption: Enforce TLS for every hop and confirm encryption at rest, including backups and snapshots of the trace store.
- Deletion requests: Document how a data subject request maps to trace identifiers and confirm that the backend supports targeted deletion, including from backups where your policy requires it.
Confirm each of these features in the backend's own documentation before you rely on them.
Regulated production, such as banking, healthcare or public sector workloads, adds evidence obligations on top of the production controls. Auditors will want to see that the retention period was set deliberately, that access is reviewed, and that deletion can be shown to work. The controls should be designed so the evidence is produced as a byproduct of normal operation, not assembled for each review. Independent auditors and certification bodies decide whether controls are adequate; your job is to make the controls testable.
- Retention period: Take the period from the regulation and internal policy that governs the data, and record the basis for it in your records of processing.
- Who may query: Require documented approval for each content query, with the approver, purpose and ticket reference stored alongside the query log.
- Access reviews: Run recurring reviews of who holds content access, with evidence of each review kept for the auditor.
- Encryption and keys: Control the encryption keys under your key management process, and confirm the backend supports the key arrangement your policy requires.
- Deletion proof: Test deletion end to end, including backups, and keep a record that shows the deletion ran and what it removed.
Ask your compliance team which retention and deletion evidence they need before the capture design is finalized.
Debugging blocked requests without keeping full message text
The goal of this section is to find which rail blocked a request and why without storing the message text that caused the block. Most blocking questions can be answered from the trace structure alone: the rail outcome, the block reason, the rail name and the request or trace identifier. Keep these fields on every request, because they are low-risk and they answer the first questions a reviewer asks: did an input rail, a dialog rail, a retrieval rail, an execution rail or an output rail stop the request, and which configuration handled it. Engineers can then confirm the rail's behavior by reproducing the request in a test environment with synthetic input. The mechanics of verbose mode, explain() and the trace fields that record block reasons are covered in the debugging topic, so this section focuses on the policy around them.
Full message text should be the exception. Capture message text only for a named, time-limited investigation. Before enabling it, record who asked for it, which configuration and rail are under review, the reason the structural fields were insufficient, and the date on which capture must be turned off. Link that record to an approval from the owner of the data, such as the privacy or security lead for the application, and confirm that the approval names the backend where the text will land. Disable capture when the window closes, and check that the backend's retention rules delete the text it already holds. Your own team should decide the approval workflow and the window length, since no standard duration applies to every organization. Confirm with your privacy office whether a blocked prompt that contains personal data counts as a record that must be held under a particular schedule.
What to confirm about content capture in your NeMo Guardrails version
Content capture depends on details that change between releases, deployment modes and telemetry backends. The cards below list what to confirm in your own environment before prompts or responses reach a trace store. Check the library and server image you actually run, since the guardrails microservice has been sunset.
Current configuration keys for capture
Confirm the exact configuration keys that control whether message text is recorded in traces for the version you run. Keys can be renamed or moved between releases, so read the configuration reference for your version rather than copying settings from an older blog post or an example config. Set the key in a non-production environment first, send a test prompt containing a dummy identifier, and confirm whether that text appears in the exported span. Record the release number next to the result so the setting stays tied to a version.
- Current release
- 0.25.0
Span attributes that carry message text
Identify every span attribute that can hold prompt, response, retrieved chunk or action output text. Message content may appear in LLM call spans, rail spans and custom action spans, and each location needs its own review. Export a sample trace to a local collector and search all attribute values for a known test string. Treat any attribute that holds raw text as a field to exclude or mask before the data leaves your network.
Redaction hooks in your version
Check whether the version in use provides a hook or option to redact, hash or drop content before it is exported, and whether that hook runs before or after span attributes are written. Do not assume a redaction option exists because a PII rail exists, since input and output rails filter model traffic, not telemetry. If no hook exists, plan a collector-side processor that removes sensitive attributes, and test it with the same dummy identifier used in your capture check.
Telemetry backend storage and deletion
Confirm where the backend stores captured text, how long it is kept by default, who can query it, and how a deletion request removes text from storage, indexes, backups and exports. Ask the backend vendor or operator for written answers, because a span that is deleted from the primary store may still exist in object storage snapshots or a downstream analytics copy. Document the retention period you choose, set it in the backend, and test a deletion end to end.
Library and server image parity
Verify that the Python library and any server image you build from the Dockerfile emit the same span attributes, honor the same configuration keys and apply the same redaction behavior. Compare exported traces from both paths with the same input. Note that the guardrails microservice container was sunset in October 2026 with no new releases, so any server-based deployment must be checked against NVIDIA NeMo Helix, which now carries the NeMo Platform repository, before you rely on a configuration you tested elsewhere.
NeMo Helix repositoryWhat content capture costs and what the work needs from your team
What drives the effort of a content capture rollout in NeMo Guardrails?
The effort depends less on turning a setting on than on deciding what the traces may hold and who may read them. The main drivers are how many applications and configurations emit traces, how many rail types and LLM calls you record, whether prompts and responses carry personal or regulated data, and how much redaction logic you must write and test before anything is stored. Each additional tracing backend, retention tier or access group adds configuration and review work. Ask the vendor to break effort down by these items so each one is visible in the scope.
How long does scoping and testing a content capture setup take?
The supplied facts do not give a duration for this work, so treat any figure you hear as something to verify against a written scope. Timing is set by the number of configurations to cover, how many data classes need a redaction decision, whether your OpenTelemetry Collector and backend already exist, and how many review cycles your privacy and security teams need before sign-off. A test cycle that uses synthetic prompts containing fake personal data is usually quicker to plan than one that must be validated against production traffic. Ask for the milestones and the approval points in the written plan.
What does the work need from security, privacy and platform teams?
Each team owns a different decision, and the work stalls if any of them is missing. Privacy or legal staff should define which data categories may appear in traces, how long they may be kept and who may request deletion. Security staff should review access to the tracing backend, authentication for the people who query it, and audit logging of those queries. Platform engineers own the collector, storage, encryption and the deployment itself. Agree on these owners before scoping starts, because redaction rules and retention periods cannot be set by the engineers who write the code alone.
Can an internal team set up content capture without outside help?
Yes, a team that already runs OpenTelemetry and a tracing backend can enable content capture internally, provided it has time for the privacy and access decisions. The harder parts are rarely the configuration flags. They are writing and testing redaction for personal data, setting retention that matches policy, restricting who can read raw prompts, and producing evidence that those controls work. Internal teams often underestimate the review cycle. Outside help makes sense when the people who would design those controls are already committed elsewhere or when an assessment needs documented, repeatable evidence.
What is one-time work and what recurs after content capture goes live?
The initial build is one-time: scoping, configuration, redaction design, backend setup and the first test pass. Recurring work includes retention reviews to confirm that stored traces are deleted on schedule, access reviews to confirm that only the right people can query raw content, and updates to redaction rules when new data types appear in prompts or when NeMo Guardrails configurations change. Upgrades to the library or the collector can also change which fields are emitted, so each upgrade needs a check that content is still captured only where intended. Ask whether these recurring tasks sit inside the initial scope or in a separate support arrangement.
What should I ask for in a written quote for content capture work?
Ask for a quote that lists each deliverable in plain terms: the configurations covered, the tracing backend and its hosting, the redaction rules and how they will be tested, the retention settings and deletion process, the access model and audit logging, and the handover documentation. Request the assumptions behind the scope, such as which data classes are in play and who signs off each decision, and the client responsibilities, such as access to environments and named reviewers. Confirm what happens if scope changes during testing and how acceptance will be checked. DeployOpen works from a written scope, so the quote should follow from that document.
Does a content capture engagement make traces compliant with a framework?
No. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue any audit report or certification. A well-scoped content capture setup gives assessors documented retention periods, access restrictions, redaction tests and audit logs to review. Ask your assessor which evidence they expect before the build starts so that the testing produces it.
How DeployOpen scopes and delivers content capture controls
DeployOpen approaches content capture as a controlled change to your infrastructure, not a switch to flip. We scope which prompts and responses may be recorded, where the trace backend runs, and who can read it, then build and document those controls in your environment so your security and compliance teams can review them.
How we scope
- Agree in writing which NeMo Guardrails spans may carry prompt and response content and which must stay out of traces
- Map the trace backend, its storage location and every team that would hold read access
- Define the PII risk review, retention period and deletion process before any capture is enabled
- Engagements are fixed-scope, with deliverables and timelines agreed before work starts
How we build
- Configure content capture in the guardrails deployment and confirm exactly what each span contains
- Connect the trace pipeline to the OpenTelemetry backend you run, inside infrastructure you control
- Apply access controls, encryption and retention settings to the trace store according to the agreed design
- Test with synthetic PII samples to confirm that capture, masking and deletion behave as documented
How we hand over
- Deliver a written configuration record covering capture settings, data flows, retention and access roles
- Document the review procedure for debugging blocked requests so engineers use captured content only as approved
- Provide runbooks for purging trace data, rotating credentials and responding to an exposure
- Walk your operations and security teams through the controls and the evidence each one produces
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover
- Re-test capture settings when the NeMo Guardrails version, configuration or trace backend changes
- Confirm with your legal and privacy teams which retention periods and access rules apply to your data
- Review trace access logs and retention jobs on the cadence agreed in the retainer

