Block bot sign-ins and see which clients Guard flags
Guard flags a request as a bot when its User-Agent header matches an HTTP library or a browser automation tool, such as curl, python-requests, HeadlessChrome, Selenium, or Puppeteer. When you set the action of bot_detection to block, Guard rejects each flagged sign-in request before Auth checks a password or sends a code.
Impact
The sample sets bot detection to block for the Juniper Lane Outfitters app and requests the 100 most recent Guard events with readEvents. For the events whose detections include bot_detected, the sample counts how many come from each User-Agent, so that your team can see which clients Guard flags most often.
Prompt for a coding agent: Block bot sign-ins, and count the flagged requests by User-Agent.
Select a file to view its contents