AgentRights Node client: explicit retry identity for website-policy checks

I’m building AgentRights, a commercial early-beta API for source-linked summaries of websites’ stated automated-access, scraping and AI-use policies. I’m sharing the client design here because I’d value feedback from people building web-research agents.

The service supplies policy context alongside robots.txt checks. It does not grant permission or provide legal advice, and there is no native Hugging Face/smolagents integration yet.

The small Node.js client uses an existing bundle and deliberately separates a check from purchasing credits:

  • Each logical check requires an explicit stable request ID, sent as Idempotency-Key.
  • An interrupted request preserves the original domain and ID for a manual retry. It never generates a new ID simply to retry.
  • A 402 response stops the example; it does not purchase credits or sign a payment.
  • Redirects are refused, the service origin is fixed, and the bearer key stays in a private environment variable.
  • Each invocation makes one request with a 30-second timeout. Server/transport error details are not echoed because they could contain credentials.

The tradeoff is less convenience: the caller has to retain request identity and handle recovery explicitly. The client is intended to avoid an agent turning a retry into an unintended new action; it is not a general guarantee that every server implements idempotency correctly.

Readable guide: https://agentrights-web.zachdalphis.workers.dev/quickstart.txt
Client source: https://agentrights-web.zachdalphis.workers.dev/agentrights-check.mjs

For research-agent builders: would you keep this explicit manual-retry boundary, or put retries in a durable task queue that persists the original inputs and ID? And for the policy output itself, are source excerpts more useful than structured fields or a human-review checkpoint?

Disclosure: this is my product and the API is paid. The example uses existing credits only. Sandbox payments are tested, but completed real-payment settlement and paid-credit delivery have not been verified end to end. I am not claiming the service can determine whether scraping is lawful. Thanks for concrete technical feedback.

Keep the manual boundary for anything that could spend, and put a durable queue underneath it for the rest: persist the request ID with the exact inputs before the first attempt, retry only when the outcome is unknown (timeout, dropped connection), and never retry — with any ID — after a definite answer like a 402. For the output, structured fields are what an agent can act on, but keep the source excerpt attached to each field so the decision stays checkable, and route to a human only when a field and its excerpt disagree. One test worth running early: interrupt a check mid-request, retry with the same ID, and confirm the server records exactly one check.