Rightshold™ Sign up

Answers · agent controls

How do I return tiered API responses for verified AI agents vs anonymous bots, without blocking human browsers?

Last updated

TL;DR: Serve capability tiers, not a single allow/deny wall. Classify every request into a response class before you build the body: human browser (session or ordinary HTML), verified agent (short-lived credential or checked Web Bot Auth signature with scope), anonymous automation (no usable identity), and verified search crawler (allowlisted). Humans keep the full public page. Verified agents get a machine-shaped payload sized to their scope — for example catalog summaries at scope marketplace:browse, contracted prices and hold ids only at marketplace:paid_read. Anonymous bots get a stable public stub or 401 with WWW-Authenticate telling them how to present a credential (RFC 7235), not a CAPTCHA that burns your human challenge budget. This is graceful degradation by identity: the same URL can return different fields by Accept and by verified tier, without cloaking the human HTML search engines need. It is not a rate-limit page (that is about counting) and not a hard gate that refuses every unpaid field (that is covered separately).

What should I check, step by step?

1. Define three or four response classes up front: public_summary, human_html, agent_scoped (keyed by credential scope), and deny_or_challenge for unverified automation on sensitive routes.

  1. Classify before serialization: verify the agent credential or Web Bot Auth signature first, then pick the response builder. Do not build the paid body and strip fields afterwards — that leaks timing and accidental fields.
  2. Keep human HTML honest and indexable on the marketing or product URL. Put dense machine feeds on /api/... or negotiate with Accept: application/json so crawlers and shoppers are not served a hollow page.
  3. For verified agents, map scope → fields. A browse-tier credential returns ids, titles and public prices; a paid-read credential adds contract prices, inventory holds and PII your agreement allows. Missing scope on an otherwise valid credential is 403 Forbidden (RFC 7235 / RFC 7231), not a silent empty list.
  4. For anonymous automation on agent-oriented routes, return 401 Unauthorized with a WWW-Authenticate challenge that names your agent credential scheme and a link to registration docs. Do not send that client through a browser CAPTCHA.
  5. Use one stable JSON error shape (code, message, how_to_upgrade) so agents can branch. Prefer not to reveal whether a hidden SKU exists when the caller lacks the tier that may see it.
  6. Log class, credential id (if any), scope and HTTP status so you can see whether humans were accidentally folded into the bot path.
  7. Test three clients on the same path: a logged-out browser, a credentialed agent, and curl with no auth. The browser must still get usable HTML; only the agent path should change with scope.

Why should API responses for AI agents use capability tiers instead of a single allow or deny?

A hard gate answers yes or no. A tiered response answers how much: public stub, scoped agent JSON, or full human page. Marketplaces and SaaS APIs need the middle option so cooperative agents can work without you opening every field to scrapers.

How do I classify verified agents, humans and anonymous bots before building an API response?

Order of checks: (1) is this a verified search crawler you allowlist for HTML? (2) is there a valid, unrevoked agent credential (or Web Bot Auth signature) with scope for this route? (3) is there a human session? (4) otherwise treat as anonymous automation.

How do I keep human browsers on full HTML when AI agents get tiered API responses?

Graceful degradation fails when a bot fight breaks the shop. Do not put ordinary browsers into the anonymous-automation 401 path. Session or first-party cookie traffic stays on human_html even when an agent from the same NAT is limited.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Before I build this API response, verify the caller's agent credential and tell me whether it still has marketplace:browse so I can return the browse-tier JSON instead of a 401.”

One-click setup

{
  "tool": "verify_agent_credential",
  "arguments": {
    "id": "crd_<id from the Authorization header>",
    "scope": "marketplace:browse"
  }
}

Rightshold verifies credentials and records intents you send. It does not host your API or choose your field lists; your handler must pick the response class after verification. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'