Published in openvibe-contracts v0.33.0 (docs/adr/ADR-003-service-principals.md), rendered as is.

ADR-003: Service/app principal authentication and capability grants

Status: Accepted, implemented 2026-09-22

Context and current evidence

First-party services authenticated to each other with one shared X-Internal-Key per deployment, with unrestricted reach.

Decision

Alternatives considered

Migration consequences

Guarded routes accept both during migration; callers fall back to the key only when no token can be had.

Rollback

Remove a grant (new tokens stop carrying it) or stop sending tokens (callers fall back to the key).

Acceptance tests

OpenVibe.Network/test/principals.test.js, modules.test.js, Contracts service-auth tests (forged, expired, wrong audience, alg none, tampered, ungranted, namespace, owner), Media service-token.test.js. Production smoke: tokens issued, cross-app and cross-namespace calls refused.