Feedback loops for air-gapped AI

When the deployment can't phone home, you have to build the phone. How to capture failures inside isolated environments, carry them out safely, and still ship fixes on a steady cadence.

Two grids of cells separated by a gap, with a loop crossing it

Cloud AI products get better for a boring reason: every bad answer is visible to the people who can fix it. A user gives a thumbs-down, the trace lands in a dashboard, someone on the team looks at it over coffee, and by Friday there's an evaluation case and a fix. Nobody designs that loop on purpose. It falls out of having telemetry.

Put the same product on a network with no route to the internet and the loop is gone. The assistant gets something wrong, a user sighs, closes the tab, and goes back to doing the task by hand. Nobody upstream ever finds out. Multiply that by a few thousand users across several customer organisations and you have a product that quietly gets worse in the field while looking fine in every demo.

This post is about how to rebuild that loop for isolated deployments: what to capture, how to triage it on site, how a bundle of evidence can leave the environment without anyone losing sleep, and how fixes come back. Most of it is plumbing. The plumbing turns out to be the product.

The constraints, stated plainly

It helps to be honest about what "air-gapped" means in practice, because people outside the work tend to imagine a single locked room. It's usually less dramatic and more annoying than that.

  • No outbound telemetry. Not "restricted", not "via a proxy". Nothing leaves on its own.
  • No remote access. The vendor can't SSH in to look at a log. If an engineer needs to see something, someone on site has to show it to them, or they have to be there.
  • Change control measured in weeks. A release goes through the customer's own review, scanning and approval. A hotfix is not a git push; it's a request with a ticket number.
  • Data that can't leave as-is. The conversations are about the customer's work. Most of the value of a failure report is in exactly the content that is most sensitive.
  • Different people own different halves. The customer's IT team owns the environment. The vendor owns the platform. Neither side can fix a problem alone.

You can't fix what you can't see, and in this setting you can't see anything by default. So the first job is making failures visible inside the boundary, to the people who are allowed to look.

The feedback loop across the air gapCapture and triage happen inside the customer's network. Only scrubbed, approved bundles cross, and only by the customer's own transfer process.

Step one: capture enough to reproduce

The temptation is to capture everything. Don't. A failure report you can't read in two minutes doesn't get read. What you want is the smallest record that lets an engineer, weeks later and somewhere else, say "yes, I can make that happen again".

A good design has every capture event write one record to a local store inside the deployment. Useful triggers are:

  1. An explicit thumbs-down, with an optional free-text reason.
  2. A tool call that errored, timed out, or was denied by policy.
  3. A retrieval that returned nothing for a question that should have had an answer.
  4. A user rephrasing the same question within a short window, which is a surprisingly good proxy for "that wasn't what I asked".
  5. A conversation abandoned mid-way through a multi-step action.

Each record should hold the conversation turns that matter, the IDs of the documents retrieval returned along with their scores, every tool call with arguments and results, the policy decisions, and the exact versions of everything involved: model, prompt template, connector, platform build. Versions are the part people forget, and they are the part that makes a report useful three releases later.

feedback/capture.py
python
@dataclass(frozen=True)
class FailureRecord:
    id: str
    tenant: str
    trigger: Trigger            # thumbs_down | tool_error | empty_retrieval | rephrase | abandoned
    created_at: datetime
    turns: list[Turn]           # only the turns leading to the failure
    retrieved: list[DocRef]     # ids + scores, never the document body
    tool_calls: list[ToolTrace]
    policy: list[PolicyDecision]
    user_note: str | None
    # versions: the difference between "interesting" and "reproducible"
    model: str
    prompt_template: str
    platform_build: str
    connectors: dict[str, str]  # connector name -> version
    index_snapshot: str         # which embedding index the retrieval ran against
 
def capture(event: Event) -> None:
    if not event.tenant.feedback_enabled:
        return
    record = build_record(event)
    store.append(record)        # local, append-only, inside the boundary

Two choices in there matter more than they look. First, store document references, not document bodies. The body is already in the customer's system; copying it into a second store doubles the surface you have to protect. Second, make capture per-tenant and let it be switched off. Some customers will want it from day one. Others will want a month of watching before they agree. Both are fine.

Step two: triage on site, with the customer watching

Raw records are noise. An on-site dashboard that groups them by likely cause turns a hundred complaints into six problems. Start with crude rules and keep them crude, because crude rules are easy to explain to the customer admin who is looking over your shoulder.

BucketSignal to useUsually means
Retrieval missempty or low-score resultsmissing documents, stale index, wrong permissions
Wrong tooltool chosen but user rephrased or abandonedtool descriptions overlap, prompt routing
Policy over-denypolicy denied, user had a legitimate rolerole mapping out of date
Connector failuretool error from one connectorupstream system changed, token expired
Model answereverything worked, answer still rated badthe actual model problem

I'd make the dashboard visible to the customer's own admins, not just the vendor. It feels risky: the worry is that showing a customer a list of everything your product got wrong is a bad look. In my experience the opposite happens. Admins start fixing their own half: re-syncing a connector, adding a missing group mapping, uploading the policy document that everyone keeps asking about. Trust goes up because nothing is hidden.

Failure causes over the first quarterMost early failures tend to be plumbing, not the model. Illustrative shape, not real figures.

Step three: carry it out, slowly and on purpose

At some point a problem needs an engineer who isn't on site. That means evidence has to cross the gap, and crossing the gap is where everyone, correctly, gets nervous.

Make the export a bundle, built by a tool that runs inside the environment, and design it to be boring to approve:

  1. Select. A triager picks specific records, never "export all".
  2. Scrub. Names, emails, phone numbers, ID numbers and anything matching the customer's own patterns get replaced with stable placeholders, so the same person is PERSON_3 throughout a conversation.
  3. Strip. Document references stay as opaque IDs. No bodies, no file names unless whitelisted.
  4. Review. The bundle renders as a readable HTML report. A named person on the customer side reads it and signs off. If they can't understand it, it doesn't leave.
  5. Seal. The bundle is hashed and the hash recorded locally, so later nobody has to wonder what exactly went out.
  6. Transfer. Through the customer's normal process. Nothing automatic, nothing the vendor controls.

What goes into an export bundleEach stage can only remove information. Nothing is added after the human review step.

The rule that makes approvals fast: every stage can only remove information. Nothing gets added after the review step, not even metadata. Once reviewers learn that what they see is exactly what will leave, approval times drop from days to hours.

export/policy.yaml
yaml
bundle:
  max_records: 50
  require_reviewer: true
  scrub:
    builtin: [person_name, email, phone, national_id, iban]
    custom_patterns:            # supplied by the customer, kept in their repo
      - name: case_number
        regex: "CASE-[0-9]{6}"
  documents:
    include_body: false
    include_filename: false
  seal:
    hash: sha256
    log: /var/lib/assistant/export-ledger.jsonl

Step four: ship the fix back

The fix itself should go back as a normal platform release. Nothing special, which is the point: the customer already knows how to review and approve one of those. Two habits make it work:

Every fix starts as an evaluation case. Before touching code, the scrubbed record becomes a test: given this conversation and this retrieval state, the assistant should do this. The case goes into the shared evaluation set that runs against every build. A fix for one customer protects every other customer, and the same failure can't come back without a red build.

Releases carry a "what you told us" section. The release notes list which reported problems the release addresses, by the triage ID the customer already knows. It turns a version number into a reply.

evals/cases/retrieval_miss_0142.py
python
CASE = EvalCase(
    id="retrieval_miss_0142",
    source="field:export-bundle",
    conversation=load_turns("bundles/0142.json"),
    index_fixture="fixtures/policy_docs_v3",
    expect=[
        RetrievedAtLeast(doc_tag="leave-policy", k=3),
        AnswerCites(doc_tag="leave-policy"),
        NoToolCall("hr.create_request"),   # user asked a question, not for an action
    ],
)

The surprising part

Once a loop like this has a few months of triaged data, the split is rarely what anyone expects. A large share of what users call "the AI got it wrong" is not a model problem at all. The usual suspects:

  • Documents that exist in a shared drive nobody has connected.
  • Group memberships that haven't synced since a reorganisation, so the policy layer correctly denies access the user was supposed to have.
  • A connector whose upstream system changed a field name and started returning empty results without erroring.
  • Two tools with descriptions so similar that the model picks between them almost at random.

Every one of those is invisible from inside the model and obvious from inside a trace. A loop like this pays for itself on plumbing alone, before you ever get to prompt or model changes. And the model problems that are left are much easier to see once the noise is gone.

How to know the loop is working

A feedback system can quietly become a filing cabinet: records go in, nothing comes out. Four numbers per deployment are worth watching, ideally reviewed in a regular meeting with each customer:

  1. Capture rate. Failure records per thousand conversations. If it drops to near zero, the product didn't suddenly get perfect. Capture is probably broken, or users have stopped bothering to report.
  2. Time to triage. How long a record sits before someone puts it in a bucket. Above a week, the on-site process needs attention, usually because the person who owned it moved on.
  3. Time across the gap. From "this needs an engineer" to the bundle arriving with the vendor. This is the number the review design is meant to shrink, and it's the one customers care about most.
  4. Repeat rate. How often an already-fixed failure comes back. With evaluation cases in place it should be close to zero. When it isn't, it's almost always a fix that went into one customer's configuration and never made it into the platform defaults.

None of these measure model quality directly. They measure whether the people who can fix things are finding out about them. Model quality follows from that.

What I'd recommend from the start

Build capture before the first deployment, not after the first complaint. Adding it once things are live means the first weeks of field data, arguably the most valuable, are simply lost.

Design the bundle with the reviewer, not for them. A JSON export is complete and nobody can approve it, because nobody on the customer side can read it. The readable report should be version one.

Treat silent failures as first-class. Errors are easy to catch. The connector that returns nothing successfully, or the policy that denies correctly against stale data, needs its own detectors. An alert on "zero results for a query class that usually has results" catches more than any exception handler.

Give the customer the dashboard on day one. Holding it back out of caution only delays fixes the customer could have made themselves.

The short version

On a connected product, the feedback loop is free. On an isolated one, you have to build every part of it: capture that's small enough to read, triage the customer can see, an export that only ever removes information, and fixes that arrive as tests first and code second. It's unglamorous work. It's also the difference between a deployment that improves every month and one that slowly gets abandoned while the usage numbers still look fine.