18 USC § 3121(b)
The use of a pen\/trap device generally requires a court order. But just as with the Federal Wiretap Act, there are several exceptions. The Pen\/Trap statute states that providers may use pen\/trap devices without a court order when \(1\) relating to the operation, maintenance, and testing of a wire or electronic communication service or to the protection of the rights or property of such provider, or to the protection of users of that service from abuse of service or unlawful use of service; or \(2\) to record the fact that a wire or electronic communication was initiated or completed in order to protect such provider, another provider furnishing service toward the completion of the wire communication, or a user of that service, from fraudulent, unlawful or abusive use of service; or \(3\) where the consent of the user of that service has been obtained. The first and third exceptions, setting out the service provider and consent exceptions, are the most important for our purposes.