An organization may approve an AI chat for development while restricting direct access to proprietary repositories. Developers can ask for help, but still need to decide which source files, internal interfaces, and customer details they are allowed to share.
A local-first workflow makes that decision explicit: inspect the repository locally, prepare the context needed for a task, and review it before pasting it into an approved chat. The repository stays under your control; the shared context still leaves your machine.
What “Air-Gapped AI Coding” Really Means
True air-gapping keeps both the model and codebase fully offline. Selectively sharing code with a cloud chat is a different arrangement. Here are three common setups:
- Fully local AI: Everything stays on your hardware. Maximum privacy, but higher hardware demands and potentially weaker model performance.
- Local-first, selective disclosure: The repository stays local. A trusted local tool prepares limited, reviewable context that you manually paste into an approved cloud chat.
- Cloud-connected agents: Broad repository access with automation. Most convenient, with the largest trust boundary.
Local-first, selective disclosure can fit teams allowed to share reviewed snippets with a cloud service but unable to grant it repository access.
Privacy Policies Aren’t Technical Boundaries
Provider policies matter, but they do not solve data minimization. Even enterprise-oriented tools can send more context than a task requires. The safer approach is to minimize disclosure before anything reaches the provider.
The Secure Workflow: Map → Extract → Apply
A strong local-first tool should keep three operations visible and controllable:
- Map the repository structure, including languages, modules, and files, without sending source code.
- Extract only the specific files or spans the AI requests.
- Apply changes only after you review the write plan.
AI Badger, built by PVR Labs, implements this model as a local CLI that prepares context without an AI service connection. You review what you share with an AI chat such as ChatGPT, Claude, or Grok.
The source-level network verification guide records the audited revision, release configurations, and reproducible checks. No reachable outbound networking operations were identified in Badger’s Go code in those configurations. This does not guarantee that Git, diagnostic tools, clipboard utilities, file managers, or network-backed filesystems remain offline; the guide explains those boundaries.
A Simple Workflow
1. Describe task → Badger generates a project map (no source code)
↓ You review and copy it to chat
2. AI requests specific context → Badger extracts → You review
↓ You copy approved context to chat
3. AI suggests changes → Badger shows a write plan → You confirm
This creates explicit gates on both outbound disclosure and inbound modifications.
Find Your Starting Point with Codebase Map
In a large repository, first identify the relevant modules and folders. AI Badger’s standalone Codebase Map is a portable HTML visualization generated with badger map. Explore the hierarchy and language totals to understand the codebase, locate relevant submodules, and focus AI-assisted work on a specific area.
This visualization is separate from the project map prepared for an AI chat in the Map → Extract → Apply workflow above. Folder selection guides task focus; it is not an enforced file-access boundary. Review the context you extract and share.
The Clipboard Is Part of the Boundary
Copy-paste feels less “agentic”, but that explicitness is the feature. Every transfer is deliberate. Endpoint security still matters, of course: clipboard managers and remote-access tools can observe content.
When This Approach Fits
- Enterprise teams allowed to use web chats but not repo-indexing extensions
- Freelancers working under strict NDAs
- Engineers handling credentials, unreleased features, or customer data
- Teams using multiple AI providers without per-vendor integrations
It trades some automation for visible control, which is ideal for architecture, debugging, reviews, and focused implementation.
A Practical Conservative Process
- Confirm the target AI service is approved.
- Run Badger locally and review the project map.
- Let the AI request only what it needs.
- Review extracted source before sharing.
- Review and confirm all proposed writes.
- Run tests, linting, and secret scans before committing.
Conclusion
Secure AI coding requires both an approved provider and control over what you send to it.
Keep the repo local. Expose only narrowly selected, human-reviewed context. Require confirmation on every write.
AI Badger is built for this controlled-disclosure model: it keeps your proprietary code under your control while letting you use the cloud reasoning you choose.