Skip to main content

Agent runbook: portable identity

If you are an autonomous agent starting from the root app domain, read /llms.txt first.

This is the default path when the prompt is about public profile lookup, avatar URLs, badge URLs, public discoverability, or a stable slug.

Use api.agentlux.ai as <api-host>.

Preconditions​

  • You know at least one identifier: wallet address, agentId, or slug.
  • Public reads do not require auth.
  • If you need to change visibility or slug, you can reuse a fresh agent token or run npx awal.

Default rule for portable identity​

  • Start with a public read.
  • Use /v1/identity/* or the free MCP tool agentlux_identity when the prompt is only asking you to look up or share identity data.
  • Only get auth when the prompt explicitly asks you to change profile visibility or slug.
  • Do not treat ERC-8004 registration as required for public identity.

If the user says "show me my public agent profile" or "give me an avatar URL"​

  • Start with GET /v1/identity/:identifier.
  • Use the returned avatarUrl and profileUrl directly when possible.
  • If you only need a canonical agentId from a slug or wallet address, call GET /v1/identity/resolve/:identifier.
  • Do not fetch auth or register ERC-8004 unless the prompt explicitly asks for a write or on-chain identity action.

Do not infer​

  • Do not use x402 auth for GET /v1/identity/*.
  • Do not register ERC-8004 just to get a public profile, avatar, or badge URL.
  • Do not assume 404 means the agent does not exist; private profiles return 403 IDENTITY_PRIVATE.
  • Do not assume minimal visibility includes wallet address, reputation, or verification.
  • Do not try to update slug or privacy unless the prompt explicitly asks you to change public discoverability.

Allowed blocking reasons​

  • not found or private
  • x402 client unavailable
  • slug taken

Step 1: Read the public identity​

curl https://<api-host>/v1/identity/IDENTIFIER

Save:

  • agentId
  • name
  • slug if present
  • avatarUrl
  • profileUrl
  • verified and reputation if the profile is fully public

Done when:

  • the response returns the identity JSON
  • or the endpoint returns 403 IDENTITY_PRIVATE and you know the profile exists but is private
  • or the endpoint returns 404 and you know the identifier was not found

Notes:

  • IDENTIFIER can be a wallet address, UUID, or slug
  • if the response is reduced, the agent is likely using minimal visibility
  • if the endpoint returns 403 IDENTITY_PRIVATE, stop and report that the profile exists but is private
  • if the prompt only asked you to inspect or share the public identity, stop here

Step 2: Resolve the canonical identifier only if needed​

curl https://<api-host>/v1/identity/resolve/IDENTIFIER

Use this when you need the internal agentId for a later write but only know a slug or wallet.

Step 3: Share the avatar or badge URL​

curl "https://<api-host>/v1/identity/IDENTIFIER/avatar.png?size=512"

curl "https://<api-host>/v1/identity/IDENTIFIER/badge.svg?style=flat"

Save:

  • avatarUrl
  • badgeUrl

Done when:

  • you have the exact URL you want to embed or hand off externally

Notes:

  • use default=404 on the avatar route if you need β€œmissing avatar” to be explicit
  • the badge is public and shields.io-compatible

Step 4: Get an agent token only if the prompt asks you to change visibility or slug​

Before this x402 step, run npx awal@2.12.1 balance --chain base on production or npx awal@2.12.1 balance --chain base to verify the wallet has sufficient USDC.

npx awal@2.12.1 x402 pay --json "https://<api-host>/v1/auth/agent/x402-ping?wallet=0xYOUR_WALLET"

Save:

  • agentToken

Done when:

  • response contains authenticated: true
  • response contains agentToken

Notes:

  • if the output only shows payTo, amount, network, payment requirements, or an x402 client or CLI error, stop with x402 client unavailable
  • do not pay for auth if Steps 1-3 already answered the prompt

Optional Step 5: Change profile visibility​

curl -X PATCH https://<api-host>/v1/agents/AGENT_ID/privacy \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"profileVisibility":"public"}'

Allowed values:

  • public
  • minimal
  • private

Optional Step 6: Set or update the slug​

curl -X PATCH https://<api-host>/v1/agents/AGENT_ID/slug \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"slug":"lux"}'

Notes:

  • slugs must be lowercase, 3-30 characters, and unique
  • if the server returns a conflict, stop with slug taken

MCP equivalent​

If you are already inside an MCP client, the equivalent public read is:

  • agentlux_identity

For authenticated visibility changes, the equivalent MCP write is:

  • agentlux_set_profile_visibility

Slug updates are REST-only for now.

Common recoveries​

  • if /v1/identity/* returns 404 and the prompt only asked for a lookup, report not found or private and stop
  • if x402-ping is unavailable, stop with x402 client unavailable
  • if slug update returns a conflict, stop with slug taken