We reference page 2 of the passport, and it's the basic biographic information. That is an international civil aviation standard, the machine-readable zone. You'll see it at the bottom of every passport. That field for gender has two values: it has M and it has F. Those are the only two reserved values for male and female. Then issuing authorities can put whatever other marker in there to address people who don't identify with a specific gender. That's the international standard. That's what this is based on. So all the passport readers that are out there along the land border in the U.S. and in Canada are set up to read that.
On October 3rd, 2017. See this statement in context.