RubyLLM::TopSecret is a new gem that automatically filters personally identifiable information (PII) from RubyLLM conversations before they reach third-party LLM providers. It addresses compliance concerns like HIPAA and GDPR by replacing sensitive data with placeholders, then restoring them in responses. For in-memory chats, wrap code with `RubyLLM::TopSecret.with_filtering`. For ActiveRecord-backed chats, simply add the `acts_as_filtered_chat` macro to the model, with optional conditional filtering via an `if:` parameter.

2m read timeFrom thoughtbot.com
Post cover image
Table of contents
Sign up to receive a weekly recap from thoughtbotEnter RubyLLM::TopSecretIf you enjoyed this post, you might also like:

Sort: