Skip to main content
Crosslink uses a three-layer permission system: capabilities, policy, and consent.

Capabilities

Capabilities are declared by the host and answer: “what may this device ask for?”

Permission policy

The policy runs before the user is asked anything. It filters what a device may ever hold:

Key invariants

  • autoApprove cannot grant above maxAutoGrantRisk, which defaults to low
  • The approval prompt can narrow an offer, never widen it
  • deny wins over everything — including human approval

Pairing approval

When a new device pairs, the host decides what to grant:
Returning an array grants that subset. The result is intersected with what the policy permitted.

Default behavior

Without pairing.approve, the host refuses all pairing requests. You must implement this callback. With pairing.autoApprove: true, all requests are approved — useful for development, never for production. Capabilities marked confirmEachUse are never standing permissions. Every invocation stops at a prompt:
Silence denies. A host with no onConsentRequest configured refuses confirmEachUse methods outright.

Capability checks

Capabilities are checked on every RPC request, not just at connection time:
If a device’s grant changes (revoked, expired, modified), live sessions are affected immediately.

Device administration

Error codes

Example: layered permissions