If you are running an AI voice agent that calls back web leads, you have a legal problem that is actually a code problem. Your agent will happily dial a prospect at 10:40 p.m. unless you explicitly stop it. Halyard Ops, a new AI and software studio, has released a small, dependency-free guard function to solve this exact issue. The tool encodes federal and state-specific calling windows and includes a test suite to ensure compliance logic holds up under edge cases.

The Rules Encoded in the Guard

The utility enforces the federal window of 8 a.m. to 9 p.m. under 47 CFR Β§ 64.1200(c)(1), but it also accounts for stricter state laws. For instance, Florida and Maryland limit calls to 8 a.m. to 8 p.m. and cap outbound attempts at three per 24-hour period for the same subject. Oklahoma presents a unique challenge due to conflicting statutes; the guard resolves this by applying the overlap of the 2022 act and an older synthesized-voice statute, resulting in a 9 a.m. to 8 p.m. window. New York and Virginia allow calls up to 9 p.m. unless prior consent is established, a nuance the code notes but does not automatically enforce without stored consent data.

Handling the Time Zone Ambiguity

The hardest part of compliance is knowing where the person actually is. An area code is a weak signal; a Maryland number might be answered in Los Angeles. To handle this, the guard takes every potential time zone associated with the leadβ€”from the browser’s IP location to the street address on the formβ€”and only allows the call if the current time is inside the legal window for all of them. If the signals disagree, the stricter clock wins, ensuring the agent never accidentally crosses a legal boundary due to location ambiguity.

Testing and Limitations

The code includes an 18-case test suite running on Node 26, verifying edge cases like daylight saving time shifts and multi-zone conflicts. A key test ensures that a call intended for a Maryland number located in Los Angeles is blocked if it falls outside the Eastern Time window, even if it is technically within the Pacific Time window. However, the guard is not a complete compliance solution. It does not handle consent overrides for New York and Virginia, nor does it account for holidays, Sundays, or the other forty-odd states not covered in the initial table. It also does not verify the FCC 24-17 ruling requiring prior express consent for AI-generated voices, leaving that validation to the user’s form and records.

Key Takeaways

  • The guard uses a conservative default, applying calling windows to all callbacks to minimize legal risk.
  • It resolves time zone conflicts by requiring the call to be legal in every possible zone associated with the lead.
  • Oklahoma’s conflicting laws are handled by applying the most restrictive overlap (9 a.m. to 8 p.m.).
  • The tool is a starting point for adaptation, not a full legal compliance product.

The Bottom Line

This is a solid, pragmatic starting point for developers who need to stop their AI agents from making illegal calls, but you still need to build the consent and holiday logic yourself.