Hi John S,
An agent should not need your log in details for your goverment gateway account.
The procedure should be that they will request agent authority digitally via their Agent account and would therefore never require your log in details.
If you believe they are acting fraudulently then please report them using the following link:
Report tax fraud or avoidance to HMRC
Thank you.