The pre-emptive attack against the Barbary pirates was under the Jefferson administration.
one of the few oil paintings of the USS Constitution-Old Ironsides- is of her, under full sail off the Barbary coast making her presence felt, and trolling for pirates.