Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Short answer: a self-hosted or local coding agent can keep source code, prompts, and inference inside infrastructure you control, but it is not private by default. You must secure the model server, agent runtime, dependencies, credentials, logs, and network. A hosted assistant can offer professionally operated sandboxes, approval gates, policy administration, and audit telemetry, yet your repository context and prompts are processed by an outside provider. The safer choice depends on your threat model, contract, configuration, and ability to operate secure infrastructure—not on whether the project calls itself “open source.”

What “open-source agent” and “hosted assistant” actually describe

These labels refer to different layers of a coding system. “Open source” generally means that the agent’s code is available for inspection, modification, and redistribution under its license. It does not tell you where inference occurs, whether telemetry is enabled, which model receives your prompts, or whether the agent connects to a hosted API.

A self-hosted deployment runs the agent harness and usually the model-serving components in infrastructure your organization controls. That may be a developer workstation, an on-premises server, a private cloud, or a virtual private cloud. A local harness can still send repository files to a third-party model if its provider endpoint is configured that way.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A hosted coding assistant runs some or all of the harness, model inference, sandbox, logging, and policy services in a vendor’s environment. “Hosted” is not synonymous with insecure. A provider may isolate tasks, disable outbound internet access, enforce human approvals, and retain detailed telemetry. The trade-off is that the provider becomes part of your trust, contractual, and data-residency boundary.

Security and privacy comparison at a glance

Question Self-hosted or local agent Hosted assistant
Where are prompts and code processed? Potentially entirely on local or controlled infrastructure, but only if the model and every auxiliary service are local or inside the same approved boundary. In the provider’s systems, often across a defined set of regions and subprocessors; exact locations depend on product and contract.
Who controls retention and training use? Your logging, backup, and model-serving configuration determines retention. A forgotten debug log can preserve prompts indefinitely. The provider’s plan, privacy statement, account settings, and enterprise contract determine retention and whether interactions may improve models.
Execution isolation and egress You must build and maintain containers or virtual machines, kernel controls, network policy, and dependency mirrors. The provider operates the sandbox, but you must verify its isolation, egress defaults, approval workflow, and available policy controls.
Secrets and credentials You choose the secret broker, token scope, rotation, and process isolation; a misconfigured host can expose everything the agent can read. Credentials may be held by the provider’s integration or injected into a task. Scope, storage, support access, and deletion terms require verification.
Auditability You can retain complete local action logs, but you are responsible for tamper resistance, time synchronization, alerting, and review. Centralized telemetry and administrator controls may be available, though export, retention, and tenant isolation vary by plan.
Patching and supply chain You patch the harness, model server, operating system, containers, plugins, MCP servers, and language dependencies. The provider patches its platform; you still own vulnerabilities in your repositories, integrations, prompts, plugins, and build dependencies.
Data residency and regulation You can select the physical and legal jurisdiction, provided all model and telemetry components stay there. Residency is constrained by the provider’s regions, subprocessors, support access, and contractual commitments.
Operating cost and effort Potentially predictable infrastructure spend, but substantial engineering and on-call responsibility. Lower platform burden and faster model updates, with recurring service costs and vendor-dependency risk.

How data flows through each design

Local or self-hosted inference

In the strongest private design, the agent, model weights, inference server, repository, tool execution, and logs remain on systems you administer. Outbound traffic is denied by default, and approved package or model downloads happen through an internal mirror. This can satisfy strict residency or offline requirements, but only if telemetry, crash reporting, update checks, and plugin calls are disabled or routed internally as well.

Many “self-hosted” deployments are actually mixed. The agent process runs on your machine while prompts and code are sent to a hosted model API. That arrangement may reduce exposure to a hosted agent runtime, but it does not keep source code out of the provider’s service. Document every endpoint used by the harness, model, tool servers, package manager, and observability stack.

Hosted execution

A hosted system may receive a repository snapshot, selected files, prompt history, tool results, and generated patches. The provider then runs commands in a sandbox and returns output. Even when the provider promises not to train on your content, retention for abuse monitoring, debugging, backups, or legal obligations can still apply. Ask which data classes are stored, for how long, in which regions, and who can access support copies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenAI’s Codex announcement describes one hosted implementation this way: “The Codex agent operates entirely within a secure, isolated container in the cloud.” It also states that internet access is disabled during task execution, limiting interaction to supplied repositories and configured dependencies. That design reduces exfiltration paths, but it does not eliminate the need to inspect what repository context is uploaded or how account-level logs are retained.

Hybrid operation

A hybrid policy keeps high-sensitivity repositories on a local or private deployment and uses a hosted assistant for public, synthetic, or otherwise approved code. Redaction, repository classification, and separate credentials are essential; otherwise a developer can accidentally paste a secret from the private environment into the hosted workflow.

Retention and model-training terms vary by plan

Do not infer privacy from a product name. Consumer, individual, team, enterprise, and cloud-marketplace offerings can have different defaults, opt-outs, retention periods, regions, and subprocessors.

GitHub Copilot

GitHub states that, for individual subscribers, it may use “Copilot interaction data — including prompts (inputs), suggestions (outputs), and code snippets generated during Copilot sessions — to train and improve AI models.” The practical implication is that an individual account should not be treated as automatically equivalent to a contractual zero-retention enterprise service. Review the current privacy statement and user settings for the exact account you operate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

GitHub’s model-hosting documentation also notes that some underlying providers operate under zero-data-retention API policies. That fact applies to those providers’ API arrangements; it does not automatically change how GitHub handles data under an individual plan. Record the governing terms for your product surface and subscription before allowing proprietary repositories.

Claude and Claude Code

Anthropic’s retention guidance says consumer Claude and Claude Code surfaces are unaffected by its covered-model change because “we already retain inputs and outputs on these surfaces.” Anthropic separately describes specified enterprise or cloud-provider configurations that can use zero-data-retention arrangements. Therefore, the answer to “Does Claude Code retain my source code?” is configuration-dependent: consumer surfaces retain inputs and outputs, while an eligible enterprise or cloud deployment may have different terms. Verify the exact contract and interface rather than relying on the model’s name.

Questions to put in a vendor review

  • Are prompts, repository files, tool results, and generated patches stored, and for what maximum period?
  • Are any of those data types used for training, evaluation, abuse detection, or service improvement?
  • Which regions and subprocessors handle the data, including support and backups?
  • Can an administrator disable retention, export audit logs, and obtain deletion confirmation?
  • What happens to data when a user, repository, or subscription is removed?

Isolation and network egress are decisive security controls

An agent can read files, execute commands, install packages, call APIs, and alter infrastructure. The security boundary is the combination of its operating-system identity, filesystem permissions, sandbox, network policy, and approval workflow.

Hosted controls

Managed platforms can supply hardened images, short-lived containers, centralized policy, and automatic patching. OpenAI’s safety guidance says security teams need to govern what agents can access, when human approval is required, which systems they can interact with, and what telemetry explains their behavior. Check whether those controls are enforceable for every task or merely recommended settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Internet denial during a task is valuable because it blocks many direct exfiltration and command-and-control paths. It can also break legitimate builds that need package downloads. A mature implementation uses an allowlisted dependency cache or explicitly configured endpoints rather than silently permitting unrestricted internet access.

Self-hosted controls

With self-hosting, isolation quality depends on your implementation. Containers share a host kernel and can be misconfigured; virtual machines provide a stronger boundary but add operational overhead. Restrict mounts to the working tree, run as a non-root identity, use read-only base images, apply seccomp or equivalent restrictions where practical, and separate agent workers from production networks.

Review every outbound connection, including package managers, telemetry libraries, plugin registries, model downloaders, and update checkers. Deny by default, then allowlist only the endpoints and methods required for a specific task.

Credentials and secrets: prevent the agent from becoming a key thief

Agents should receive the minimum capability needed for one task, not a developer’s entire shell environment. Never expose long-lived cloud keys, password-manager exports, signing keys, or unrestricted production tokens through environment inheritance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use short-lived, narrowly scoped credentials issued by a broker immediately before an approved action.
  • Keep secrets outside the repository and mount them only into the specific tool that needs them.
  • Separate read-only analysis credentials from write or deployment credentials.
  • Redact secrets from prompts, logs, stack traces, and tool output before they leave the controlled boundary.
  • Rotate any credential that may have appeared in an agent context; do not assume a deleted chat removes copies from logs or backups.

For hosted assistants, determine whether credentials are stored by the vendor, passed through your own gateway, or injected into an ephemeral sandbox. Confirm scope, support access, revocation, and deletion behavior. For local agents, inspect process listings, crash dumps, shell history, temporary files, and file permissions; self-hosting does not protect a token that your operating system exposes to every process.

Approvals, telemetry, and accountability

Require a human checkpoint before destructive commands, production changes, external side effects, permission changes, or publication of generated artifacts. Read-only repository exploration and test execution can often be automated under a tighter sandbox.

Action logs should record the actor, repository revision, prompt or task identifier, tool invoked, command, result, approval decision, credential identity, and timestamp. Store logs in tamper-evident storage with restricted access and a defined retention period. Avoid logging raw secrets or entire proprietary files when a hash, file path, or redacted excerpt is sufficient.

Hosted telemetry can make centralized review easier, but ask whether logs are exportable, immutable, region-bound, and available to your incident-response team. Self-hosted telemetry gives you control but requires you to build alerting, time synchronization, retention enforcement, and forensic procedures.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Supply-chain responsibility shifts rather than disappears

An open-source agent adds inspectability, not automatic safety. Pin versions of the harness, model server, container images, plugins, MCP servers, and language packages. Review changes before upgrading, verify signatures or checksums where available, and maintain an inventory of transitive dependencies.

Hosted providers carry much of the platform patching burden, yet your agent can still introduce vulnerable generated dependencies, unsafe shell commands, or malicious instructions from an untrusted repository. Treat repository instructions, plugin manifests, and tool definitions as untrusted input. Do not let a README or configuration file silently rewrite approval policy.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Generated code remains untrusted

Security controls around the agent do not guarantee secure output. SecureAgentBench reported only 15.2% correct-and-secure solutions for its best tested combination in 2025. The study also found that explicit security instructions did not significantly improve secure coding. Use independent review and automated checks instead of assuming a security-focused prompt is a control.

  • Run static analysis, dependency and license checks, secret scanning, and tests in a separate verification environment.
  • Review authentication, authorization, input validation, deserialization, path handling, and cryptography manually for high-impact changes.
  • Compare generated patches against the task’s intended scope and reject unrelated edits.
  • Require a maintainer to approve production deployment even when tests pass.

Can you run an AI coding assistant completely offline?

Yes, but “offline” means more than disconnecting the browser. The model weights, inference runtime, agent harness, documentation, package cache, telemetry sink, and update process must all work without external calls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Select an offline-capable model and verify its license. Confirm that redistribution and commercial use match your organization’s requirements.
  2. Stage artifacts through a controlled import process. Scan model files, container images, plugins, and dependencies before transferring them to the offline network.
  3. Run the model server locally or in an approved private environment. Bind it only to the required interface and enforce authentication between the agent and server.
  4. Disable external telemetry and update checks. Point logs to an internal collector and review source code for unexpected network calls.
  5. Build an internal dependency mirror. Reproducible builds require access to approved packages without granting the agent general internet access.
  6. Test failure behavior. Confirm that unavailable endpoints cause a clear error rather than a fallback upload to a hosted provider.
  7. Apply the same approvals and scanning used online. Offline execution removes some exfiltration paths; it does not make generated code trustworthy.

Offline operation can require substantial hardware, model-serving expertise, storage, and update work. It is justified when residency, classified data, or network isolation outweighs those costs.

Hardening checklist for either model

  • Classify repositories and prohibit high-sensitivity data in unapproved agent environments.
  • Grant least-privilege filesystem, repository, cloud, and database access.
  • Isolate credentials from the agent process and use short-lived tokens.
  • Deny network egress by default; allowlist required endpoints or use an internal cache.
  • Require approval for destructive commands, production changes, and external side effects.
  • Pin and review MCP servers, plugins, model versions, container images, and dependencies.
  • Redact secrets and unnecessary personal data before sending context.
  • Keep tamper-evident action logs without storing raw secrets.
  • Scan generated code, dependencies, and infrastructure changes independently.
  • Use separate environments for untrusted repositories and third-party contributions.

Additional checks for hosted assistants

  • Read the exact plan’s retention, training-use, region, subprocessors, logging, deletion, and administrator-control terms.
  • Confirm whether repository indexing, embeddings, chat history, and support diagnostics follow the same policy as task execution.
  • Test approval gates and egress restrictions with a non-sensitive repository before rollout.
  • Negotiate incident notification, breach responsibilities, data-return or deletion procedures, and audit rights where appropriate.
  • Configure organization-wide settings rather than relying on each developer to remember an opt-out.

Additional checks for open-source and self-hosted agents

  • Verify model weights, licenses, provenance, and integrity before deployment.
  • Inspect container or VM isolation, host-kernel exposure, privileged mounts, and runtime capabilities.
  • Review update cadence, default telemetry, outbound connections, local log permissions, and backup handling.
  • Restrict who can change system prompts, tool definitions, plugins, approval rules, and model endpoints.
  • Assign ownership for patching, vulnerability response, capacity, key rotation, and 24-hour incident escalation.

OpenHands illustrates the range of deployment choices available in an open-source, model-agnostic platform: local, cloud, and enterprise-VPC runtimes, with controls over which identity runs an agent, what it can access, where it executes, what it spends, and what it changes. Its Agent Canvas documentation also describes a local agent server, a self-hosted virtual machine, and a managed cloud sandbox. Those choices are useful only when the selected runtime and model endpoint are included in your security boundary.

Which option fits your threat model?

Choose local or self-hosted execution when

  • Source-code residency, offline operation, or jurisdictional control is a hard requirement.
  • You can staff secure inference, patching, identity, network, logging, and incident response.
  • You need to inspect or modify the agent and model-serving stack.
  • The cost of operating private infrastructure is acceptable compared with disclosure risk.

Choose a hosted assistant when

  • Managed isolation, centralized administration, rapid model updates, and lower platform burden matter most.
  • The provider’s contractual retention, training, residency, subprocessor, and deletion terms satisfy your threat model.
  • You can enforce repository classification, redaction, approvals, and least-privilege integrations.
  • Your team benefits from provider-operated telemetry and security maintenance.

Use a hybrid design when

  • Some repositories contain regulated or highly confidential material while others do not.
  • You want local execution for sensitive work and hosted productivity for lower-sensitivity tasks.
  • You can maintain separate identities, credentials, network policies, and policy enforcement for each environment.

Bottom line

Self-hosting narrows the vendor trust boundary only when inference, telemetry, dependencies, and credentials remain inside infrastructure you control—and when that infrastructure is competently secured. Hosted assistants can be safer operationally because they provide hardened sandboxes, approval controls, and centralized telemetry, but their privacy depends on the exact product surface and plan. Evaluate data flow, retention, training use, egress, secrets, auditability, residency, and operating responsibility as separate decisions. In every deployment, treat the agent and its output as untrusted, and keep a human-controlled security review between generated changes and production.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.