Therein lies your problem.
You either grant permission and “trust” the third-party App - accepting the theoretical risk that the App might “snoop” on your keyboard input - or opt to use the system keyboard.
If privacy and security are your principal concern, use of a third-party keyboard might not be you best option.
Be aware that some third-party keyboards can be used without granting additional permissions. In operating in this mode, the third-party keyboard is still usable - but without some of the advanced functions that may be provided by the keyboard.
One such example is TypeFinity - whose impacted functionality is described here:
https://typefinity.com/privacy