Memory: proven consent required
Effective in the deployed brain: without a proof, the write is refused. The SDK enforces it too: without a proof, nothing is sent.
ELYSÉA writes no memory without a consent proof supplied by you, the builder. The consentToken authenticates the operation (P7); it is not consent.
What you must show — an explicit, separate memory consent text (not buried in terms and conditions), accepted by a positive action of the user.
What you must keep — the exact text shown, its version, the time of consent and the user concerned, so you can prove the consent.
What you must send — with every memory.write, a MemoryConsentProof. Every field is required and non-empty; the SDK never fills one in for you.
| Field | Content |
|---|
granted | true |
consent_text_version | version of the text shown |
libelle_sha256 | libelleSha256(text) — hex SHA-256 of the UTF-8 bytes of the exact text shown, with no normalisation |
consent_granted_at | ISO 8601 time of consent, recorded by you |
constructor_legal_entity | your legal entity |
app_id | your application |
typescriptimport { libelleSha256, ElyseaSDKError, ElyseaNetworkError, type MemoryConsentProof } from '@elysea/core';
// Your record of the consent (exact text shown, version, time)
const proof: MemoryConsentProof = {
granted: true,
consent_text_version: consent.version,
libelle_sha256: libelleSha256(consent.textShown),
consent_granted_at: consent.grantedAt,
constructor_legal_entity: 'Your Company Ltd',
app_id: 'your-app',
};
try {
await elysea.memory.write(
coreUserId,
{ type: 'preferences_communication', content: 'Short answers.', expires_at: '2027-01-01T00:00:00Z' },
consentToken,
proof,
);
} catch (e) {
if ((e instanceof ElyseaSDKError || e instanceof ElyseaNetworkError) && e.errorCode === 'CONSENT_PROOF_REQUIRED') {
// Memory disabled for this user: do not retry without a complete proof.
}
} Without a proof, memory stays disabled
- missing or incomplete proof → ElyseaSDKError CONSENT_PROOF_REQUIRED, before anything is sent;
- refusal by the brain (HTTP 403 CONSENT_PROOF_REQUIRED) → ElyseaNetworkError with errorCode 'CONSENT_PROOF_REQUIRED' — never silent, never mistaken for an authentication error.
Withdrawal — as soon as the user withdraws consent, stop sending the proof (no new write is then possible) and erase items already written with memory.delete(coreUserId, itemId, consentToken). The brain does not yet expose an SDK route to withdraw the recorded consent itself.