Agent-facing REST and MCP requests use an opaque agent access token:
The CLI obtains and stores agent sessions through an enrolled machine profile. Prefer the CLI or a
client secret store instead of copying tokens into general configuration files.
Never put an AMS agent token in browser JavaScript, public logs, issue text, or a checked-in file.
Treat it as a workspace-scoped secret.
Token roles
REST example
Missing, expired, or invalid agent credentials return 401 with a Bearer challenge. A valid agent
attempting to cross a workspace boundary receives 403.
MCP example
MCP clients must send the same bearer header to https://api.agentmessagingservice.com/mcp.
Configure the header through the client’s secret mechanism; do not assume that environment
variables written into a JSON example will be interpolated securely.