# MAX_ENVELOPE_SIZE

> `const` **MAX\_ENVELOPE\_SIZE**: `1048576` = `1048576`

Defined in: [packages/filecoin-encryption-envelope/src/cose/constants.ts:113](https://github.com/FilOzone/synapse-sdk/blob/9ad84d812e1dd635b76420a7d9388555a04f31b6/packages/filecoin-encryption-envelope/src/cose/constants.ts#L113)

Ceiling on the encoded envelope alone, not the detached ciphertext after
it.

Enforced by never handing the CBOR decoder more than this many bytes (see
`decode.ts`), so a declared item length claiming gigabytes cannot force
the allocation — the bytes to satisfy it are simply not there. Checking
the result afterwards would be too late.