Prime Minister Stephen Harper introduced legislation that would greatly expand the role of the spy service, allowing courts to remove online postings and increasing police detention powers.