Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 29 Nov 2026. What's built · Install 0.6.0
jadpo
ReferenceErrors

ErrorsSign-in and identity · rule

type.token_scopes_invalid

On this page

Code gives sessions.issue_token scopes: that aren't a list of scopes api_token: { scopes: } declares.

Area 8, Sign-in and identity; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

sessions.issue_token(user_id, scopes: [OAuthScope.<name>]) issues an API token narrowed to the scopes listed, which policy then holds it to, as it holds a provider's narrowed token (Scopes). Each must be one api_token: { scopes: } declares, listed once, and at least one. A token with no scopes: may do whatever its person may.

What it looks like

main.jadpo:

example
principal {    user: {        subject: Member.handle    }}authentication {    api_token: {}}type Handle = Text {    max_length: 40}entity Member {    id: Uuid    handle: Handle {        unique: true    }    policy: {        create: [Access.public]        read: [id]    }}type AppSignedIn = Output {    token: ApiToken}/// A token for the member's app that may only read.action reading_token(member: Principal.user) -> AppSignedIn {    return AppSignedIn {        token: sessions.issue_token(member.id, scopes: [OAuthScope.notes_read])    }}
jadpo checkcheck failed: 1 error, 1 file

error sessions.issue_token is given scopes, and api_token: declares none

--> main.jadpo:34:56

   |34 |         token: sessions.issue_token(member.id, scopes: [OAuthScope.notes_read])   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^ no scopes declared
reason
sessions.issue_token(user_id, scopes: [OAuthScope.<name>]) narrows the token to the scopes listed, each one api_token: { scopes: } declares, once; leave scopes: out for a token that may do whatever its person may. api_token: in authentication { } declares no scopes:, so there is nothing to narrow a token to.
next
Declare the scopes in api_token: { scopes: { <name>: "<scope-token>" } }, or remove scopes: (agent)
rule
type.token_scopes_invalid
help
https://jadpo.dev/docs/errors/type.token_scopes_invalid

(agent) at the end of the next: line means your coding agent can make the fix itself: it declares the scope.

How to fix it

If the token should carry notes_read, declare it in api_token:, with the scope-token the token carries for it:

example
authentication {    api_token: {        scopes: {            notes_read: "notes:read"        }    }}

The token is now narrowed to notes:read, and policy holds it to the grants whose effects name that scope.

Markdown for agents: /docs/errors/type.token_scopes_invalid.md.Built from Jadpo's main branch at commit 9080dc3.