DEV Community

No Form
No Form

Posted on

Building a consent-preserving auth.md skill for OpenClaw agents

Signup forms were designed for humans with browsers. AI agents get a 401 and have nowhere to go.

auth.md (WorkOS, MIT) changes that: a tiny Markdown file at your domain tells any agent how to register — what flows you support, what endpoints to hit, what scopes it’ll get.

I just shipped an OpenClaw skill that implements the user-claimed flow end-to-end:

openclaw skills install auth-md-signup
Enter fullscreen mode Exit fullscreen mode

The flow in 90 seconds

  1. Agent sees 401 WWW-Authenticate: Bearer resource_metadata="…"
  2. Two-hop discovery: PRM → AS metadata → agent_auth block
  3. POST anonymous registration → gets claim_token
  4. Asks you for your email in-channel
  5. Service emails OTP → you paste it back
  6. POST claim/complete → scoped, revocable credential stored

Why the OTP step is non-negotiable

The agent can’t complete signup without you. No silent account creation, no credential exfiltration. The human OTP step is the consent gate — remove it and you remove the accountability that makes delegated signup trustworthy.

The reference implementation uses NoForm — which hosts auth.md infrastructure for services that don’t want to build it themselves. The skill works with any auth.md-compliant service.

Error handling built in

Code What happens
otp_invalid Ask user to retry (max 3x)
otp_expired Offer to re-send OTP
claim_expired Restart anonymous registration
previously_claimed Tell user, stop
anonymous_not_enabled Tell user, stop

Revocation

One call to revocation_uri with the token. Agent deletes it locally. Your account stays intact.

Links

Top comments (0)