register, install, and doctor commands handle this in sequence.
agentrelay register
register calls POST /admin/agents on the relay and stores the returned API key at ~/.agentrelay/config.json with file permissions 0600. You need the admin token from your team lead to run this.
Flags
The admin token authenticates the registration request against the relay’s
POST /admin/agents endpoint. It is not stored and is not your API key — the relay generates a fresh API key in response and that is what gets written to disk.
After registering, verify the config was written:
The
api_key field is returned only once by the relay and never again. If you lose it, rotate using agentrelay rotate-key — see Audit and rotate.agentrelay install
install does three things in one command: adds the MCP server entry to your AI client’s config, writes the recommended permission overlay (Layer 2 of the trust model), and creates a default ~/.agentrelay/trust.yaml if one does not already exist.
1
MCP server entry
The command detects your client’s config file and adds the
agentrelay server entry. It prompts before overwriting an existing entry.- Claude Code
- Codex CLI
Written to
~/.claude/settings.json:2
Permission overlay (Layer 2)
The command merges the recommended
permissions block into the same settings file. If you have customised your permissions, it shows a diff and asks before applying.- Claude Code
- Codex CLI
Added to
~/.claude/settings.json under "permissions":3
Default trust.yaml
If
~/.agentrelay/trust.yaml does not exist, the command creates it with unknown_teammates.policy: reject, meaning only teammates you explicitly list are trusted. Edit this file to add your teammates — see Trust and block.agentrelay doctor
doctor checks each component of the setup in sequence and prints a status line for each.
MISSING or FAIL, doctor appends a note: line explaining the likely cause. Common causes:
config: MISSING—agentrelay registerhas not been run, or was run with the wrong binary. See the troubleshooting note in CLI overview.api key valid: FAIL— The relay’sRELAY_PEPPERmay have changed since you registered. Re-runregisterafter the relay operator stabilises the pepper.mcp[claude-code]: MISSING— Useclaude mcp adddirectly (see the warning above).trust.yaml: BROKEN— The file exists but failed to parse. Check the YAML syntax.