# August Cyber Agent Authentication (auth.md)

August Cyber supports headless agent signup, email OTP verification, scoped and full-access admin API keys, and programmatic billing without opening a dashboard.

## Discovery Endpoints

- Protected Resource Metadata (RFC 9728): `https://api.august.so/.well-known/oauth-protected-resource`
- Authorization Server Metadata: `https://api.august.so/.well-known/oauth-authorization-server`
- Full Agent Skill & Hardening Workflow: `https://august.so/SKILL.md`
- Terms of Service: `https://august.so/console/terms` (`cybercart-terms-2026-11-10`)

## Headless Signup or Login (2 Calls, No Browser)

### 1. Request a 6-digit email verification code

```bash
curl -sS -X POST https://api.august.so/v1/agent/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@company.com",
    "workspace_name": "Acme Security",
    "key_label": "Agent CLI"
  }'
```

Email OTP issues standard operational keys (`inference`, `sandboxes`, `targets:verify`, `usage:read`, `account:read`) for new accounts or existing workspace owners. Privileged keys (`admin`, `keys:manage`, `billing:manage`, `account:write`) require authenticated web console approval by the workspace owner at `https://august.so/console/keys`.

### 2. Verify the 6-digit code and receive your API key

```bash
curl -sS -X POST https://api.august.so/v1/agent/auth/verify \
  -H "Content-Type: application/json" \
  -d '{
    "claim_token": "clm_...",
    "code": "123456",
    "accept_terms": true,
    "terms_version": "cybercart-terms-2026-11-10"
  }'
```

The response returns your one-time `api_key`, `key_id`, `scopes`, `tenant_id`, and `balance_micros`.

## CLI Equivalent

```bash
curl -fsSL https://api.august.so/install | sh
august auth register --email you@company.com --accept-terms
august auth verify 123456
august account status
```

## Scopes

- Standard default scopes: `inference`, `sandboxes`, `targets:verify`, `usage:read`
- Account management scopes: `account:read`, `account:write`, `keys:manage`, `billing:manage`
- Full account access: `key_type: "admin"` (`acrt_admin_...`, scope `admin`)

A key can never mint a child key with scopes higher than its own. Target ownership verification (DNS TXT or `/.well-known/august-verify.txt`) is always mandatory before launching any active sandbox against an external domain.
