# 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/bc8a4b093324ccef9b407251fcf4e91823c6f599/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.