Security
Credential storage
Section titled “Credential storage”- The config file is written
0600inside a0700directory, using a temporary file and rename so an interrupted write cannot truncate an existing credential. - The API key is never logged and never printed in full.
auth statusshows only a masked prefix (first 12 characters plus...), in both text and JSON output. - The interactive prompt does not echo the key to the terminal. Prefer it over
--api-key, which is visible to other users viaps. The flag exists for CI, where the value comes from a secret store. - Errors report only the API’s
detailfield, never a raw response body. - Your key carries your full account permissions. Revoke it in the dashboard if a machine is lost, and run
threatoptic auth logoutto remove the local copy.
Output conventions
Section titled “Output conventions”- Results go to stdout, errors to stderr, and failures exit non-zero.
--jsonemits machine-readable output as the only content on stdout, sothreatoptic whoami --json | jq -r .emailis safe.
Auth model
Section titled “Auth model”The CLI sends Authorization: Bearer <api_key>. Keys start with top_ and are created in the dashboard under Account → API keys. The CLI cannot create or revoke keys — those endpoints require a browser session (JWT).