That wouldn't work that way. The Gmail app on Android isn't extensible with plugins. At that point, it'd make more sense to just have some web or third party service filter the emails themselves from GMail and not make the client (app) responsible for it (be it Gmail or some third party app).
If you're determined to have the Android app do it and don't want to give your actual password, you'd want to use something that uses some type of OAuth login, which basically has you sign in through Google and it grants the app "access" (you never give your password to the app to sign in for you, you just tell Google to authorize it, so Google continues to manage your password).