A policy which allows British security service agents to commit serious criminal activities including violence is lawful, a tribunal ruled by a slim majority on Friday.