The new department is charged with patrolling borders , analyzing U.S. intelligence , responding to emergencies and guarding against terrorism , among other tasks .