When building enterprise applications on top of LLMs, data privacy and compliance (e.g., GDPR, HIPAA, or SOC2) are paramount.By default, an observability and debugging stack might log full prompt payloads, which can inadvertently capture PII (Personally Identifiable Information) or proprietary internal secrets.Open Next Router gives you the flexibility to sanitize traffic at the DSL level so that downstream sinks never see the raw payloads.
Redacting Headers
If clients are passing sensitive authorization tokens or internal identities in custom headers, you should drop them before the request hits the network egress or the traffic dump logger.
request { # Strip out client-identifying correlation IDs del_header "X-Client-Trace-Id"; # Strip out any downstream Auth headers you don't want logged or forwarded del_header "Authorization";}
(Note: ONR evaluates the downstream Authorization header to route the request before executing these del_header directives, so deleting it here is safe from a routing perspective and ensures it is stripped from upstream egress).
Obfuscating JSON Payloads
If you are dumping traffic logs (traffic_dump.enabled=true in your onr.yaml) to debug upstream interactions, you might want to mask or entirely delete the actual prompt content (messages) while continuing to trace the rest of the metadata (like temperature, max tokens, and usage).Use the json_del directive to scrub sensitive arrays:
request { # Completely removes the conversational prompt history json_del "$.messages";}response { # Remove the generated response text from the return log json_del "$.choices";}
Selective Anonymization
Instead of deleting the entire messages array, you might want to replace a specific explicit field with a static “[REDACTED]” string flag.
request { # Assume your client passes a special identifying parameter json_set "$.user_id" "ANONYMOUS_USER";}
Important Note on Analytics:
Keep in mind that if you actively use json_del or json_set to scrub messages or content strings, this mutation affects the actual HTTP request sent to the provider.Currently, json_del is applied universally to the inflight payload. If you strip the prompt, the upstream LLM will receive an empty prompt! To solve this, pure log-masking (masking out of logs but retaining the payload for the request) is configured natively via your Datadog or Loki ingestion parsers. Always rely on observability-side redaction (via Promtail/Loki filters) if the data is absolutely required for the LLM inference.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Open Next Router","description":"A lightweight, DSL-driven LLM gateway for routing, compatibility transforms, and streaming normalization across providers.","colors":{"primary":"#0B5FFF","light":"#3B82F6","dark":"#1D4ED8"},"favicon":"https://mintcdn.com/onr/U2NfwB9j8fCK5Fwa/favicon.svg?fit=max\u0026auto=format\u0026n=U2NfwB9j8fCK5Fwa\u0026q=85\u0026s=c357fc88f1aeff7737232daa0fc071f5","background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://github.com/r9s-ai/open-next-router","type":"github"},{"href":"https://t.me/opennextrouter","label":"Telegram"},{"href":"https://discord.gg/HBM67dP8","type":"discord"}]},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"onr","hasAudioNarration":false,"actualSubdomain":"onr","customDomains":[],"gitSource":{"type":"github","owner":"r9s-ai","repo":"onr-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10d4759ffae5051c40c878"},"entitlements":{},"buildId":"6b1252cb8b151dfd160e514a","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Documentation","count":49},{"language":"default","tag":"DSL","count":15},{"language":"default","tag":"Blocks","count":9},{"language":"default","tag":"Guides \u0026 Cookbooks","count":7},{"language":"default","tag":"Core Flow","count":6},{"language":"default","tag":"Concepts \u0026 Design","count":5},{"language":"default","tag":"API","count":4},{"language":"default","tag":"Configuration","count":4},{"language":"default","tag":"Community \u0026 Contributing","count":4},{"language":"default","tag":"Start","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/logging-masking","slug":"/guides/logging-masking","pageMetadata":{"title":"Logging and Masking","description":"Redacting sensitive user data in production.","href":"/guides/logging-masking"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Redacting sensitive user data in production.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`When building enterprise applications on top of LLMs, data privacy and compliance (e.g., GDPR, HIPAA, or SOC2) are paramount.`}),`\n`,_jsx(_components.p,{children:`By default, an observability and debugging stack might log full prompt payloads, which can inadvertently capture PII (Personally Identifiable Information) or proprietary internal secrets.`}),`\n`,_jsx(_components.p,{children:`Open Next Router gives you the flexibility to sanitize traffic at the DSL level so that downstream sinks never see the raw payloads.`}),`\n`,_jsx(Heading,{level:`2`,id:`redacting-headers`,children:`Redacting Headers`}),`\n`,_jsx(_components.p,{children:`If clients are passing sensitive authorization tokens or internal identities in custom headers, you should drop them before the request hits the network egress or the traffic dump logger.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`nginx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`nginx`,children:_jsxs(_components.code,{language:`nginx`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Strip out client-identifying correlation IDs`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` del_header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Client-Trace-Id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Strip out any downstream Auth headers you don't want logged or forwarded`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` del_header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsxs(_components.em,{children:[`(Note: ONR evaluates the downstream `,_jsx(_components.code,{children:`Authorization`}),` header to route the request before executing these `,_jsx(_components.code,{children:`del_header`}),` directives, so deleting it here is safe from a routing perspective and ensures it is stripped from upstream egress).`]})}),`\n`,_jsx(Heading,{level:`2`,id:`obfuscating-json-payloads`,children:`Obfuscating JSON Payloads`}),`\n`,_jsxs(_components.p,{children:[`If you are dumping traffic logs (`,_jsx(_components.code,{children:`traffic_dump.enabled=true`}),` in your `,_jsx(_components.code,{children:`onr.yaml`}),`) to debug upstream interactions, you might want to mask or entirely delete the actual prompt content (`,_jsx(_components.code,{children:`messages`}),`) while continuing to trace the rest of the metadata (like temperature, max tokens, and usage).`]}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`json_del`}),` directive to scrub sensitive arrays:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`nginx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`nginx`,children:_jsxs(_components.code,{language:`nginx`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Completely removes the conversational prompt history`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` json_del`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$.messages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Remove the generated response text from the return log`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` json_del`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$.choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`selective-anonymization`,children:`Selective Anonymization`}),`\n`,_jsxs(_components.p,{children:[`Instead of deleting the entire `,_jsx(_components.code,{children:`messages`}),` array, you might want to replace a specific explicit field with a static “[REDACTED]” string flag.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`nginx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`nginx`,children:_jsxs(_components.code,{language:`nginx`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Assume your client passes a special identifying parameter`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` json_set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"$.user_id\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ANONYMOUS_USER\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Important Note on Analytics:`}),`\nKeep in mind that if you actively use `,_jsx(_components.code,{children:`json_del`}),` or `,_jsx(_components.code,{children:`json_set`}),` to scrub `,_jsx(_components.code,{children:`messages`}),` or content strings, this mutation affects the actual HTTP request sent to the provider.`]}),_jsxs(_components.p,{children:[`Currently, `,_jsx(_components.code,{children:`json_del`}),` is applied universally to the inflight payload. If you strip the prompt, the upstream LLM will receive an empty prompt! To solve this, pure log-masking (masking out of logs but retaining the payload for the request) is configured natively via your Datadog or Loki ingestion parsers. Always rely on observability-side redaction (via Promtail/Loki filters) if the data is absolutely required for the LLM inference.`]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Logging and Masking","description":"Redacting sensitive user data in production.","href":"/guides/logging-masking"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Redacting Headers","slug":"redacting-headers","depth":2,"children":[]},{"title":"Obfuscating JSON Payloads","slug":"obfuscating-json-payloads","depth":2,"children":[{"title":"Selective Anonymization","slug":"selective-anonymization","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"onr","siteName":"Open Next Router","title":"Logging and Masking - Open Next Router","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-02-27T04:07:23.343Z","originalFileLocation":"guides/logging-masking.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Redacting sensitive user data in production.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Open Next Router\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Logging and Masking - Open Next Router\">\u003cmeta data-mint-head property=\"og:description\" content=\"Redacting sensitive user data in production.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Open Next Router\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://onr.mintlify.app/guides/logging-masking\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://onr.mintlify.site/_mintlify/api/og/v2?division=Guides+%26+Cookbooks\u0026amp;title=Logging+and+Masking\u0026amp;description=Redacting+sensitive+user+data+in+production.\u0026amp;theme=ccef3d9a380b30756f0f5b4b\u0026amp;signature=378819fba0cfb1567e10de3466ca6a2780c0a231f0483b51fea9982216f9fecf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Logging and Masking - Open Next Router\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Redacting sensitive user data in production.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://onr.mintlify.site/_mintlify/api/og/v2?division=Guides+%26+Cookbooks\u0026amp;title=Logging+and+Masking\u0026amp;description=Redacting+sensitive+user+data+in+production.\u0026amp;theme=ccef3d9a380b30756f0f5b4b\u0026amp;signature=378819fba0cfb1567e10de3466ca6a2780c0a231f0483b51fea9982216f9fecf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/onr/CeTW9W2B1vDDPTKQ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Open Next Router\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0B5FFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://onr.mintlify.app/guides/logging-masking\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/logging-masking.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://onr.mintlify.app/#organization\",\"name\":\"Open Next Router\",\"url\":\"https://onr.mintlify.app\"},{\"@type\":\"WebSite\",\"@id\":\"https://onr.mintlify.app#website\",\"name\":\"Open Next Router\",\"url\":\"https://onr.mintlify.app\",\"publisher\":{\"@id\":\"https://onr.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://onr.mintlify.app/guides/logging-masking#webpage\",\"url\":\"https://onr.mintlify.app/guides/logging-masking\",\"name\":\"Logging and Masking\",\"description\":\"Redacting sensitive user data in production.\",\"dateModified\":\"2026-02-27T04:07:23.343Z\",\"isPartOf\":{\"@id\":\"https://onr.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://onr.mintlify.app/guides/logging-masking#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://onr.mintlify.app/guides/logging-masking#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides \u0026 Cookbooks\",\"item\":\"https://onr.mintlify.app/guides/load-balancing\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Logging and Masking\",\"item\":\"https://onr.mintlify.app/guides/logging-masking\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://onr.mintlify.app/guides/logging-masking#article\",\"headline\":\"Logging and Masking\",\"name\":\"Logging and Masking\",\"description\":\"Redacting sensitive user data in production.\",\"url\":\"https://onr.mintlify.app/guides/logging-masking\",\"mainEntityOfPage\":{\"@id\":\"https://onr.mintlify.app/guides/logging-masking#webpage\"},\"dateModified\":\"2026-02-27T04:07:23.343Z\",\"publisher\":{\"@id\":\"https://onr.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://onr.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Open Next Router\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Open Next Router\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/logging-masking.md","siteName":"Open Next Router","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Start","icon":"rocket","expanded":true,"pages":[{"title":"Open Next Router","href":""},{"title":"Quickstart","href":"/getting-started/quickstart"},{"title":"Installation","href":"/getting-started/install"},{"title":"Run From Source","href":"/getting-started/run-from-source"}]},{"group":"Updates","icon":"rss","expanded":false,"pages":[{"title":"Changelog","href":"/changelog"}]},{"group":"Guides \u0026 Cookbooks","icon":"book-open-reader","expanded":false,"pages":[{"title":"Load Balancing \u0026 Fallbacks","href":"/guides/load-balancing"},{"title":"Authentication Setup","href":"/guides/auth-setup"},{"title":"Request/Response Rewriting","description":"Modify headers, parameters, and JSON payloads inflight.","href":"/guides/request-response-rewriting"},{"title":"Logging and Masking","href":"/guides/logging-masking"},{"title":"Client Attribution","description":"Segmenting traffic and identifying upstream clients via the appname field.","href":"/guides/client-attribution"},{"title":"Meterry Billing Integration","href":"/guides/meterry-billing"},{"title":"Distributed Deployment with Redis","href":"/guides/distributed-deployment"}]},{"group":"Ecosystem \u0026 Tools","icon":"toolbox","expanded":false,"pages":[{"title":"ONR Admin \u0026 CLI Tools","href":"/ecosystem/admin-panel"},{"title":"ONR Language Server (LSP)","href":"/ecosystem/onr-lsp"},{"title":"Observability Stack","href":"/ecosystem/observability"}]},{"group":"Configuration","icon":"sliders","expanded":false,"pages":[{"title":"onr.yaml","href":"/configuration/onr-yaml"},{"title":"keys.yaml","href":"/configuration/keys-yaml"},{"title":"models.yaml","href":"/configuration/models-yaml"},{"title":"Reload","href":"/configuration/reload"}]},{"group":"API","icon":"plug","expanded":false,"pages":[{"title":"API Overview","href":"/api/overview"},{"title":"Token Key (onr:v1?)","href":"/api/token-key"},{"title":"OpenAI-Compatible Endpoints","href":"/api/openai-compatible"},{"title":"Gemini Native API (v1beta)","href":"/api/gemini-native"}]},{"group":"DSL","icon":"code","expanded":false,"pages":[{"title":"DSL Overview","href":"/dsl/overview"},{"title":"Conventions","href":"/dsl/conventions"},{"title":"Include Directive","href":"/dsl/include"},{"title":"Top-Level Structure","href":"/dsl/top-level"},{"title":"Match Rules","href":"/dsl/match"},{"title":"Expressions \u0026 Variables","href":"/dsl/expressions"},{"group":"Blocks","icon":"layer-group","expanded":false,"pages":[{"group":"Core Flow","icon":"route","expanded":false,"pages":[{"title":"Upstream Config Block","href":"/dsl/blocks/upstream-config"},{"title":"Auth Block","href":"/dsl/blocks/auth"},{"title":"Request Block","href":"/dsl/blocks/request"},{"title":"Upstream Block","href":"/dsl/blocks/upstream"},{"title":"Response Block","href":"/dsl/blocks/response"},{"title":"Error Block","href":"/dsl/blocks/error"}]},{"group":"Data \u0026 Metadata","icon":"chart-line","expanded":false,"pages":[{"title":"Metrics Block","href":"/dsl/blocks/metrics"},{"title":"Models Block","href":"/dsl/blocks/models"},{"title":"Balance Block","href":"/dsl/blocks/balance"}]}]}]},{"group":"Concepts \u0026 Design","icon":"lightbulb","expanded":false,"pages":[{"title":"Why ONR","href":"/concepts/why-onr"},{"title":"Architecture","href":"/concepts/architecture"},{"title":"Request Lifecycle","href":"/concepts/request-lifecycle"},{"title":"Observability","href":"/concepts/observability"},{"title":"Dashboards","href":"/concepts/dashboards"}]},{"group":"Reference","icon":"book-open","expanded":false,"pages":[{"title":"CLI Reference","href":"/reference/cli"},{"title":"Access Log Fields","href":"/reference/access-log-fields"}]},{"group":"Community \u0026 Contributing","icon":"users","expanded":false,"pages":[{"title":"Development Guide","href":"/contributing/development-guide"},{"title":"Testing Guide","href":"/contributing/testing-guide"},{"title":"Release Process","href":"/contributing/release-process"},{"title":"Writing Providers","href":"/contributing/writing-providers"}]}]}]},"basePath":"","title":"Logging and Masking - Open Next Router","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":[],"chunks":[]}