Skip to main content

ExtractionLimits

@forge/monorepo


@forge/monorepo / backend/src / ExtractionLimits

Type Alias: ExtractionLimits

ExtractionLimits = object

Defined in: backend/src/documents/index.ts:134

The bounds a parser runs inside — AC-3.

Every one of these exists because a document is attacker-controlled input. A page limit alone is not enough: a single-page PDF can carry a content stream that decompresses to gigabytes, which is why maxTextBytes is separate from maxBytes, and why maxBlocks is separate again — a million empty paragraphs cost little text and a great deal of everything else.

Properties

maxBlocks

readonly maxBlocks: number

Defined in: backend/src/documents/index.ts:140


maxBytes

readonly maxBytes: number

Defined in: backend/src/documents/index.ts:136

Bytes read from storage. Past this the document is refused rather than truncated: a half-read PDF is not a shorter PDF.


maxPages

readonly maxPages: number

Defined in: backend/src/documents/index.ts:137


maxTextBytes

readonly maxTextBytes: number

Defined in: backend/src/documents/index.ts:139

Extracted text kept, across all blocks. Truncates rather than refuses — half a document is still useful.


timeoutMs

readonly timeoutMs: number

Defined in: backend/src/documents/index.ts:142

Wall-clock ceiling. A parser that ignores it is stopped by the pipeline's own race.