Inspiration

A confusing medical bill or official letter can send someone straight to an AI assistant with names, addresses, insurance identifiers, and personal circumstances still attached. I built Airlock to make the outgoing request something the user can inspect and change.

What it does

Airlock is an English iOS document assistant with two selected packs: Medical Bills & EOBs and Official letters. Import a PDF or image, correct locally extracted text, review hidden details and the complete outgoing request, then explicitly confirm a Gemini request through Firebase AI Logic. Known placeholders are restored locally in the answer.

The medical pack explains a bill, prepares provider/insurer questions, and drafts a billing inquiry. A possible duplicate charge is a question to verify. The letter pack explains an administrative request, identifies actions and stated deadlines with source references, and prepares a reply. Users review and copy drafts themselves; Airlock never sends them to recipients.

How I built it

Swift and SwiftUI provide the native interface. PDFKit extracts PDF text; Vision performs local OCR. A portable Swift core handles rules, Unicode-safe spans, overlap merging, placeholders, and restoration. Native Apple entity recognition adds another detection layer.

Apple Foundation Models performs local sensitive-context detection through Firebase AI Logic. Detection configures only the system model, with no cloud fallback. Structured findings must match exact source substrings. Availability, timeout, cancellation, and incomplete detection are disclosed; review remains mandatory.

A separate cloud gateway accepts only the reviewed AnonymizedPayload and obtains a Firebase App Check token before calling Gemini. Each follow-up uses fresh instructions and anonymized source, never restored answer history. The simulator uses a registered App Check debug provider. Physical-device App Attest remains unverified.

Challenges I ran into

The complete outgoing request needs protection. The preview and transmitted payload are the same string; mappings stay out of the gateway; every follow-up needs fresh confirmation. Unicode offsets, repeated values, literal placeholder collisions, and late results after cancellation needed explicit handling.

Availability does not prove successful local inference. I separated real Apple model checks from failure fixtures. An initial real run missed relationship context, which led to more explicit extraction guidance. This is not a measured general recall result.

Accomplishments

All 40 portable core tests passed. A signed simulator suite passed 16 tests, including real Firebase-wrapped Apple model detection, imports, review, restoration, timeout, cancellation, and fallback. The local inference test checked the Apple system-model identifier and observed zero app URL-loading attempts with a blocking guard; this was not OS-wide packet capture.

Earlier synthetic-document rehearsals received six real Gemini answers across both packs. The video records those earlier working cloud flows. A later cloud recheck hit a simulator UI automation timeout and is not counted as a new successful call. The public source also builds without private Firebase configuration.

What I learned

Privacy requires explicit boundaries in code and understandable choices in the interface. Local detection can still miss identifying context. App Check protects backend access; it does not anonymize documents. Answers and drafts still need verification against the original source.

What is next for Airlock

Broader measured detection coverage, a durable encrypted mapping vault, multilingual packs, Android, and Web are planned. Exposure Meter and Privacy Ledger are later ideas. The hackathon demo uses in-memory sessions and does not claim full-v1 readiness or perfect anonymization.

Try it

Source and setup instructions · Demo video

The repository includes synthetic documents, tests, and real local-model evidence. Real inference requires a model-ready Apple environment and Firebase configuration. The explicitly labeled simulated mode provides an interface/restoration fallback.

Built solo by Prajyod Arudra.

Built With

Share this project:

Updates

Submission history