Project

form_guard

0.0
The project is in a healthy, maintained state
FormGuard provides a simple way to prevent bot form submissions in Rails applications using honeypot fields and timestamp-based validation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.16

Runtime

>= 6.0, < 8.0
>= 6.0, < 8.0
 Project Readme

Form Guard

Form Guard is a lightweight gem to protect your forms from bots and spammy submissions using a simple and effective honeypot + timing strategy.

Installation

Add this line to your application's Gemfile:

gem 'form_guard'

And then execute:

bundle install

Usage

  1. Add hidden guard field to your forms:
<%= form_guard_fields %>

How it works

  • Bots tend to fill all fields — including hidden ones. If the honeypot is filled, the submission is rejected.

  • Bots submit instantly. If the form is submitted too quickly (under 2 seconds), it’s probably a bot.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/amigobg/form_guard.

License

The gem is available as open source under the terms of the MIT License.