Source: https://jessewaites.com/blog/post/how-to-redact-sensitive-information-from-your-ruby-on-rails-application-before-sending-it-to-an-ai

# How to redact sensitive information from your Ruby on Rails application before sending it to an AI

*August 11, 2025*

Our friends over at thoughtbot have just released [Top Secret](https://github.com/thoughtbot/top_secret). Top Secret is a Rubygem that redacts sensitive information from free text before that text gets sent off to an AI LLM for processing. For example:

```
raw_text = "My SSN is 123-45-6789 and my name is Keyser Soze"

filtered_text = TopSecret::Text.filter(raw_text)

filtered_text.output

# => "My SSN is &#91;SSN_1] and my name is &#91;Name_1]"
```

[You can check out Top Secret here on Github](https://github.com/thoughtbot/top_secret).
