added ability to get an AgentId from the SecurityContext