$ cat how-to-redact-sensitive-information-from-your-ruby-on-rails-application-before-sending-it-to-an-ai.md

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. 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 [SSN_1] and my name is [Name_1]"

You can check out Top Secret here on Github.

  • Finder
    Finder
  • Jesse Waites
    Jesse Waites
  • Xcode
    Siri
  • Simulator
    Simulator
  • Testflight
    Testflight
  • SF Symbols
    SF Symbols
  • Icon Composer
    Icon Composer
  • Sketch
    Sketch
  • VS Code
    VS Code
  • Postgres
    Postgres
  • Android Studio
    Android Studio
  • Trash
    Trash