SSyncropel Docs

Consent management

Grant, list, and revoke consent for cross-namespace record sharing over federation.

Who this is for

You're running federation (see the federation guide) and you need to share records between two different namespaces (for example, your default namespace and a partner team's namespace). By default, cross-namespace sharing is blocked. Consent grants open specific source → target paths.

If all your federation is inside one namespace, skip this guide. Same-namespace sync always passes unchanged.

The model

A consent grant is a record that says "records in source namespace X may be shared with target namespace Y, at these detail levels." Each grant has three fields:

  • source_namespace: where the records originate (typically default)
  • target_namespace: who's allowed to receive them
  • hash_levels: how much detail is shared. L0 is the full record. L1, L2 and L3 share progressively less.

When a sync pair pulls across namespaces, the most recent matching grant decides what is shared:

Grant stateWhat happens
No grant0 records pass: everything filtered out
Grant includes L0Full records pass (body and signature intact)
Grant excludes L0 (for example L1 only)Records pass, but the body is replaced with {"redacted": true} and the signature is removed
spl consent grant \
    --to-namespace partner-team \
    --hash-levels L0,L1,L2,L3

Options:

  • --to-namespace <NS>: target namespace (required)
  • --hash-levels <LEVELS>: comma-separated list. Default L0,L1,L2,L3 (full sharing)
  • --threads <IDS>: comma-separated thread IDs, for information only. Default * (all threads)
  • --purpose <TEXT>: optional reason, stored with the grant
  • --expires <ISO8601>: optional expiration

The source namespace is always default. Granting from another source namespace isn't supported by this command.

Common recipes

Full sharing between two teams

spl consent grant --to-namespace team-b --hash-levels L0,L1,L2,L3

Shape only (no content)

spl consent grant --to-namespace analytics --hash-levels L1,L2,L3

The target receives records but bodies are replaced with {"redacted": true}. They can count events and observe shapes but not see content. Useful for telemetry collection.

Existence only (the target knows a record exists, nothing more)

spl consent grant --to-namespace audit-archive --hash-levels L2,L3

More restrictive than shape only.

List active grants

spl consent list

Shows a table:

  GRANT_ID              SOURCE          TARGET          LEVELS
  abcd1234...           default         partner-team    L0,L1,L2,L3
  efef5678...           default         analytics       L1,L2,L3

Filter by namespace:

spl consent list --namespace partner-team

Revoke a grant

spl consent revoke <grant_id>

The grant stops applying right away. Records already delivered to a peer stay with that peer. Revoking only affects future syncs.

How sharing is decided

When instance B pulls a thread from instance A, A compares the thread's namespace with B's namespace:

  • Same namespace: records pass unchanged.
  • Different namespaces, no grant: nothing is returned.
  • Different namespaces, grant with L0: full records are returned.
  • Different namespaces, grant without L0: records are returned with the body redacted.

This check runs on every pull. A new or revoked grant takes effect on the next sync, with no restart.

What the filter does not do

  • Not retroactive. Revoking a grant doesn't remove records already delivered.
  • Not protection from a dishonest source. The check runs on the sending instance, so you have to trust that instance. To limit who can reach a workspace at all, use namespace access control.
  • Not per-record. A grant applies to a pair of namespaces, not to single records. If you need per-record gating, combine consent with CEL rules.

What's next

On this page