Agents In Use
What’s new todayLast update
499 additions

How to use Claude to verify MFA with Playwright

A Claude SDK agent used Playwright and a small Python TOTP implementation to configure MFA and verify an authentication change in a preview instance.

TRY A BOUNDED VERSION

Prompt to try

Editorial adaptation, not the source author’s exact prompt. Replace bracketed inputs and review tool permissions first.

For [pull request] in [preview environment], inspect the code and create a UAT plan. Use Playwright to enable MFA and create a test user. Build a small Python TOTP device for the test, verify the changed MFA behavior, and capture screenshots and results for review.

What happened

The author says the agent verified that MFA still worked as expected, probed more functionality than planned, and incurred a token price of $5.69.

Reported by beaugunderson on Hacker News

How the agent did it

  1. Create a test plan using knowledge of the application code.
  2. Enable MFA by changing the preview instance configuration.
  3. Create a user with MFA enabled in the instance.

Where a person stepped in

The author reports the successful run but does not describe independent human review of its test results.

A person set the goal and reviewed the result.

The author built a user acceptance testing agent on top of claude-agent-sdk. It uses Playwright and can start preview instances for pull requests. The agent draws on its knowledge of the code to create a test plan, runs that plan, and takes screenshots during execution.

A recent pull request changed the application's multifactor authentication implementation. The author expected to test it manually because MFA requires setup and a TOTP device. Instead, the agent used Playwright to change the instance configuration and enable MFA. It then created a user with MFA enabled and wrote a small Python TOTP implementation to serve as the authentication device.

The author says the agent successfully verified that MFA still worked as expected. They also described its functionality probing as more exhaustive than the substantial testing they had planned for this sensitive change. The reported token price for the run was $5.69. The excerpt does not detail an independent human review of the agent's test results.

Who it's for: Teams with preview environments that want browser-driven acceptance testing for authentication changes involving setup and one-time codes.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: Hacker News · beaugunderson

Frequently asked questions

How did the agent supply a TOTP device?

It wrote a small Python TOTP implementation and used that as the device during verification.

What did the author report about cost?

The author reported a total token price of $5.69 for the UAT run.

More details

Remaining steps

  1. Write a small Python TOTP device and verify MFA behavior.

About this account

The UAT agent generated and executed a test plan, configured MFA, and built a TOTP device without the expected manual setup.

Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=48758367. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.

Credit: beaugunderson on Hacker News

Source published 2 Jul 2026

Source checked 14 Oct 2026

Tools and topics

claude-agent-sdk · Playwright · Python TOTP

Agent workflows

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.