Rightshold™ Sign up

Answers · agent controls

How do I require a verified agent credential before an API returns paid or sensitive data?

Last updated

TL;DR: Treat paid catalog rows, PII, inventory holds and settlement fields as a gated resource: anonymous and browser-session clients get a public summary or a 401/403, and only a request that presents a short-lived, scoped agent credential (or a Verified AI Run proof you accept for that route) receives the full payload. Verify the credential on every call — not revoked, not expired, config hash still matches if you bind one, scope covers this route — then authorize the exact operation. Prefer sender-constrained tokens (OAuth DPoP, RFC 9449) or a proof-of-possession signature so a leaked bearer string is useless without the agent's key. robots.txt and User-Agent checks are not this gate: RFC 9309 is voluntary crawl preference, not authorization. Deny anonymously with a stable error body that tells a well-behaved agent how to obtain a credential, without leaking whether a hidden SKU exists.

What should I check, step by step?

1. Classify responses: public (OK anonymously), authenticated-human (session or user OAuth), and agent-only (paid feeds, bulk export, PII, holds, prices under contract). Only the last class needs an agent credential gate.

  1. Require a credential on agent-only routes: Authorization header or signed proof carrying a crd_... (or your issuer's equivalent) with audience = your API and scope that names the route or data class.
  2. Verify on every request: signature or proof-of-possession, expiry, revocation list, optional config_hash binding, and scope ⊇ requested operation. Cache the public revocation feed with a short TTL; fail closed if verification is unavailable for sensitive routes.
  3. Prefer sender-constrained credentials: OAuth 2.0 DPoP (RFC 9449) binds the access token to a key the client proves per request; a stolen token without the private key fails. Short TTL (minutes) plus refresh at your broker beats a long-lived API key in the agent's env.
  4. For high-value answers, optionally require a Verified AI Run receipt id that proves which model/config produced the request context you are willing to honour, then still check the agent credential that presents it.
  5. Deny anonymously with 401 or 403 and a machine-readable error (code, how to register, link to your agent docs). Do not return partial paid fields, different SKU existence signals, or slower timing that lets agents probe what sits behind the gate.
  6. Keep human HTML pages free and indexable when that is your product: the gate belongs on the API that returns paid JSON, not on the marketing URL search engines need. Distinct URLs or Accept-driven negotiated resources beat cloaking the same URL.
  7. Log credential id, scope, decision and response class for audit; revoke on abuse without rotating every human password.

What the gate is checking

Identity: who is accountable for this agent (owner verification tier), and that the credential is still live. Rightshold's free verify answers validity, revocation and optional scope in one call.

Short-lived proof beats a long-lived key in the prompt

RFC 9449 DPoP has the client send a fresh signed proof JWT with method, URL, time and token hash on each call; the resource server checks the binding. Agents copy context into logs and tools, so bearer API keys leak easily; a proof-of-possession token limits replay.

Denying anonymously without teaching scrapers your catalog

Use one error shape for "no credential" and "credential lacks scope" on paid routes if distinguishing them would reveal whether a SKU or person exists. Put the detailed reason in server-only logs.

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 return this paid catalog row, verify the caller's agent credential is valid for marketplace:paid_read and not revoked.”

One-click setup

{
  "tool": "verify_agent_credential",
  "arguments": {
    "id": "crd_<id from the Authorization header>",
    "config_hash": "<hash the agent presents, if bound>",
    "scope": "marketplace:paid_read"
  }
}

Rightshold verifies credentials and run receipts you ask about. It does not host your marketplace API or decide your pricing; your handler must refuse the payload when verification fails. 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}}'