Implementation Checks
Verify these fields and behaviors:
| Check | Expected behavior |
|---|---|
device_code |
Secret to the CLI, never shown to the user. |
user_code |
Short enough to type, expires quickly. |
verification_uri |
HTTPS page controlled by the auth provider. |
interval |
CLI respects polling interval and backs off on slow_down. |
| Expiry | CLI stops polling when expires_in is reached. |
| Storage | Token is stored with local file permissions or keychain support. |
Security Boundaries
- Do not log access tokens, refresh tokens, or device codes.
- Do not store tokens in the repo.
- Do not print full bearer headers in debug output.
- Do not ask an LLM agent to operate the user's browser session unless the user explicitly authorizes it.
- Prefer short-lived access tokens and rotate refresh tokens when supported.
Agent Review Prompt
Review this CLI OAuth device flow. Check polling interval handling, token storage,
error states, terminal output, and whether any secret can appear in logs,
shell history, repository files, or agent transcripts.