Most OAuth integrations request the scopes that appeared in the provider's getting-started guide. Those guides optimise for the integration working on the first try, which means they suggest generously. The scope set then never changes, because narrowing it risks breaking something and nobody is rewarded for the attempt.
The result is a long tail of integrations holding permissions nobody chose.
Scopes are the boundary that actually holds
Almost everything else in an integration is a convention you maintain. Scopes are enforced by the provider, on every call, regardless of what your code believes it's doing. A token without chat:write cannot post a message even if every line of your application wants it to.
That makes them the strongest control available, and the one worth spending real effort on — especially when the caller is an agent whose exact behaviour you can't enumerate ahead of time.
Working out what you need
The empirical method beats reading documentation:
- Start with nothing, or the narrowest plausible set.
- Run the integration against a test account.
- When a call fails with a permission error, read which scope it wants and add exactly that one.
- Repeat until it works.
- Write down why each scope is there.
Tedious, an hour of work, and it reliably produces a smaller set than reasoning from the docs — because documentation describes what a scope can do, not what your code needs.
Step five matters more than it looks. A list of scopes with no rationale can never be safely reduced later, because nobody knows which ones are load-bearing.
Things worth knowing about real scope systems
Read and write are usually separable, and often at a finer grain than people use. Many providers distinguish read, write, and admin per resource type. Requesting a combined scope because it's one line in the config is a decision worth making consciously.
Some scopes are transitively enormous. Administrative scopes frequently imply access to everything a workspace contains, including private content the grantor didn't consider. A scope named for user management may carry read access to every channel or repository. Read what the scope actually implies, not what it's called.
Incremental authorisation exists and is underused. Rather than asking for everything at install, request the base set and ask for more when a feature is first used. Users are far more willing to grant a permission attached to a visible action than to a wall of checkboxes, and integrations that ask for less at install see fewer abandoned authorisations.
Resource-level restriction beats scope-level where offered. Increasingly, providers allow a token to be limited to specific repositories, channels, or objects in addition to scope. repo on one repository is a materially different grant from repo across an organisation, and where that option exists it usually does more for you than scope trimming alone.
Refresh tokens are the real credential. Access tokens expire, which limits the damage of a leak. Refresh tokens often don't, and a leaked one regenerates access indefinitely. Store them with the same care as passwords, and know how to revoke.
The consent screen is a design surface
Whatever you request appears in front of the person authorising, and it shapes both whether they say yes and what they think they agreed to.
Asking for broad permissions on a small utility reads as untrustworthy, and increasingly it stalls procurement at larger customers. Asking for what you need, with a clear explanation, is both the honest option and the one with better conversion.
If you're the one granting rather than requesting: read the screen. It is the last point at which the decision is yours. A scope you don't understand is a reason to stop, not a checkbox.
Reviewing what you've already granted
Worth doing once a quarter, from the provider's side rather than your own:
- List installed applications and their granted scopes in each workspace you administer.
- Remove anything unused for 90 days. Most integrations are installed for an evaluation and never removed.
- For anything still in use, check whether it holds admin scope it doesn't exercise.
- Confirm you know who owns each one. Integrations authorised by someone who has since left are common and awkward.
For agent-driven integrations specifically
Two additions when the caller is an agent:
Split by workflow, not by service. One connection per service means the scope set is the union of everything any workflow needs. Separate connections keep each minimal, and make the audit trail attributable.
Separate the read path from the write path. An agent that reads untrusted content and holds write scope on the same token is the prompt-injection scenario. Two tokens — read on the untrusted source, write narrowly scoped elsewhere — removes the path entirely, and costs one extra connection to set up.
The general principle is unchanged from ordinary software: grant what the task requires, and know why each grant is there. Agents only make the consequences of skipping it arrive faster.
Turn one person's AI process into the company's.
Murmurator is invite-only. Already invited? Sign in and build something real.