The portion before the dash is ambiguous, however since the portion after the dash goes on to describe how CBP agents used social media to discuss "harm", you can safely assume that the second meaning you give is intended. Often context can specify when grammar does not.
In addition typically modifying phrases are closer to the phrase they modify so even in isolation:
Ocasio-Cortez has accused CBP agents of making threats to her life on social media
assuming the threats are on social media is a relatively good assumption.
If the first meaning was intended, the following sentence would be more appropriate:
Ocasio-Cortez has accused, on social media, CBP agents of making threats to her life