Forward Deployed EngineeringAI EngineeringEnterprise Security
Adapt a pretrained LLM for intelligence analysis inside an air-gapped facility, on classified data you are never allowed to see.
Question 40 of 73 · Updated
On this page
- Interview-ready answer
- 1. Clarify the security and mission boundary
- 2. Separate external engineering from internal execution
- 3. Establish a baseline before fine-tuning
- 4. LoRA and privacy-preserving adaptation
- 5. Protect the data and all derived assets
- 6. Offline software and model supply-chain assurance
- 7. Tested Python example: artifact integrity check
- 8. Build the offline evaluation process
- 9. Serve evidence-grounded outputs with human review
- 10. Operational design, scalability and cost
- 11. Auditability, support and recovery
- 12. Common mistakes
- Likely interviewer follow-ups
- Interview takeaway
Interview-ready answer#
I would separate the engineering work from the classified data and make the customer's authorized personnel responsible for all operations involving that data. I would never request access to the classified corpus, remote access to the isolated environment, exported samples, unrestricted logs, or trained model weights as a substitute for data access.
First, I would establish the approved use case, the facility's security authority, data classification and compartment boundaries, available hardware, permitted software import process, and acceptance criteria. I would start with a locally deployed pretrained model and access-controlled retrieval for authorized document summarization, evidence lookup and synthesis. If controlled evaluation demonstrates that the model needs domain-specific behavioral adaptation, I would deliver a reproducible offline training package using parameter-efficient fine-tuning such as LoRA. Authorized staff would run it entirely inside the enclave.
I would develop and test the package using public or explicitly approved synthetic data, verify its dependencies and provenance, and transfer it only through the facility's approved import procedure. The classified corpus, embeddings, checkpoints, adapters, evaluation examples and operational traces would remain within their authorized boundary. Even aggregate metrics would be shared outside only if the security authority explicitly approved their release.
Inside the facility, authorized domain experts would construct a held-out evaluation set, compare the baseline and adapted model, test grounding, access control, robustness, memorization and operational performance, and make a documented go/no-go decision. The deployed system would provide citations, distinguish facts from inference, acknowledge insufficient evidence, and leave consequential decisions to authorized human reviewers. I would maintain a versioned, reversible release process without introducing external telemetry or a hidden support channel.
The key FDE insight is that I can deliver an auditable process for adapting and evaluating a model without personally seeing the data. I cannot claim the model is effective on classified information until authorized personnel have completed and accepted the internal evaluation.
1. Clarify the security and mission boundary#
The phrase "air-gapped" describes isolation from external networks, not a complete security architecture. It does not by itself prove that an imported package is trustworthy, that internal users have appropriate permissions, or that sensitive information cannot leave through removable media, logs, backups or derived artifacts.
The project should be limited to lawful, authorized information analysis: document discovery, summarization, evidence comparison, source attribution and review workflows. It should not autonomously make consequential decisions about individuals, select targets, direct operational actions or bypass oversight.
Before designing a solution, establish:
| Requirement | Discovery question |
|---|---|
| Authorization | Who owns the information, and who is authorized to approve the system, datasets and users? |
| Data boundary | Which classifications, compartments and need-to-know rules apply to source and derived artifacts? |
| Task | Which explicitly approved document-analysis workflows must the model support? |
| Isolation | Which networks, systems and transfer paths are permitted under the facility's policy? |
| Hardware | Which accelerators, RAM, storage and supported drivers are available inside the enclave? |
| Import policy | Who can approve, inspect and import models, software and documentation? |
| Evaluation | Who can examine classified outputs and decide whether the system is acceptable? |
| Operations | Who owns monitoring, incident response, recovery, updates and retirement? |
Do not assume that being a vendor engineer, having a customer sponsor or physically visiting the facility confers access. The security authority determines eligibility, need-to-know, handling rules, allowed interfaces and authorized operating procedures. If the requirements cannot be satisfied without violating those rules, change the scope or decline the deployment.
2. Separate external engineering from internal execution#
The architecture has two distinct trust domains. The external team develops generic tooling and reproducible tests on approved nonclassified material. The authorized facility team controls all classified data, execution, evaluation and deployment decisions.
The arrows represent authorized internal data flows or an approved import review process, not a network connection across the air gap. This diagram deliberately contains no return path for classified material to the external engineering environment.
If the facility permits release of a sanitized report, its authorized release authority decides what can leave and through which procedure. No automatic metrics export, remote debugging tunnel, model checkpoint export, or covert support channel is acceptable.
The external engineer should not have visibility into classified examples, source names, prompts, model outputs or internal operational details that the facility has not approved for disclosure.
3. Establish a baseline before fine-tuning#
The word "adapt" does not imply that training is mandatory. Choose the least invasive method that meets the verified task requirements.
| Method | Best fit | Important trade-off |
|---|---|---|
| Local pretrained model and approved prompt templates | Standard document summaries and structured response formats | Fastest baseline; limited access to current domain knowledge |
| Access-controlled local RAG | Source-grounded answers, recent documents, citations and revision handling | Requires careful retrieval authorization and evidence evaluation |
| Supervised LoRA adaptation | Consistent approved terminology, output conventions and task behavior | Training data can be memorized; derived adapter must remain protected |
| Continued domain pretraining | Specialized language distribution that simpler methods fail to handle | More compute and greater validation, governance and memorization burden |
| Full fine-tuning | Exceptional need demonstrated by controlled experiments | Highest operational and storage burden; more extensive regression risk |
For a source-grounded analysis assistant, RAG is usually the first experiment: the documents remain in an access-controlled repository, citations can refer back to current sources, and removing or updating a document is more tractable than changing memorized model behavior. RAG does not automatically make an answer correct or access-safe; those properties must be explicitly designed and tested.
Fine-tuning is better suited to behavior and formatting than to storing a large corpus of changeable facts. A combination of retrieval and a locally trained adapter may be appropriate, but only if the internal evaluation shows a meaningful benefit over the simpler baseline.
4. LoRA and privacy-preserving adaptation#
Low-rank adaptation (LoRA) freezes selected pretrained parameters and introduces trainable low-rank updates. For a weight matrix W of shape by , a typical representation is:
where B has shape by r, A has shape r by , and r is a small rank relative to the original matrix dimensions. The additional trainable parameter count for the matrix is r × ( + ), rather than × for updating the entire dense weight matrix.
For example, with a hypothetical 4,096-by-4,096 matrix and rank eight, the adapter has 65,536 trainable matrix parameters compared with 16,777,216 base matrix parameters. That is about 0.39% of the base matrix count, excluding other trainable components. This is a mathematical example, not a claim about total model parameters, VRAM consumption or training speed.
LoRA can reduce optimizer-state and trainable-weight storage requirements. Quantized-base approaches can reduce base weight memory in supported training configurations. Neither technique eliminates activation memory, hardware compatibility constraints, numerical issues or the possibility of memorization.
Most importantly, LoRA is not a privacy guarantee. Adapters, merged weights, optimizer states, caches and checkpoints can encode sensitive information. Keep all artifacts derived from classified datasets within the applicable approved boundary. Never export an adapter simply because it is small, frozen-base training was used, or raw documents were not included in the final file.
Provide generic configurable training and evaluation interfaces tested on explicitly nonclassified fixtures. Authorized internal staff choose the approved dataset, training scope, resources and deployment candidate. Use the facility's own documented data handling, review and retention rules. No live classified training is described or claimed in this lesson.
If a customer requests differential privacy, clarify the exact threat model and privacy definition. Proper differential privacy requires a defined mechanism and accounting of privacy loss; a claimed privacy budget does not establish a declassification decision, prevent all leakage or replace authorization requirements. Federated learning and anonymization similarly do not create automatic permission to transfer artifacts across security domains.
5. Protect the data and all derived assets#
Apply the facility's approved classification and access policies to source documents, extracted text, labels, retrieval indexes, model artifacts, evaluation records and logs. The appropriate label for each artifact is a decision for the authorized security and data owners, not an inference the model or external engineer can make.
| Asset | Why protection matters |
|---|---|
| Raw corpus and training examples | Direct classified content |
| Extracted text, metadata and labels | May preserve sensitive facts, identifiers and relationships |
| Embeddings and vector indexes | Can encode sensitive information and support unauthorized inference |
| Adapter weights and checkpoints | May memorize training content or disclose model behavior |
| Prompts, retrieved passages and outputs | Can reproduce or combine information from restricted sources |
| Evaluation datasets and error examples | Can expose source material and difficult sensitive cases |
| Operational metrics, logs and traces | Even counts, identifiers and timing may disclose sensitive activity |
| Backups and crash dumps | May contain copies of data and process memory |
Use least privilege, approved local identity and access management, role separation and auditable permission changes. Authentication is not authorization: a user who may access the service is not necessarily entitled to every document in its index.
Retrieval must enforce authoritative document permissions and need-to-know before any restricted text enters the model context. Recheck authorization where required on cached results, citation links and source retrieval. Partition indexes and model access according to the facility's classification and compartment policy. Do not rely on a system prompt or post-generation text filter as the primary authorization boundary.
An adapter trained on material from one restricted compartment may need to be treated as a restricted asset itself. Do not expose it to a broader user population without the explicit assessment and approval of the responsible authority.
6. Offline software and model supply-chain assurance#
An isolated facility must be able to install, operate and recover the system without internet access. Prepare a versioned release with approved model weights, tokenizer, runtime, configuration, pinned dependencies, relevant drivers or compatibility requirements, installation instructions, tests and recovery documentation.
Review model and software licensing, origin and applicable security requirements. Minimize dependencies and prefer supported, inspectable artifact formats that do not require executing arbitrary downloaded code. Treat weights, model configuration, tokenizer files, plugins, containers and installer scripts as potentially untrusted.
A manifest should identify exact component versions, expected sizes and cryptographic digests. Use an approved signature and provenance-verification mechanism with an independently established trust root. A hash only establishes correspondence with an expected digest; a malicious package and a maliciously replaced manifest can match perfectly. A valid signature likewise establishes authenticity relative to the signing key, not that the contents are free of vulnerabilities.
The authorized facility team must control import approval, quarantine and inspection. Verify provenance, signatures and digests against the accepted release policy. Inspect the dependency inventory and available vulnerability information, verify compatibility, exercise the package in the approved isolated test environment, and approve promotion through the local release process. Do not bypass review because a package is urgent or because a model provider is familiar.
7. Tested Python example: artifact integrity check#
This dependency-free helper illustrates the narrow task of verifying that bytes match an expected size and SHA-256 digest after the manifest has been authenticated and accepted.
PYTHONimport hashlib import hmac import re def verify_artifact(blob, expected_size, expected_sha256): if type(expected_size) is not int or expected_size < 0: return False if not isinstance(expected_sha256, str) or re.fullmatch(r'[0-9a-f]{64}', expected_sha256) is None: return False if len(blob) != expected_size: return False return hmac.compare_digest(hashlib.sha256(blob).hexdigest(), expected_sha256)
Illustration using entirely synthetic bytes:
PYTHONartifact = b'approved synthetic test fixture' digest = hashlib.sha256(artifact).hexdigest() assert verify_artifact(artifact, len(artifact), digest) assert not verify_artifact(artifact + b'!', len(artifact), digest) assert not verify_artifact(b'wrong', 5, digest)
The expected digest must come from an independently trusted manifest in real use; computing it from the same untrusted bytes and then comparing it proves nothing about authenticity. This helper assumes a bytes object, reads it in memory and accepts a canonical lowercase hexadecimal digest. A real large-model import verifier should use an approved streaming implementation and a verified signature/provenance workflow, secure file handling and immutable staging that protects against modifications between verification and use.
Local verification: Python 3.13.5 executed the exact helper. A test vocabulary of 121 synthetic byte strings (all lengths zero through four over a three-byte alphabet) produced 14,641 ordered actual/expected artifact pairs. Each result was compared with independent byte equality. Eight additional invalid or incorrect manifest-field cases were rejected. All 14,649 checks passed. No classified data was used. The tests verify digest and size comparison on synthetic inputs, not signature validation, facility accreditation, large-file handling or the trustworthiness of a model.
8. Build the offline evaluation process#
Because the external engineer cannot examine the data, evaluation ownership must be explicit. Authorized domain experts define the task rubric, establish representative held-out examples, record the baseline and assess outputs within the enclave.
Do not claim effectiveness based only on a public benchmark or synthetic-data result. Those tests validate the generic package and expected interfaces, not domain quality on the protected corpus.
Select acceptance criteria with authorized owners rather than inventing a universal accuracy threshold.
| Evaluation dimension | Example internal acceptance evidence |
|---|---|
| Task correctness | Expert-reviewed answers for approved document-analysis tasks |
| Grounding | Claims supported by accessible source passages; citation links resolve correctly |
| Uncertainty | Appropriate abstention or explicit qualification when evidence is insufficient or contradictory |
| Authorization | Positive and negative access-control tests, including isolated compartments and revoked access |
| Robustness | Resistance to misleading documents, malformed inputs and instructions embedded in retrieved text |
| Memorization and leakage | Authorized internal tests for inappropriate disclosure of training information |
| Regression | Comparison with the baseline on ordinary language behavior and previously accepted cases |
| Performance | Measured memory usage, latency, throughput and stability on the installed hardware |
| Human oversight | Reviewers can inspect sources, correct outputs and reject unsafe or unsupported recommendations |
Keep evaluation examples separate from training data. Where appropriate, use document- or source-level splits to avoid near-duplicate leakage across sets. Version the dataset, rubric, model, adapter, tokenizer and runtime used for the evaluation. The external engineer can provide test harnesses and synthetic regression cases, but the internal results remain protected unless specifically cleared for release.
A finite negative-test suite does not prove zero possible leakage. Treat security evaluation as one part of the facility's risk assessment and continuous governance process, not as automatic authorization to deploy.
9. Serve evidence-grounded outputs with human review#
A useful document-analysis interface should clearly separate:
- Source evidence: an authorized citation and supporting passage.
- Summary: a faithful account of the source material.
- Inference: an explicitly identified interpretation, with uncertainty and assumptions.
- Missing or conflicting information: a clear indication that available evidence is inadequate or inconsistent.
Source documents may contain mistaken claims, conflicting accounts or embedded instructions. Retrieved text must be treated as data rather than as commands to the application. Restrict the service to approved capabilities, and avoid autonomous external or consequential actions. Where structured results are required, validate the output against a documented schema and keep authorization decisions outside the model.
A fluent model answer is not proof of factual accuracy. For consequential uses, an authorized reviewer must inspect evidence, account for uncertainty and retain responsibility for the decision. The system should support correction, escalation and refusal to answer when necessary.
10. Operational design, scalability and cost#
Offline operation changes deployment economics. The organization must provision local compute, storage, redundancy, monitoring and support capacity rather than rely on elastic hosted APIs.
Estimate model weight memory, activation memory, KV cache, adapter and optimizer states, batch sizes and concurrent workloads using the actual model and accelerator configuration. Benchmark training and inference separately. Account for the local indexing workload, secure backups and operational spare capacity. A model that fits into device memory may still be too slow or unreliable for the intended workflow.
Consider smaller validated models, context budgets, batching and approved quantization where the internal quality evaluation supports them. Avoid selecting the largest model solely because it is available. Trade-offs include lower latency versus higher throughput, quality versus memory use, retrieval freshness versus index maintenance, and adaptation benefit versus additional governance and lifecycle costs.
All versions, dependencies, update artifacts and runtime metrics should be managed locally under approved procedures. Do not depend on external model hubs, license checks, telemetry collection, package downloads or cloud evaluation calls at runtime. The facility needs a documented offline update process and a plan for newly discovered vulnerabilities. If safe maintenance is not feasible, the service may need to remain limited or be withdrawn.
11. Auditability, support and recovery#
Maintain the facility-approved audit trail of release identifiers, authorized approvals, runtime access events, configuration changes, evaluation versions and operational incidents. Keep sensitive evidence in restricted stores. Audit logs should not gratuitously duplicate full documents and prompts; retain only what the approved purpose and policy require.
Use a local, versioned registry and a tested recovery plan. The internal owner must be able to disable a problematic model, restore an approved compatible version, or switch to an authorized manual workflow. Model rollback does not automatically undo outputs or decisions already acted upon.
For support, supply reproducible diagnostic procedures that authorized staff run locally. External engineering can reproduce generic defects on nonclassified fixtures and deliver reviewed updates through the same approved import process. If necessary information cannot be shared under the facility's rules, acknowledge the limitation instead of asking staff to work around classification or export controls.
12. Common mistakes#
- Treating the air gap as a substitute for authentication, authorization or artifact verification.
- Asking internal operators to email a few classified examples, error logs or checkpoints for debugging.
- Assuming embeddings, aggregate statistics or adapter weights are automatically safe to export.
- Fine-tuning before evaluating whether access-controlled retrieval meets the use case.
- Treating a digest check as a complete authenticity or supply-chain assessment.
- Using online dependencies, telemetry or external evaluation by default.
- Evaluating only accuracy while ignoring authorization, evidence quality and uncertainty.
- Claiming the system is secure or compliant based on a design diagram rather than the responsible authority's assessment.
- Removing human review from consequential information-analysis workflows.
Likely interviewer follow-ups#
How can you train on data you cannot access? Deliver reproducible generic tooling and an approved interface tested with public or synthetic data. Authorized internal operators run the actual training and evaluation. You do not receive the classified corpus or unrestricted derived results.
Why use LoRA instead of full fine-tuning? It can reduce trainable parameters and operational resource requirements, and makes candidate adapters easier to version separately. It does not eliminate memorization or establish a privacy guarantee. Choose it only after a justified internal comparison.
Would you export the adapter for support? No, not as a default. Treat derived weights according to the applicable classification and handling policy. Export requires a separate formal authorization, not a technical assumption.
How do you evaluate without seeing examples? Authorized domain experts own the classified rubric, held-out dataset, error analysis and acceptance decision. Generic synthetic tests can establish package behavior. Only information explicitly approved for release may be communicated externally.
What if the model returns a document the user should not see? Treat it as a potential security incident, contain the affected service and involve the security owner. Investigate the authorization, indexing, caching, context and model-access boundaries through authorized internal procedures. Do not rely on a prompt change alone.
What if the customer wants a cloud fallback during an outage? An external fallback contradicts the isolation requirement unless a separately approved architecture and information-flow policy expressly permit it. Use an approved local fallback or manual process.
Interview takeaway#
Deliver the engineering process, not access to the classified data. Start with an authorized local baseline and access-controlled retrieval; adapt with LoRA only when internal evidence justifies it. Protect every derived artifact, verify imports against trusted provenance, evaluate inside the facility, preserve human oversight and make deployment and disclosure decisions the responsibility of the authorized owners.
References
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.Python hashlib documentation (not live-verified)docs.python.org
Related questions
Explore other topics:AI AgentsAI System DesignLarge Language Models