A new developer just pushed code that can read every customer record in your system. Not because they needed to—but because your OAuth scopes were too broad, too vague, and unmanaged. This is how breaches happen.
OAuth Scopes Management is not a checkbox. It is the line between least privilege and total compromise. Without strict scope definitions, every token you issue can become an open master key.
Start with an audit. List every scope in your system. Identify which ones grant write or admin-level access. Eliminate scopes that no active integration or service actually uses. Then, split large scopes into smaller, function-specific ones. For example, replace a sweeping read_all scope with read_invoices, read_customers, and read_payments.
Next, enforce secure developer access by assigning scopes on a per-app and per-developer basis. Tokens should expire quickly; refresh tokens should be scoped even more tightly than access tokens. Never use wildcard scopes. Every permission must be explicit.