Pat the boneless leg of lamb dry thoroughly with paper towels. Season it generously on every side with kosher salt and freshly ground black pepper.
Select the sauté function on the Instant Pot and pour in the olive oil. When the oil is heated, add the lamb carefully and sear it on all sides until well browned, allowing a few minutes per side.
Place the rack in the bottom of the Instant Pot so the roast does not rest directly in the liquid. Pour the water into the bottom of the pot, taking care not to pour it over the meat. Set the browned lamb on the rack.
Secure the lid and cook using the meat/stew setting for 25 to 35 minutes, depending on the desired doneness. For reference, a 4-pound leg of lamb generally requires about 30 minutes for medium-rare.
Once the cooking cycle is complete, allow the pressure to release naturally for 10 minutes. After that, carefully release any remaining pressure. Check the internal temperature with an instant-read thermometer. If further cooking is needed, return the lamb to the pot briefly or finish it in the oven.
Preheat the broiler. Remove any netting from the lamb, then spread the crushed garlic and chopped rosemary over the top and sides.
Transfer the lamb to a baking dish and place it under the broiler, positioning it about 6 inches from the heat. Broil for about 2 minutes, or until the surface is nicely browned and aromatic.
Remove the lamb from the oven and let it rest for 10 minutes before slicing. Serve warm with your preferred side dishes.