Problem with getting job state net/http: TLS handshake timeout

My agents intermittently fail to communicate with the agent API, which leads to the agent having an invalid access token, and then losing the agent.

Example logs:

Jun 17 02:52:00 ip-172-31-57-245 buildkite-agent[2558]: 2025-06-17 02:51:59 WARN   buildkite-agent-4cpu-8mem-i-020c2f532839eb9ac-1 Problem with getting job state 01977bc9-6735-4304-8dbf-ee873a4a9554 (Get "https://agent.buildkite.com/v3/jobs/01977bc9-6735-4304-8dbf-ee873a4a9554": net/http: TLS handshake timeout)
Jun 17 02:54:34 ip-172-31-57-245 buildkite-agent[2558]: 2025-06-17 02:54:25 WARN   buildkite-agent-4cpu-8mem-i-020c2f532839eb9ac-1 Problem with getting job state 01977bc9-6735-4304-8dbf-ee873a4a9554 (Get "https://agent.buildkite.com/v3/jobs/01977bc9-6735-4304-8dbf-ee873a4a9554": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers))
Jun 17 02:54:55 ip-172-31-57-245 buildkite-agent[2558]: 2025-06-17 02:54:55 ERROR  buildkite-agent-4cpu-8mem-i-020c2f532839eb9ac-1 Invalid access token, cancelling job 01977bc9-6735-4304-8dbf-ee873a4a9554

What can I do to prevent this from happening?

Hey @healthengine-tom :wave:

Welcome to the Buildkite community!

Could you please send more details—such as build links—to support@buildkite.com so we can continue the investigation over email?

Cheers,
Priya