In this guide
Code intelligence tools need to read your code to be useful. Search, explanation, architecture maps, and agent context all start with an index: a parsed, structured, searchable representation of the repository. The question that matters for security is where that index is built, where it lives, and what leaves your machine on the way.
For many teams, source code is among their most sensitive assets. It contains business logic, internal service names, infrastructure layout, occasionally secrets that should not be there, and in regulated industries, code that is itself subject to contractual or legal controls. This post explains what local-first code indexing means, lays out a practical threat model, and gives a list of questions to ask any vendor before you connect a private repository.
Key takeaways
- "Local-first" means parsing and indexing happen on the developer's machine, and source does not need to be uploaded to a vendor to be understood.
- The threat model covers more than breaches: retention, secondary use, access by vendor staff, subprocessors, and what gets sent to model providers.
- Local indexing narrows exposure but does not remove it. AI features still send selected context somewhere; know exactly what and where.
- Ask vendors concrete questions about data flow, storage, retention, training use, access, and deletion, and get the answers in writing.
- Reduce what is exposed regardless of tool: keep secrets out of repos, exclude sensitive paths, and scope tokens narrowly.
What indexing involves
To build a useful index, a tool typically:
- Fetches the source (clone, API download, or reading a local folder).
- Parses files into syntax trees, often with a parser like tree-sitter.
- Extracts symbols, references, imports, and calls into a graph or tables.
- Optionally builds a text search index and embeddings.
- Stores the result for queries.
Every one of those steps handles the full source. In a server-side architecture, all of it happens on vendor infrastructure: the repo is cloned to their servers, parsed there, and the index stored there. In a local-first architecture, the same steps run on your machine, in a desktop process, a CLI, or a browser worker, and the index stays local.
Why local matters
Smaller attack surface
Code that never reaches a vendor's servers cannot leak from them. A server-side index is a concentrated target: many customers' source in one place, often with broad internal access for debugging and support.
Simpler compliance
If source stays on approved machines, you often avoid a new data processing review, a new entry in your vendor inventory for source code, and questions from customers who contractually restrict where their code can go. That does not remove the need for review, but it changes its scope.
Fewer retention questions
With a local index, deletion is deleting a local cache. With a server-side index, deletion depends on the vendor's backup and retention policies, which are harder to verify.
Clearer access control
A local index inherits the access the developer already has. A server-side index needs its own access control model, and mismatches (a repo permission revoked in your Git host but cached in the tool) are a classic source of exposure.
A practical threat model
Think about who could get access to your code and how, at each stage.
| Stage | Server-side risk | Local-first risk |
|---|---|---|
| Fetch | Vendor holds a token with repo read access; token theft exposes repos | Token held locally or not needed for local folders |
| Parse and index | Source on vendor compute; logs may capture snippets | Source on developer machine; normal endpoint risk |
| Storage | Index at rest on vendor storage and backups | Index in local cache or browser storage |
| Query | Queries and results pass through vendor servers | Queries run locally |
| AI features | Vendor sends context to a model provider | Tool sends selected context to a model provider |
| Support and debugging | Vendor staff may access indexes | Usually none unless you share data |
| Deletion | Depends on vendor retention and backups | Clear local cache |
Two things stand out. First, local-first moves most risk to the endpoint, which you already have to secure anyway. Second, AI features are a data flow in both models. Local parsing does not change the fact that asking a model a question about code sends some code to wherever the model runs.
Threats to consider
- Breach of vendor storage. Exposes everything indexed there.
- Over-broad tokens. An OAuth app with read access to every repository in your organization, when it only needed one.
- Retention beyond need. Indexes or logs kept long after you stopped using the tool.
- Secondary use. Code or prompts used for product analytics or model training.
- Subprocessors. The vendor's cloud, logging, and model providers each see some data.
- Insider access. Vendor staff with access to customer data for support.
- Prompt and context logging. AI requests containing code snippets logged on the vendor or model provider side.
- Endpoint compromise. For local tools, malware on the developer machine can read the index, though it could read the source too.
What local-first does not solve
Being honest about the limits helps you evaluate claims.
AI features send context. When a tool explains code or answers a question with a model, the relevant snippets go to the model provider, directly or through the vendor. A good local-first tool sends only the selected context for the question, not the repository, and tells you which provider receives it.
Agents read code too. A coding agent you run with a local code graph over MCP still sends what it reads to its own model provider. The graph helps by making those reads narrower, which also means less code leaves the machine per task, but the agent's provider is still part of your threat model.
Endpoint security still matters. Local caches are only as safe as the laptop. Disk encryption and normal endpoint controls apply.
Fetching from a host needs a token. If the tool downloads from GitHub, it needs access. Scope it to what is needed.
Questions to ask vendors
Get these answers in writing, ideally from documentation or a security page rather than a sales call.
Data flow
- Where is source code parsed and indexed: on our machines or yours?
- Does any source code leave the developer's machine during indexing? If so, what, and where does it go?
- For AI features, what exactly is sent to the model, which provider receives it, and does it pass through your servers?
- Is there a mode with no AI features where nothing leaves the machine?
Storage and retention
- What do you store on your servers: source, indexes, embeddings, query logs, prompts, model responses?
- How long is each kept, including backups?
- How do we delete our data, and how is deletion confirmed?
Use
- Is our code, prompts, or outputs used to train or improve models, yours or a provider's? Is that opt-in or opt-out?
- Is any of it used for analytics or shared with third parties?
Access
- Which vendor staff can access customer code or indexes, under what conditions, and is that access logged?
- What subprocessors handle our data?
- What repository permissions does your integration request, and can it be limited to specific repositories?
Assurance
- What security certifications or audit reports can you share?
- How do you handle vulnerability reports and incidents, and how quickly do you notify customers?
A vendor that answers these clearly and specifically is easier to trust than one that responds with "enterprise-grade security".
Reduce exposure regardless of tool
Some controls help no matter which tool you choose:
- Keep secrets out of repositories. Use a secret scanner in CI and pre-commit hooks. A tool cannot leak a secret that is not in the code.
- Exclude sensitive paths. Most tools support ignore patterns. Exclude directories with customer data fixtures, keys, or regulated code.
- Scope tokens narrowly. Grant access per repository, read-only, and review installed apps periodically.
- Separate AI from indexing. If policy forbids sending code to model providers, prefer tools whose indexing and navigation work without AI features.
- Set agent permissions. Coding agents should have read access to what they need and no more; see human-in-the-loop for AI coding agents.
- Document the data flow. Write down, for each tool, what leaves the machine and where. It makes reviews and incident response faster.
Evaluating a tool yourself
Claims are easy to make. You can check some of them:
- Watch the network. Open the browser developer tools or use a local proxy while indexing a test repository. Does source content appear in outbound requests?
- Test offline. After the initial load, disconnect and try navigation features. Local-first tools should keep working for anything that does not need a model.
- Inspect local storage. See what is cached and how to clear it.
- Index a canary. Put a unique, harmless string in a test repo and check whether it ever shows up in requests.
Where OpenVisio fits
OpenVisio indexes repositories in the browser: parsing runs with tree-sitter compiled to WebAssembly inside a web worker, so source is not cloned to a server. The index is cached in the browser for 24 hours so reopening is quick, and you can index a local folder as well as a GitHub repository. The map, file tree, and Explore views work from that local index. AI features, such as Ask and narration, are part of OpenVisio Pro and involve a model, so the questions above apply to them as they would to any tool. The same graph can be exposed to coding agents over MCP, as covered in using an MCP server for codebase context.
Local-first is not a slogan to accept or reject wholesale. It is a specific architectural choice that removes some risks, leaves others, and makes the remaining data flows easier to see. Ask where every byte goes, and choose the tools whose answers you can verify.

