The card data has a legalities table which marks cards as banned or allowed for some formats. A new validation rule should be created which validates that the cards present in the deck are all legal for the format.