GNAP
The Grant Negotiation and Authorization Protocol (GNAP, RFC 9635) is an IETF protocol in which a client instance negotiates access with an authorization server (AS) through one JSON grant endpoint, with key-bound tokens by default. RFC 9767 defines how resource servers (RS) connect to the AS. With this skill the agent builds or reviews a GNAP client, AS or RS, and designs access rights that also fit OAuth Rich Authorization Requests.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: client instance, authorization server, resource server, or an RS that derives tokens for another RS.
- Coupling: whether the AS and RS share storage, or the RS uses RFC 9767 discovery, introspection and registration.
- Proofing method:
httpsig,mtls,jwsdorjws. - Target version: RFC 9635 (current, the only line), with RFC 9767 for resource server connections. Code written against a pre-RFC
draft-ietf-gnap-core-protocolrevision is upgraded to it. No preview exists. Seereferences/versions.md. - Revision: the pinned revisions in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the RFC Editor for errata or updating RFCs, and update the pins.
Invariants
- Every client request to the AS is signed with the client instance's key, and every presented key is validated in the request that presents it (RFC 9635 § 2.3, § 7.3).
- Tokens are key-bound unless the
bearerflag is set. A bound token is sent withAuthorization: GNAPand a proof of the bound key (RFC 9635 § 2.1.1, § 7.2). - Bearer GNAP tokens go only in the
Authorizationheader, never in a form body or query (RFC 9635 § 7.2). - The interaction hash is always sent by the AS and always validated by the client (RFC 9635 § 4.2.3).
- Continuation tokens only continue grants. They MUST NOT work at resource servers, and access tokens MUST NOT work for continuation (RFC 9635 § 5).
- Clients wait
waitseconds before continuing, 5 when absent (RFC 9635 § 3.1). - Access types are compared by exact byte match, and the AS keeps them collision-free (RFC 9635 § 8).
- The
accessreturned with a token reflects what the token actually allows (RFC 9635 § 3.2.1). - JWK keys carry
algandkid, andalgis nevernone(RFC 9635 § 7.1). - The RS validates both the token and the key proof on every request, and never reuses a proof result for another message (RFC 9767 § 6.2, § 6.4).
- Introspection reports a token active only when every criterion holds, never for the AS's own continuation or management tokens (RFC 9767 § 3.3, § 2.1.14).
- Clients check that a challenge's
referrerequals the RS URI before using it (RFC 9635 § 9.1).
Workflow
- Pick the version and fix roles and coupling. Target RFC 9635 and RFC 9767. Decide who signs what, with which proofing method, and whether the RS validates self-contained tokens or introspects. For code built on a pre-RFC draft, run the upgrade checklist first. -> references/versions.md ✓ The target is RFC 9635, every wire value comes from its registries, each party has a key and a proofing method, and the RS's validation path is chosen.
- Design the access types. Define each
type, its fields and their cross-product meaning, plus any reference strings. -> references/access-rights.md ✓ Every type is a URI or otherwise collision-free, and the same definition serves RAR if OAuth is also in use. - Build the grant request and key proof on the client.
-> references/grant-flow.md
✓ The request has
client.keywithproof, and thehttpsigsignature covers@method,@target-uriandcontent-digestwithtag="gnap". - Handle interaction with the start and finish modes both sides support, and verify the hash.
-> references/grant-flow.md
✓ A finish redirect with a wrong
hashis rejected before continuation. - Continue and manage the grant: polling with
wait, modification, revocation, and token rotation or revocation throughmanage. -> references/grant-flow.md ✓ Continuation calls carry the continuation token and a fresh proof, and never go faster thanwait. - Validate tokens at the RS and answer with
WWW-Authenticate: GNAPwhen access is missing. -> references/resource-servers.md ✓ A valid token with a missing or wrong proof, a token for another RS, and a continuation token are each refused. - Connect the RS to the AS if they are loosely coupled: discovery, signed introspection, resource registration and derived tokens.
-> references/resource-servers.md
✓ The RS reads
/.well-known/gnap-as-rs, signs introspection with its own key, and derives downstream tokens instead of forwarding the client's token. - Upgrade (only when asked). Move a pre-RFC draft implementation to RFC 9635 and RFC 9767 with the checklist. -> references/versions.md ✓ Every wire value is in an RFC 9635 or RFC 9767 registry, and the same client instance gets the same access as before.
Verify before done
- Grant requests, continuation calls and RS calls to the AS are all signed, and the signatures are verified.
- Bound tokens are refused without a valid proof; bearer tokens are accepted only in the
Authorizationheader. - The client computes and checks the interaction hash from both nonces,
interact_refand the grant endpoint. -
accessobjects all havetype, and type comparison is exact with no normalization. - Introspection requests carry
resource_server, andactive: falseresponses carry no other fields. - Token formats named anywhere come from the GNAP Token Formats registry.
Reference index
references/versions.md: the RFC 9635 line, the pre-RFC drafts, what RFC 9635 fixed, the draft-to-RFC upgrade checklist, and why no preview is listed. Load for step 1.references/grant-flow.md: the grant request, client keys and proofing methods, interaction and its hash, the grant response and errors, continuation, token use and management, and discovery.references/access-rights.md: theaccessarray, reference strings, granted versus requested rights, and the comparison with RARauthorization_details.references/resource-servers.md: the RFC 9767 token model with JWT and introspection names, token formats, RS-facing discovery, introspection, resource registration, derived tokens and RS validation.
Related skills
oauthfor OAuth 2.0 and 2.1, including Rich Authorization Requests:npx skills add ScaleDockHQ/scaledock-skills --skill oauthjwtfor JWT-formatted GNAP tokens and the JOSE verification checklist:npx skills add ScaleDockHQ/scaledock-skills --skill jwt
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- RFC 9635: Grant Negotiation and Authorization Protocol (GNAP): RFC (Proposed Standard), RFC 9635, checked 2026-10-02.
- RFC 9767: GNAP Resource Server Connections: RFC (Proposed Standard), RFC 9767, checked 2026-10-02.
- RFC 9396: OAuth 2.0 Rich Authorization Requests: RFC (Proposed Standard), RFC 9396, checked 2026-10-02.
- draft-ietf-gnap-core-protocol history: Datatracker page (became RFC 9635), last draft draft-ietf-gnap-core-protocol-20 (2024-03-19), checked 2026-10-05.