Skip to main content

CLI tooling for Rare agent identity flows

Project description

rare-agent-sdk

CLI tooling for the Rare agent identity lifecycle.

What It Is

rare-agent-sdk keeps its historical package name for now, but the supported public surface is CLI-only. It helps an agent register, manage identity, request upgrades, issue attestations, and complete Rare login flows against Rare-compatible platforms.

Who It Is For

  • Agent operators and tool builders that want a packaged CLI
  • Teams choosing between Rare hosted signing and self-hosted keys
  • Operators testing end-to-end login and attestation flows locally

Why It Exists

Rare login is not just a single token exchange. Agents need to manage keys, sign fixed protocol payloads, refresh attestations, handle human verification upgrades, and produce delegation material for platforms. This package ships the Agent CLI and local signer needed to operate that lifecycle.

How It Fits Into Rare

  • rare-identity-protocol defines the public protocol rules
  • rare-agent-sdk provides the Agent CLI and local signer tooling
  • Rare Platform Kit is the platform-side toolkit that verifies what this CLI produces

Quick Start

pip install rare-agent-sdk

Use the hosted Rare API:

rare register --name alice --rare-url https://api.rareid.cc
rare refresh-attestation --rare-url https://api.rareid.cc
rare show-state --rare-url https://api.rareid.cc

Production Notes

  • agent_id is the Ed25519 public key and remains the primary identity key.
  • Two operating modes are supported:
    • hosted-signer: Rare manages signing on behalf of the agent.
    • self-hosted: the agent keeps its own private key.
  • Self-hosted keys are stored separately from the JSON state file under ~/.config/rare/keys/ with 0600 permissions.
  • rare-signer lets you keep the private key out of the main CLI process by signing over local IPC.
  • Imported Python modules under rare_agent_sdk are internal implementation details and are not a supported public API.

Common CLI Flows

# start a local signer for self-hosted mode
rare-signer

# register and manage identity
rare register --name alice
rare register --name alice --key-mode self-hosted
rare set-name --name alice-v2
rare refresh-attestation

# request human verification upgrades
rare request-upgrade --level L1 --email alice@example.com
rare send-l1-link --request-id <request_id>
rare upgrade-status --request-id <request_id>
rare request-upgrade --level L2
rare start-social --request-id <request_id> --provider linkedin

# produce login material for a third-party platform
rare issue-full-attestation --aud platform
rare login --aud platform --platform-url http://127.0.0.1:8000/platform
rare login --aud platform --public-only

# recovery and inspection
rare recovery-factors
rare recover-hosted-token-email
rare recover-hosted-token-email-verify --token <token>
rare recover-hosted-token-social-start --provider x
rare show-state --paths

Troubleshooting

Recent CLI error responses include a runtime block with:

  • python_executable
  • sdk_version
  • cli_module_path

Use these commands to confirm the shell command, Python environment, and installed package all match:

which rare
python3 -m pip show rare-agent-sdk
python3 - <<'PY'
import sys, importlib.metadata, rare_agent_sdk.cli
print("python:", sys.executable)
print("rare-agent-sdk:", importlib.metadata.version("rare-agent-sdk"))
print("cli:", rare_agent_sdk.cli.__file__)
PY

To bypass shell PATH issues, run the CLI through the same Python interpreter explicitly:

python3 -m rare_agent_sdk.cli --rare-url https://api.rareid.cc show-state

To distinguish local environment issues from Rare API availability, verify the API directly:

curl -i -sS https://api.rareid.cc/healthz
curl -i -sS -X POST https://api.rareid.cc/v1/agents/self_register \
  -H 'content-type: application/json' \
  --data '{"name":"diag-agent"}'

Development

pip install -r requirements-test.lock
pip install -e .[test] --no-deps
pytest -q
python -m build

Related Repositories

  • Main Rare repository: https://github.com/Rare-ID/Rare

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rare_agent_sdk-0.2.4.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rare_agent_sdk-0.2.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file rare_agent_sdk-0.2.4.tar.gz.

File metadata

  • Download URL: rare_agent_sdk-0.2.4.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rare_agent_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 5ebc7e1119c1e88097679121ab3a34fe7500328ec3beef5f1898a99597512187
MD5 3228b554057f243deba6607d8cc0f4f4
BLAKE2b-256 797bf64f91e116b43dc0bd82a4e512009644752e866243d9ee724ddf7e857d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_agent_sdk-0.2.4.tar.gz:

Publisher: publish-python-packages.yml on Rare-ID/Rare

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rare_agent_sdk-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: rare_agent_sdk-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rare_agent_sdk-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1f29cd6b370922d7dec0b2a1a6d7c8307bf1e86773b34e2f8c27619d73c244
MD5 da8bcf6f1c779fbea794f7efc7f6e9af
BLAKE2b-256 064fcf9587450808c616a5d617e385056e4c90c03302897a4c9c791dc59c4d82

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_agent_sdk-0.2.4-py3-none-any.whl:

Publisher: publish-python-packages.yml on Rare-ID/Rare

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page