Define which files inside an uploaded archive may reach the model. Keep unsafe, unsupported and uninspected members visible instead of treating a successful upload as a complete evidence packet.
A supplier sends a ZIP containing a work specification, site photographs and another compressed folder. The intake service reports success. An AI assistant summarizes the specification, but nobody knows whether the nested folder was inspected—or whether two identically named files overwrote one another during extraction.
AI ZIP file intake needs an admission decision before document interpretation. The output of that decision is an identified set of permitted files with explicit exclusions and unresolved findings. It is not a summary of whatever happened to emerge from an unzip operation.
This guide proposes an operating contract for teams that have a genuine business reason to accept archives. It is a design recommendation, not tested deployment evidence, a complete secure extractor implementation or a guarantee that admitted files are harmless.
First decide whether archives belong in your intake route
The OWASP File Upload Cheat Sheet discourages ZIP uploads because their contents introduce numerous attack vectors. Requiring separate supported documents through an approved upload route can be the simpler decision.
If archives are necessary, define the accepted container formats, member formats and handling policy with the security and platform owners. A ZIP upload option does not imply support for every compression method, encrypted member or nested container. Nor does a successful upload establish that every member is searchable.
For a concrete product-specific example, Hintyr’s supported-file documentation describes extracting ZIP contents into individual review documents, including nested ZIPs. It separately notes that unsupported files can remain stored without being searchable by its AI. That illustrates why storage, extraction and model availability need distinct evidence; it is not a security assessment of that service.
Keep the boundary narrow: archive admission supplies inputs to the broader AI document extraction workflow. Later field validation and business approval still apply.
Do not give the model responsibility for unpacking
- The intake system captures the original artifact, establishes authorized storage and assigns a processing-operation identity.
- A qualified extraction worker inspects and processes members within enforced filesystem, resource and format restrictions.
- Deterministic admission rules require complete dispositions, permitted artifact identities and an accepted scope before model submission.
- AI interprets only the admitted content, with source references and declared coverage. It does not select filesystem paths, enable unsupported formats or waive limits.
- People resolve unclear business scope; the designated technical owner handles security and extraction failures. Separate business authority controls downstream actions.
An instruction inside a README, filename or extracted document remains source material. It cannot change the handling policy or tell the worker to fetch additional files. Broader permission and prompt-injection controls belong in the AI workflow security design, not in an improvised unzip prompt.
Specify the extraction envelope before accepting a job
Bound both inspection and expansion
Set deployment-specific limits for uploaded bytes, inventory work, member count, individual expanded bytes, cumulative expanded bytes, nesting depth, processing time and worker resources. Validate those limits against legitimate workload fixtures. There is no universal safe number to copy into every document workflow.
OWASP says size controls must consider decompressed content. Apply a bounded preflight and enforce actual consumption while reading; declared sizes alone are not the release evidence. A compression-ratio warning can supplement, but should not replace, hard resource limits.
Budget nested processing against the original job as well as each child. Restarting a full allowance for every nested archive defeats a cumulative limit. A depth limit means “not inspected beyond this point,” not “nothing else was present.”
Prevent member names from becoming write authority
Android’s ZIP path-traversal guidance explains why member names need containment checks and recommends a safe, empty destination. Its examples are Android/Java-specific; have the implementation owner validate equivalent protections for the actual runtime.
Use a private, isolated per-attempt destination and generated storage identities. Keep original names as untrusted metadata. Reject escaping or ambiguous paths and unsupported link or special-file entries under the declared policy. Do not execute members, enable macros or fetch external resources to make extraction finish.
Detect collisions before allowing any overwrite. Two entries can map to the same destination after normalization or on the target filesystem. Preserve separate member identities and hold the conflict; silently flattening directories or keeping the last file loses evidence.
Treat each member as a new input boundary
Apply the approved type-validation and security-processing route to extracted members, not only the outer ZIP. OWASP recommends layered validation rather than trusting the submitted content type alone. A clean outer-file observation cannot establish that every expanded document meets the downstream policy.
Scanning, parsing and model admission are different steps. Record each required result; do not describe one scan as proof of complete safety. Encrypted, damaged or unsupported inputs need their own dispositions, without automatic password guessing or wider access.
Keep a member ledger, not just an extracted-file count
The following is a proposed application record, not a ZIP standard or provider response schema. Store sensitive files in their approved location and reference them from operational records.
| Level | Required evidence | Why it matters |
|---|---|---|
| Parent job | Request ID, exact archive hash, protected source reference, policy version, worker/version, operation ID and limits | Binds the result to submitted bytes and a declared handling contract. |
| Member identity | Member ordinal or equivalent stable entry reference, original name, parent member and nesting lineage | Names alone cannot distinguish collisions or duplicate entries. |
| Observation | Declared sizes, observed expanded bytes, format findings, path/collision checks and required security-processing results | Separates claims in the container from what processing established. |
| Member disposition | Admitted, excluded by policy, held, failed or not inspected; reason and responsible owner | Prevents skipped members from disappearing behind a success flag. |
| Derived artifact | Generated artifact identity, exact content hash, storage reference and downstream parser coverage | Connects the admitted member to the bytes actually supplied for interpretation. |
| Accepted set | Manifest revision, admitted artifact IDs, unresolved entries, scope decision, reviewer and permitted next step | Defines precisely what the model may receive and what the result can claim. |
A hash establishes byte identity, not trusted authorship or correct content. If inspection stops early, record coverage as partial or unknown. You cannot assign final dispositions to unseen entries by subtracting a few extracted files from a claimed total.
Where inventory is complete, reconcile every entry to a recorded disposition. Where it is incomplete, preserve that blocker independently of known-member results. A count that balances is necessary bookkeeping, not evidence that the selected files satisfy the business task.
Choose whole-packet or explicitly scoped release
For a task requiring all source material, one unresolved in-scope member holds the packet. For a genuinely separable task, an authorized owner may accept a defined subset under a policy that permits partial processing. Record the excluded or unresolved scope in the model input and resulting review packet.
For example, do not ask for “a complete supplier submission summary” when only the specification was admitted. A narrower task might be “summarize the admitted specification only; archive completeness remains unresolved.” That is a different output, not a successful completion of the original request.
Illustrative case: a facilities request includes specification.pdf, photos/site.jpg and supporting.zip. The approved route admits the PDF and image, but does not support nested archives. The ledger records the nested member as held and its contents as uninspected.
- The system preserves the outer archive and both admitted derivatives. It does not mark the entire submission processed.
- The coordinator checks the task requirements. Supporting evidence is required for planning, so the planning summary remains held.
- The requester supplies the supporting documents individually through the approved route. They are linked to the same request and pass their own intake checks.
- The reviewer accepts a new manifest revision containing the required evidence and its provenance. The original nested archive remains recorded as unresolved or superseded under the policy, not retrospectively “extracted.”
- AI drafts the planning summary from the accepted evidence set. Dispatch still needs its separate authorization.
If the worker instead hits a resource limit before finishing inventory, the finding is more serious than one known unsupported member: the remaining source scope is unknown. Do not present that result as the same three-entry manifest.
Make interruption and replay leave evidence intact
The Python zipfile documentation lists decompression failures including unsupported methods, password problems and resource exhaustion. It warns that interruption can leave incomplete extraction and that repeating extraction can overwrite files. These are documented library pitfalls, not a claim that every worker behaves identically.
Use explicit states such as Captured, Inspection running, Extraction held, Admission review, Accepted, Rejected and Superseded. A timeout leaves an attempt uncertain until its job record, outputs and coverage have been reconciled. It does not turn partial files into accepted inputs.
Resume only under a bounded worker policy. Preserve the parent operation and prior observations; identify any new attempt separately and use an isolated destination. Do not rerun into the partially populated directory or erase why the first attempt stopped. A denied permission or prohibited format requires an owner decision, not repeated extraction.
Bind asynchronous callbacks to the source and attempt. Late results for a superseded archive cannot replace the accepted manifest. Human rejection preserves the rejected revision and reason. Corrections after downstream use require an impact review rather than silently replacing the evidence.
Model submissions and downstream record creation need their own stable action identities and supported receipts. Reconcile an uncertain write before repeating it; archive admission itself is never permission to create another assignment.
Test admission outcomes before live packets
Use authorized, controlled fixtures reviewed by the technical owner. Do not test dangerous archives against production intake. Include:
- A supported archive with a known member set and expected admitted identities.
- Nested content beyond the allowed depth: explicit uninspected scope, not false completeness.
- Two names that collide under the destination’s rules: no silent overwrite.
- A path or entry type disallowed by policy: no artifact outside the permitted extraction boundary.
- Expansion, count or time limits reached: stopped work and visible partial coverage.
- An encrypted or unsupported member: held with a resolution owner.
- An interrupted attempt followed by a late completion: no accidental acceptance or duplicate downstream work.
Measure false admissions against labeled fixtures, unexplained member loss, incorrect complete-coverage claims, resource-limit enforcement and duplicate destination actions. In operation, track holds by cause, age and owner. Define release criteria for the actual archive families and worker configuration; these are proposed measures, not reported results.
Where Workhint fits
Workhint’s Workflow Engine describes approval routing to defined roles and requirements for details, files or notes before work advances. Those building blocks are relevant to assigning an archive exception and specifying the evidence a reviewer needs.
The Workhint workflow automation software solution describes structured intake, review stages and tracking owners and next actions. It is a relevant coordination layer around a document-review handoff.
Neither page establishes a native ZIP extractor, sandbox, malware scanner, member ledger or integration with the libraries discussed here. Validate those controls separately with the implementation owner. A configured approval stage cannot recover source files that extraction silently omitted.
Frequently asked questions
Does a successful ZIP upload mean the AI read every file?
No. Upload, member inspection, extraction, parsing and model submission are separate observations. Require coverage and per-member dispositions for the task’s declared scope.
Should the workflow accept the readable files and ignore the rest?
Only under an explicitly permitted partial-processing policy and a scoped acceptance decision. If unresolved members could affect the required answer, hold that answer rather than imply a complete review.
Can the AI decide a suspicious archive is safe?
Not as an admission control. Use qualified deterministic handling and security checks. AI interpretation must remain downstream of those controls and cannot override them.
What is the safest fallback when archive handling is unavailable?
Decline that input route and request supported documents through the approved channel, or assign authorized specialist handling. Preserve the request and its missing-evidence status; do not bypass the restriction to finish a summary.

Leave a Reply