gitwtfhub

wtf is guardrails-llm-filter?

cloud-ru-tech/guardrails-llm-filter — explained in plain English

Analysis updated 2026-05-18

104GoAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TL;DR

A proxy that sits between your app and an AI provider, masking sensitive data like emails and API keys before it reaches the model, then restoring the originals in the response.

Mindmap

mindmap
  root((repo))
    What it does
      Masks sensitive data
      Restores originals in replies
      Works with streaming
    Tech stack
      Go
      Docker
      Prometheus
    Use cases
      Privacy layer for LLM APIs
      Compliance auditing
      Detect mode testing
    Audience
      Developers
      Ops teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Add a privacy layer in front of an LLM API so customer emails, API keys, and IDs never reach the provider.

REASON 2

Test what would be masked in detect mode before turning on full enforcement.

REASON 3

Monitor masking activity with Prometheus metrics and a Grafana dashboard.

REASON 4

Run a local demo with a fake LLM to see masked requests and restored responses.

What's in the stack?

GoDockerPrometheusGrafana

How it stacks up

cloud-ru-tech/guardrails-llm-filterscion-frontiers/farmtableaymanhs/nanotdb
Stars104104102
LanguageGoGoGo
Setup difficultymoderatemoderatemoderate
Complexity3/53/53/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Needs a running LLM provider endpoint and API key to point the proxy at.

Free to use, modify, and distribute, including commercially, as long as you keep the copyright and license notice.

Wtf does this do

guardrails-llm-filter is a proxy server, written in Go, that sits between your application and an AI model provider such as OpenAI or Anthropic. Instead of sending requests straight to the provider, your app points at this proxy, and the only change needed is the base URL setting. When a request passes through, the proxy scans it with close to 265 built in rules and replaces anything sensitive, such as email addresses, API keys, access tokens, IP addresses, and personal identifiers like Russian passport or tax numbers, with placeholders such as <EMAIL_1>. The AI model only ever sees the placeholder text, never the real data. When the model sends back a reply, the proxy swaps the placeholders back for the original values before the response reaches your app, including replies that stream back piece by piece and tool call arguments the model generates. The detection step relies on regular expressions and checksum validation rather than a machine learning model, so it adds only microseconds to each request and does not call out to any external service. If something goes wrong inside the proxy, it is built to let traffic through rather than block it, so a bug in the filter does not take down your app. There is a built in web console reachable on a separate port, with pages for an overview of activity, the list of detection rules, a sandbox for testing text against the live rules, settings, an audit log of what was masked and when, and monitoring. It also exposes Prometheus metrics and ships with a ready made Grafana dashboard. A detect only mode lets you see what the proxy would mask without actually changing any traffic, which can be switched to full enforcement through the API without redeploying. The project supports the OpenAI style chat completions and responses endpoints as well as the Anthropic messages endpoint, covering both plain JSON replies and streaming ones. It ships as a Docker image and can also be built from source with a standard Go toolchain. It is released under the Apache 2.0 license, and a companion project packages the same detection engine as an Envoy sidecar for teams using a service mesh.

Yoink these prompts

Prompt 1
Show me how to run guardrails-llm-filter in Docker and point it at my OpenAI-compatible provider.
Prompt 2
Help me configure GUARDRAILS_PATHS so this proxy also masks a custom API path.
Prompt 3
Explain how to switch guardrails-llm-filter from detect mode to enforce mode through its API.
Prompt 4
Walk me through wiring up Prometheus and Grafana monitoring for guardrails-llm-filter.

Frequently asked questions

wtf is guardrails-llm-filter?

A proxy that sits between your app and an AI provider, masking sensitive data like emails and API keys before it reaches the model, then restoring the originals in the response.

What language is guardrails-llm-filter written in?

Mainly Go. The stack also includes Go, Docker, Prometheus.

What license does guardrails-llm-filter use?

Free to use, modify, and distribute, including commercially, as long as you keep the copyright and license notice.

How hard is guardrails-llm-filter to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is guardrails-llm-filter for?

Mainly ops devops.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.