Alternative API for setting error messages?

I was able to add custom messages by peaking into your unit tests:

configure do
  def self.messages
    Dry::Validation::Messages.default.merge(en: { errors: { foobar?: 'custom error' } })
  end
  
  def foobar?(value)
    value.match(/foobar/)
  end

end

Is monkey patching the messages class method, a safe way to do ‘one-off’ / non-yaml based error messages? Should I worry about this interface changing frequently?

Messages#merge is going to stay. You could also (I think…) just do super.merge(...).