{"id":13663,"date":"2025-05-23T08:12:15","date_gmt":"2025-05-23T16:12:15","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=13663"},"modified":"2025-06-05T11:47:20","modified_gmt":"2025-06-05T11:47:20","slug":"opik-guardrails-release","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/","title":{"rendered":"Announcing Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time"},"content":{"rendered":"\n<p>We\u2019ve spent the past year building tools that make LLM applications more transparent, measurable, and accountable. Since launching Opik, our open source evaluation platform, we\u2019ve shipped dozens of features focused on monitoring, evaluating, and optimizing LLM applications. This includes <a href=\"https:\/\/www.comet.com\/docs\/opik\/evaluation\/overview\">heuristic and LLM-as-a-Judge metrics<\/a>, <a href=\"https:\/\/www.comet.com\/docs\/opik\/tracing\/log_traces\">realtime tracing and monitoring<\/a>, <a href=\"https:\/\/www.comet.com\/docs\/opik\/prompt_engineering\/prompt_management\">prompt management capabilities<\/a>, <a href=\"https:\/\/www.comet.com\/docs\/opik\/prompt_engineering\/playground\">development playgrounds<\/a>, <a href=\"https:\/\/www.comet.com\/docs\/opik\/prompt_engineering\/prompt_optimization\">automatic prompt optimization<\/a>, and so much more.<\/p>\n\n\n\n<p>Today, we\u2019re excited to take a new step in our mission: a public beta of our <strong>Guardrails<\/strong> project\u2014a lightweight system designed to help developers build safer, more robust LLM applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Guardrails?<\/h2>\n\n\n\n<p>As language models continue to unlock new capabilities, they also raise new questions about content safety, privacy, and responsible deployment. For most LLM applications, it is valuable to be able to diagnose problematic behavior post-hoc. For some LLM applications, however, it is *essential* to prevent problematic behavior in the first place.<\/p>\n\n\n\n<p>Towards that end, we\u2019ve heard from many users that what they need most in their workflow is a way to catch \u201cbad behavior\u201d early\u2014whether it\u2019s off-topic or inappropriate generation, the accidental leak of sensitive data, or a so-called \u201cjailbreak\u201d of their application. This is where Guardrails come in.<\/p>\n\n\n\n<p>If you\u2019re unfamiliar, \u201cGuardrails\u201d refer to a broad category of tools for validating the output of an LLM application and intervening in cases where the output is unacceptable. The actual way that these tools go about monitoring and intervening varies quite a bit depending on the tool in question (more on that in a moment), but at a high-level, this is the general behavior.<\/p>\n\n\n\n<p>To put it simply: so far, Opik has been focused on <em>measuring<\/em> behavior. With Opik Guardrails, we\u2019re starting to build tools to help <em>shape<\/em> it<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What We\u2019re Launching<\/h2>\n\n\n\n<p>This initial release is a <strong>public beta<\/strong>. While we\u2019re committed to building a Guardrails product, we\u2019re treating this an initial release as an experimental project, sharing things early so we can learn in the open and gather feedback from real-world use.<\/p>\n\n\n\n<p>The beta consists of a simple <code><strong>REST API<\/strong><\/code>&nbsp;with two backend-hosted endpoints:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Topic Moderation:<\/strong> Uses a fine-tuned BART model to evaluate whether an input falls within a specified topical boundary. Useful for domain-specific assistants or content-limited interfaces.<\/li>\n\n\n\n<li><strong>PII Filtering:<\/strong> Built on Presidio, this endpoint identifies and redacts personally identifiable information (PII) from LLM input or output text.<\/li>\n<\/ul>\n\n\n\n<p>Below, you can see a simple snippet that shows how you might interact with either of these endpoints:<br><script src=\" https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/prism.min.js \"><\/script><br><script src=\"https:\/\/cdn.jsdelivr.net\/npm\/prismjs@1.29.0\/components\/prism-python.min.js\"><\/script><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from opik.guardrails import Guardrail, PII, Topic\nfrom opik import exceptions\n\nguardrail = Guardrail(\nguards=&#91;\nTopic(restricted_topics=&#91;\"finance\", \"health\"], threshold=0.9),\nPII(blocked_entities=&#91;\"CREDIT_CARD\", \"PERSON\"]),\n]\n)\n\nllm_response = \"You should buy some NVIDIA stocks!\"\n\ntry:\nguardrail.validate(llm_response)\nexcept exceptions.GuardrailValidationFailed as e:\nprint(e) <\/code><\/pre>\n\n\n\n<p>For a more advanced exploration, you can read the <a href=\"https:\/\/www.comet.com\/docs\/opik\/production\/guardrails\">Guardrails docs here<\/a>.<\/p>\n\n\n\n<p>In addition, <strong>we&#8217;re enabling support for tracing and logging third-party guardrails libraries<\/strong>\u2014including those that run on the client-side. This means you\u2019ll be able to visualize any guardrails logic within the Opik UI, even if you&#8217;re not using our API directly. The current support relies on logging spans of type &#8220;guardrail&#8221;, if you would like us to add an integration with existing guardrails libraries, please open up a ticket on the Opik Github repo.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"5760\" height=\"3840\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Metrics-tab-Guardrails-2.png\" alt=\"\" class=\"wp-image-13669\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Metrics-tab-Guardrails-2.png 5760w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Metrics-tab-Guardrails-2-300x200.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Metrics-tab-Guardrails-2-1024x683.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Metrics-tab-Guardrails-2-768x512.png 768w\" sizes=\"auto, (max-width: 5760px) 100vw, 5760px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Whether your stack uses custom logic or popular moderation tools, our goal is to make sure Opik can provide you with centralized observability and analysis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why a Public Beta?<\/h2>\n\n\n\n<p>The guardrails space is moving quickly, with a wide variety of tools and approaches emerging. There are no clear standards yet, and we don\u2019t think there will be a one-size-fits-all solution. That\u2019s why we\u2019re building this beta out in the open.<\/p>\n\n\n\n<p>By supporting both our own backend API <em>and<\/em> third-party guardrails libraries, we aim to make Opik a home for <strong>guardrail observability<\/strong>\u2014a shared layer that gives developers insight into how their safety mechanisms are working across the stack.<\/p>\n\n\n\n<p>And just because we\u2019re calling this a public beta does not mean Opik Guardrails are not production-ready. As part of Opik\u2019s operating philosophy, anything we officially release has been built with production in mind. The \u201cbeta\u201d designation refers more to rapidly the project will be developed, and how much change you can expect as you build with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What\u2019s Next<\/h2>\n\n\n\n<p>This is just the beginning. Over the next few months, we\u2019re exploring:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Jailbreak detection and prevention<\/li>\n\n\n\n<li>Toxicity scoring<\/li>\n\n\n\n<li>Harmful instruction filtering<\/li>\n\n\n\n<li>Deeper integration with Opik\u2019s evaluation tooling and scoring pipelines<\/li>\n<\/ul>\n\n\n\n<p>We&#8217;re especially interested in how guardrails can feed back into the same evaluation workflows developers are already using, and how some of the same techniques popularized in LLM evaluations (like LLM-as-a-Judge metrics) can be repurposed and adapted for guardrails.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Get Involved<\/h3>\n\n\n\n<p>You can start using the Guardrails beta right now by following on with our quickstart:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.comet.com\/docs\/opik\/production\/guardrails\">Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/comet-ml\/opik\/tree\/main\/apps\/opik-guardrails-backend\">GitHub Repo <\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/slack.comet.com\/\">Community Slack<\/a><\/li>\n<\/ul>\n\n\n\n<p>Whether you\u2019re building safety systems, customizing moderation flows, or just experimenting, we\u2019d love to hear what you think.<\/p>\n\n\n\n<p>Thanks for building with us \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019ve spent the past year building tools that make LLM applications more transparent, measurable, and accountable. Since launching Opik, our open source evaluation platform, we\u2019ve shipped dozens of features focused on monitoring, evaluating, and optimizing LLM applications. This includes heuristic and LLM-as-a-Judge metrics, realtime tracing and monitoring, prompt management capabilities, development playgrounds, automatic prompt optimization, [&hellip;]<\/p>\n","protected":false},"author":140,"featured_media":13668,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[65,9],"tags":[],"coauthors":[124],"class_list":["post-13663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-llmops","category-product"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time<\/title>\n<meta name=\"description\" content=\"Build safer LLM apps with Opik&#039;s Guardrails\u2014moderate output in real time with topic filters, PII detection, and support for third-party tools.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Announcing Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time\" \/>\n<meta property=\"og:description\" content=\"Build safer LLM apps with Opik&#039;s Guardrails\u2014moderate output in real time with topic filters, PII detection, and support for third-party tools.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-23T16:12:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-05T11:47:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Team Comet\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team Comet\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time","description":"Build safer LLM apps with Opik's Guardrails\u2014moderate output in real time with topic filters, PII detection, and support for third-party tools.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/","og_locale":"en_US","og_type":"article","og_title":"Announcing Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time","og_description":"Build safer LLM apps with Opik's Guardrails\u2014moderate output in real time with topic filters, PII detection, and support for third-party tools.","og_url":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2025-05-23T16:12:15+00:00","article_modified_time":"2025-06-05T11:47:20+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg","type":"image\/jpeg"}],"author":"Team Comet","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Team Comet","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/"},"author":{"name":"Caroline Borders","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/8500e2f020e85676c245e00af46bae3c"},"headline":"Announcing Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time","datePublished":"2025-05-23T16:12:15+00:00","dateModified":"2025-06-05T11:47:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/"},"wordCount":801,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg","articleSection":["LLMOps","Product"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/","url":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/","name":"Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg","datePublished":"2025-05-23T16:12:15+00:00","dateModified":"2025-06-05T11:47:20+00:00","description":"Build safer LLM apps with Opik's Guardrails\u2014moderate output in real time with topic filters, PII detection, and support for third-party tools.","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#primaryimage","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/05\/Opik-Optimization-Guardrails.jpg","width":1920,"height":1080,"caption":"Opik guardrails"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/opik-guardrails-release\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Announcing Opik\u2019s Guardrails Beta: Moderate LLM Applications in Real-Time"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/8500e2f020e85676c245e00af46bae3c","name":"Caroline Borders","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/77bfb2d62bc772cc39672e46e3e8059f","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/12\/cropped-1672334331755-2-96x96.jpeg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2024\/12\/cropped-1672334331755-2-96x96.jpeg","caption":"Caroline Borders"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/carolineb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/13663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=13663"}],"version-history":[{"count":2,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/13663\/revisions"}],"predecessor-version":[{"id":16308,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/13663\/revisions\/16308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media\/13668"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=13663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=13663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=13663"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=13663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}