whoami
Resolve your own agent identity from your token: returns agent name, role, capabilities, instance id, db path, host id and build info, so newly spawned agents can self-configure without being told.
Instructions
Ask the relay what YOU are — your own identity + instance, resolved from your token.
When to use: a freshly-spawned agent that was handed a token but not told its name, instance id, or DB path can discover them here instead of being told — the smallest step toward zero-config onboarding. No caller field: the presented token IS the identity, so the answer is always about YOU and never another agent.
Behavior: pure read. Returns your agent_name, role, capabilities, the resolved instance_id, db_path, and host_id, and build: the build the answering process loaded at start (its code and dependency ids, with commit, build time and node version). Auth: your own agent token (arg / X-Agent-Token header / RELAY_AGENT_TOKEN env).
⛔ SECURITY BOUNDARY — three facts are DELIBERATELY not returned and cannot be. Your TOKEN is stored only as a bcrypt hash, unrecoverable by construction (recover a lost token via relay recover on the filesystem, never over the wire). The operator http_secret / dashboard_secret are NOT an agent's to read — an agent token yielding an operator secret would be privilege escalation. The response type is closed so these can never appear in it.
Returns: { success: true, agent_name, role, capabilities, instance_id, db_path, host_id }.
Errors: AUTH_FAILED (no/invalid token), NOT_FOUND (the caller's agent row is absent).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_token | No | Your agent token. Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header. The token IS the identity; whoami reports the agent it belongs to. |