# Agent authentication (Assume Cloud)

Public endpoints: `https://api.assume.dev/api/*` (signed HTTP) and `https://mcp.assume.dev/mcp` (OAuth or signed HTTP).

Agents never receive API keys, OAuth tokens, or vault material from Assume — only capability ids and redacted action results.

## ML-DSA-65 request signatures

Use this when calling signed HTTP (`/api/*` or `/mcp` with headers instead of OAuth).

| Item | Value |
| --- | --- |
| Algorithm | **ML-DSA-65** (FIPS 204) |
| Header | `X-Agent-Signature-Alg: ml-dsa-65` |
| Public key / signature encoding | Base64 (raw key bytes and signature bytes) |
| Key id | First 16 hex characters of SHA-256 of the raw public key |

**Canonical message** (UTF-8, exact body bytes of the HTTP request):

```text
${agentId}:${keyId}:${timestamp}:${nonce}:${body}
```

**Required headers on every signed request**

| Header | Description |
| --- | --- |
| `X-Agent-Id` | Agent id issued when the operator registered you |
| `X-Agent-Key-Id` | Key id for the signing keypair |
| `X-Agent-Timestamp` | Milliseconds since Unix epoch (string) |
| `X-Agent-Nonce` | Unique per request (16 random bytes as hex is typical) |
| `X-Agent-Signature` | ML-DSA signature of the canonical message, base64 |
| `X-Agent-Signature-Alg` | Must be `ml-dsa-65` |

**Clock and nonce**

- Requests are rejected if the timestamp is too far from server time (about five minutes).
- Each nonce may be used only once within that window — retry with a fresh nonce and timestamp.

The operator registers your agent and provisions the **private signing key** in the harness (stdio MCP, SDK, or automation). Never put that private key in chat, prompts, or public repos.

## HTTP MCP (editors and remote clients)

**Recommended:** connect the MCP client to `https://mcp.assume.dev/mcp` with **MCP OAuth** (install configuration with `"oauth": true`). After the operator signs in, the harness holds a short-lived access token:

```http
Authorization: Bearer mcat_<token>
```

Only bearer tokens with the `mcat_` prefix are accepted as OAuth access tokens on `/mcp`.

**Alternative:** the same URL with **signed HTTP** using the ML-DSA headers above (same keypair as `/api`).

If OAuth is required and the token is missing or invalid, the server may respond with `401` and a `WWW-Authenticate` challenge. OAuth discovery:

- Protected resource metadata: `https://mcp.assume.dev/.well-known/oauth-protected-resource`
- Authorization server metadata: `https://api.assume.dev/.well-known/oauth-authorization-server`

Follow your MCP client’s OAuth flow; the operator completes consent in the browser.

## Transport

Assume Cloud serves API and MCP over **HTTPS** (`api.assume.dev`, `mcp.assume.dev`).

## Integrator checklist

1. Connect MCP with OAuth **or** configure ML-DSA signing for `/api`.
2. Use `search_actions` → `describe_action` before `run_action` or `execute_action`.
3. Request least privilege; default capability lifetime is one hour unless the operator or request specifies otherwise (max 24 hours).
4. On `APPROVAL_REQUIRED`, ask the operator to approve at `https://app.assume.dev/requests` and retry with `approvalId`.
5. Call `revoke_own_capability` when finished.

Full tool list and loop: [AGENTS.md](./AGENTS.md) on this host.