Key insight: OpenCode does not reach into your files on its own. The only thing that leaves your machine is what you explicitly include in a session — your prompts and the context you attach. Understanding that boundary makes it much easier to use confidently.

The two boundaries that matter

When you're working with OpenCode, there are two things worth understanding:

1. Your files stay on your machine (or GitHub in the cloud)
Everything in your working folder — your context packs, your documents, your AGENTS.md — sits on your local machine or in your GitHub repository. OpenCode knows those files are there, but it doesn't send them anywhere unless you explicitly bring them into a session.

2. What gets sent to the model is what you include in the conversation
When you ask OpenCode something, your prompt goes to the model. If you reference a file with @ or OpenCode reads a file to complete a task, that file's content goes with it. That's the extent of it — nothing else leaves your machine.

The practical implication: you control what the model sees. If you don't include a file in a session, the model never sees it.

Where your files should live: The question of whether to keep files locally or in GitHub is a setup decision, not a safety one — for your organisation's enterprise GitHub the protections are equivalent. See File Management for the practical decision and setup steps.

Is it safe? Your organisation's enterprise agreement

OpenCode uses GitHub Copilot under your organisation's enterprise agreement with GitHub. This means:

This puts it in a very different category to using a consumer AI tool like the free version of ChatGPT, where your inputs may be used for training. With OpenCode via your organisation's agreement, you have meaningful data protections in place.

Note: This page reflects general understanding as of mid-2026. For the authoritative position on data handling and acceptable use, check with your IT Security or Legal team — particularly before including anything under NDA or containing customer data.

What's fine to include as context

With those protections in place, the following types of content are generally appropriate to use as context:

If you'd share it with a colleague on a Webex call without hesitation, it's almost certainly fine as context.

What to keep out

Even with enterprise protections, some content should stay out of your context:

A quick decision framework

When you're unsure whether something is appropriate to include as context, run through these questions:

  1. Does it contain passwords, tokens, or credentials? → No. Use the API keys guide instead.
  2. Does it contain customer PII? → Anonymise first.
  3. Would I share this with a colleague via Webex? → If yes, it's likely fine.
  4. Is it under a specific legal or vendor restriction? → Check first.
  5. Still unsure? → Leave it out and work around it.