I guess it could be both... Greyhat is the in-between from white which I would assume is anyone doing secure systems vs. blackhat which is full on attacks. The greyhat sits somewhere in between, not specifically part of the government. Elliot from Mr. Robot would of been a Greyhat in my book. Though if they work for the government it depends on whom you tell and what the hacker we're talking about is doing, some could easily consider them blackhat government hackers... while others completely white, and of course you would consider them gray.
Personally I view greyhat as immoral/unethical but not illegal