'Spy Bill' provides legal framework for agency in operation