Shamkhani had close ties with the former DM who was a spy and was executed. Vouched for him IIRC. I suggest you read up on the backstory, it isn’t a pretty picture for him, at best shows he was incompetent and at worst….complicit.
If it wasn’t for his power and stature, he would be investigated deeply by IRGC Intelligence.
Coincidentally enough ‘he left’ the Security Council shortly after that incident after a decade on one of the most powerful decision making bodies inside Iran. Some may say typical rotation, but to me it seems he was demoted.
The issue is given how many high ranking moles US and NATO had in Soviet Union power structure or even in Nazi Germany when a general attempted to assassinate Hitler at private meeting of Nazi Brass and almost succeeded. Thus logic would presume that there are at least 2-3 very high level officials acting as spies in Iran for the US/Israel.