To let people into the castle the sentry could only open the gate after an order that could only come from the guard commander, and this order would come after the guard commander had signed the people in.