Further down clarifies that the agreement only triggered for defense, not offense
> According to the terms of their agreements, Germany was obliged to come to the aid of Japan if a third country attacked Japan, but not if Japan attacked a third country. Ribbentrop reminded Hitler of this, and pointed out that to declare war against the US would add to the number of enemies Germany was fighting, but Hitler dismissed this concern as not being important,[3] and, almost entirely without consultation, chose to declare war against the US, wanting to do so before, he thought, American president Franklin D. Roosevelt would declare war on Germany.
> According to the terms of their agreements, Germany was obliged to come to the aid of Japan if a third country attacked Japan, but not if Japan attacked a third country. Ribbentrop reminded Hitler of this, and pointed out that to declare war against the US would add to the number of enemies Germany was fighting, but Hitler dismissed this concern as not being important,[3] and, almost entirely without consultation, chose to declare war against the US, wanting to do so before, he thought, American president Franklin D. Roosevelt would declare war on Germany.