EXCLUSIVE

Sasha Grey says she was lured into porn by a violent and abusive ex-BF-- who convinced her he was a military spy who needed her for "cover" ... and now she fears he's come back to hurt her.

Grey claims in new court docs Ian Cinnamon subjected Grey to years of abuse and sexual assaults -- starting in 2005 when she was 16 and he was 29.

Grey claims it was Cinnamon who convinced her to become a porn star, telling her he was a covert agent and she would be the perfect "cover" for him. And get this -- he convinced her he worked for the DIA.

Grey claims Cinnamon got physically abusive. On one occasion she told him she forgot to check one of her porn sex partner's STD test and he flew into a rage, hurling household objects at her.

Grey says she broke off the relationship in 2012 ... and recently he started sending her numerous threatening messages ... some showing pictures of handguns.

A judge agreed Cinnamon was a threat ... and has ordered him to stay at least 200 yards from her.