Self-Hosted AI Coding Agents: Choose Your Route
Updated November 17, 2026 · first published July 18, 2026 · by the AQ team
To run AI coding agents on your own infrastructure, put an agent CLI and the repository on a machine you control, or install an open-source agent platform there. OpenHands and OpenCode are both open source (MIT) and self-hostable: OpenHands runs its harness and per-conversation Docker containers on your host, and OpenCode is an agent CLI with a headless server mode (opencode serve) that can use local models through Ollama, LM Studio or vLLM. For a team that wants shared, persistent agent workspaces on its own machines without operating a harness, AQ runs the agents on a VM in your cloud account, with AQ's hosted dashboard on top.
AQ runs your team's AI coding agents in isolated sandboxes on infrastructure you control: self-hosted VMs or servers in your own cloud account, a dedicated always-on cloud sandbox that AQ manages in its own isolated network, or locally on your Mac with the AQ Mac app, with every task in its own git worktree and branch. On a customer-owned VM the code, worktrees, agent sessions and CLI logins live on that VM; AQ's dashboard stays hosted by AQ, so AQ is not self-hosted software, and the model route and the machine's egress policy are still yours to set.
Concretely: run the agent CLI and repository on a Linux VM you control, using tmux for persistence, OpenHands or Coder for a self-hosted platform, or Cline for open-source CLI, Desktop and VS Code surfaces. Add a local model when prompts must stay in your network, and put an authenticated proxy in front of a shared model server to govern keys, logs, capacity and egress. Agenta is MIT-licensed and self-hostable, but its own repository scopes it to team automation around Claude Code, Codex and Pi, not an agentic development environment for writing code.
What self-hosting keeps local, flow by flow
A coding agent setup moves data along five separable paths. "Self-hosted" in a vendor's documentation usually describes the first one only, so read every claim against this list:
- Host execution. The filesystem with your clone, the shell, the build toolchain, local credentials such as a GitHub token or a cloud profile, and the machine's network position. Every option on this page keeps this on your machine. It is the highest-stakes flow, because whatever the host can reach, the agent can reach.
- The model request. The system prompt, the conversation so far, every file the agent read, every command's output, the tool definitions, and the model's reply. Its owner is the model provider, a gateway in between, or your own GPU server. Only the last of those keeps this flow inside your network.
- Hosted coordination. Session state, transcripts, orchestration metadata, telemetry, update and feature checks. A plain CLI on a plain VM has the least of this; platforms with a hosted dashboard or control plane carry more, and the vendor's own documentation is the only reliable source for how much.
- Tool and MCP output. What a command printed, what a file contained, what an MCP server returned. This output goes back into the model request, so the second flow inherits whatever the agent happened to read. This is where an accidental disclosure of a secret or an internal hostname happens, and a repository or dependency that instructs the agent to read something sensitive is attacking this flow.
- Artifacts. Screenshots, recordings, log references and PR text that a platform uploads to its own storage so they can appear in a dashboard or a pull request.
The practical consequence: serving the model locally constrains the second flow and nothing else. It does not limit which files the agent may read, where its tool output goes, what telemetry the CLI sends, what packages a build downloads, or what a compromised process on the host can reach. Read and write permissions, egress policy and credential scope each need their own control, and each needs to be verified separately. Coding agent permission modes explained covers the first of those; keeping secrets out of coding agent prompts covers the tool-output half.
The threat model to write down
Treat repository files, issue text, websites, dependencies, MCP responses and tool output as untrusted input that can contain prompt injection. The agent processes that input with shell and file access, useful credentials and a network route. The trust boundaries are the host user and its filesystem reach, each credential's scope, the model endpoint, every tool or connector, the coordination service, and the artifact store. The failure modes are reading or changing files outside the task, disclosing source or credentials in a model request or tool call, executing an injected command, reaching an internal service, and uploading a sensitive screenshot or log.
A shared model server adds its proxy, identity provider, key database, logs, response cache, repository index and session store to those boundaries. Assume keys will be shared or stolen, prompts and tool output will contain source and sometimes secrets, and a cache or index without tenant-scoped keys can return one user's source-derived content to another. Offboarding fails when a revoked person keeps another credential or an existing session. Capacity failures include queueing, overload errors and context truncation under load. A supposedly local deployment also fails open when web search, telemetry or a tool call reaches an external service that the model request never touches.
A git worktree separates checkouts and reduces file collisions. It does not constrain system calls, network access, credential reads or another process on the same machine. "Self-hosted" says who operates the software; it does not turn that software into a security sandbox. Keep human review and branch protection between agent output and release, and use the broader controls in safe AI coding agents on your own repos for repository permissions, credential handling and review.
Why run coding agents on your own infrastructure?
- Code custody. The repository clone, build outputs and everything the agent writes stay in your own cloud account or data center.
- Credential custody. A useful agent holds real secrets: a GitHub token that can push, database URLs, cloud credentials. On your machine they stay on hardware you can audit and wipe. Custody alone is not enough: anything the agent reads can still end up in a model request.
- Internal network access. Agents inside your network can reach private package registries, staging databases and services behind your VPN. This is also why egress policy matters: the same position lets a misdirected agent reach them too.
- Data residency and review. Regulated teams must document where source code and secrets go. "Execution stays in our cloud account" is a short answer; "model requests go to provider X under agreement Y" is the second sentence that answer needs.
- Laptop lifetime. An agent on your laptop dies when the lid closes. A server session keeps working through your commute and overnight.
- Compute economics. You pay your cloud provider's price for the VM, with no platform compute margin on top.
What is the simplest way to self-host a coding agent?
A plain Linux VM with tmux and SSH. Claude Code and Codex run on a headless server, and tmux keeps the session alive when your connection drops.
# On the VM (once): install your agent CLI and log in
ssh dev-box
# Per task: a named tmux session that outlives your SSH connection
tmux new -s fix-auth
claude # or codex, or any terminal agent
# Detach with Ctrl-b then d. Close your laptop. Later, from anywhere:
ssh dev-box
tmux attach -t fix-auth
Add mosh for flaky networks and Tailscale to keep the VM off the public internet. Full control, few moving parts, every CLI works, and it costs only the VM. The self-hosted AI coding agent setup guide covers sizing, hardening, headless CLI auth and keeping sessions alive; running Claude Code on a cloud VM walks the provisioning end (provider, instance size, headless login), and keeping Claude Code running after closing your laptop goes deep on the persistence patterns.
The limits arrive with teammates and scale: sharing a session means sharing SSH access, two tasks in one checkout trample each other unless you script git worktrees per task (a worktree separates checkouts; it does not sandbox the commands an agent runs in one, which is the other half of limiting what a coding agent can destroy), tmux sessions are in memory so a reboot clears them, and nobody sees what agents are doing without logging in.
Which coding-agent software can run on your infrastructure?
Three coding-focused routes cover the agent and a user interface on your machines as of November 2026: OpenHands, Coder Agents, and Cline's open-source surfaces. That is a deployment statement, not a claim that every connection or every surface is local. Agenta also self-hosts, with the adjacent scope described below.
OpenHands is an established self-hostable harness. The repository is MIT-licensed; OpenHands Cloud and OpenHands Enterprise are separate commercial offerings. It runs through Docker: the Agent Canvas and an outer Agent Server run on your host and, with the Docker conversation runtime, each conversation gets its own container with its own Agent Server and tools. The project's own note on that setting is worth repeating: it isolates conversation execution and does not move the whole Canvas into a sandbox. OpenHands can also drive third-party agents such as Claude Code and Codex over the Agent Client Protocol, in which case the external agent manages its own model, tools and execution. If you are weighing it against the routes on this page, the OpenHands alternatives page compares them head on.
The model is bring-your-own: paste an API key for a hosted provider, or set a custom base URL to point at a local server. The local LLM guide documents Ollama, vLLM, SGLang and LM Studio, with two context constraints re-checked November 2026: Ollama's default 4,096-token context is far too small for the agent's system prompt, so the guide sets OLLAMA_CONTEXT_LENGTH to at least 22,000 (its example uses 32,768), and the LM Studio steps recommend 32,768 for performance. Its Kubernetes deployment is documented too, with the caveat from the same docs that Agent Canvas is an unauthenticated, single-tenant application; access control is yours to add.
Coder Agents went generally available on September 9, 2026 and fits teams that want the agent platform on their own infrastructure: the agent and its execution run in a private data center or your cloud account, including air-gapped environments, and the model can be Anthropic, OpenAI, Google, Azure, AWS Bedrock, or any OpenAI-compatible endpoint, including a self-hosted one behind a custom base URL. The platform is open source under AGPL v3. As of November 2026 Coder's pricing page lists up to five active agents on the Community and Premium tiers and an unlimited AI Premium tier that adds headless agent triggering from CI and network-isolated agent workspaces; its licensing docs describe Premium's cap differently, so confirm the current terms with Coder. One boundary worth knowing before you promise "air-gapped": Coder's licensing and usage docs describe usage reporting over HTTPS to a Coder endpoint, with air-gapped deployments asked to arrange an alternative.
The tradeoff for both: you operate them. OpenHands needs Docker socket access to spawn sandbox containers, Coder is a platform to deploy, and upgrades, persistence and access control are your job either way.
Cline is the third route. Its current repository lists Apache-2.0 code and includes the CLI, open-source Desktop app, VS Code extension and SDK; the same index says the JetBrains plugin is not open-sourced. Cline can execute on your VM or workstation with your own provider credentials or with local runtimes including Ollama and LM Studio. The CLI reference covers interactive and headless operation, JSON output, provider configuration, worktrees, scheduled agents and the local hub. Choose the exact surface you intend to run instead of treating the whole product family as one open-source package.
Cline's current documentation, rather than the local check below, describes three coordination features with different surface limits:
- Multi-Agent Teams. Cline documents a coordinator that delegates subtasks to specialist agents, each with its own tools and context. The task board, agent mailbox and mission log persist in
~/.cline/data/db/teams.dband resume with the session. Cline documents teams for the SDK, CLI and Kanban, not VS Code or JetBrains. Persistent team state is coordination, not host isolation: review every specialist's tool and credential access separately. - Scheduled agents. Schedules have the same documented surface limit. They run through the hub, persist across process restarts and run independently of a terminal session. Scheduled runs default to YOLO mode and approve their own tool calls. They use the last-used provider and model unless you set them explicitly. Review the hub host's workspace, execution mode, model and credentials before leaving a recurring run enabled.
- Messaging connectors. CLI-only connectors cover Slack, Telegram, Discord, Google Chat, WhatsApp and Linear. An incoming message creates or continues an agent session; Slack threads retain their conversation context. Each connector needs its own platform credentials, and webhook modes need a public base URL. Slack socket mode needs no public request URL and is single-workspace only. Cline warns that anyone who finds an unrestricted Telegram bot can message it and execute tasks on your machine. Use Telegram's allowed-user option or the cross-connector hook to restrict users, and treat chat messages as untrusted input before enabling tools.
Approval and network controls need separate review. The approval documentation provides per-category controls and warns that YOLO mode approves file, command, browser and MCP actions; the CLI check below found auto-approval enabled by default in version 3.0.74, so set the behavior you intend rather than assuming every action will ask. Cline's telemetry documentation says usage and error telemetry is on by default across VS Code, JetBrains, Desktop and CLI even with your own API keys. It documents telemetryOptOut for the CLI and a hub restart to apply the change everywhere, while sign-in, feature flags and Cline-provider requests still contact Cline servers. Local execution and a local model do not remove telemetry, updates, connectors, model traffic or credential flows.
Agenta's scope: team automation around coding agents
Agenta is open source under MIT and self-hostable, but it is not a direct OpenHands or Cline replacement. Its repository explicitly calls it the wrong tool for an agentic development environment for writing code. Agenta places a shared team workspace around execution provided by Claude Code, Codex and Pi: files, team access, triggers, versions and traces for work in areas such as IT operations, support, finance and other team processes. Its self-hosting guide uses Docker Compose and documents a separate runner service. Evaluate it when that adjacent automation is the requirement, with the same model, connector, credential and egress questions as a coding deployment; do not select it as the coding IDE or harness in this comparison.
Can you self-host workers for Cursor or Warp Oz?
Yes. The vendor's product stays in its cloud, and a worker you run executes the tools next to your code. The precise boundary is in each vendor's documentation, and it is narrower than the word "self-hosted" suggests.
Cursor documents Self-Hosted Machines in two shapes as of November 2026: My Machines, which connects a personal laptop or VM to your own account, and Team Pools on the Enterprise plan, where a service account authenticates shared, centrally managed workers and a pool request goes to an available machine. Workers open a long-lived outbound HTTPS connection to Cursor's backend; no inbound ports, public IPs or VPN tunnels are required, and the documented ceiling is 200 workers per user and 1,000 per team. The worker performs file edits, terminal commands, computer-use tools and local MCP servers, and the full checkout, build cache and machine-local credentials stay on it. Cursor runs the agent loop, inference and planning. During a run the worker sends Cursor the content the agent needs: file contents, terminal output, diffs, screenshots, local MCP results and routing metadata. Desktop sharing and the live workspace are additional, opt-in streams. The worker also uploads artifacts such as screenshots, videos and log references to Cursor-managed storage; blocking both documented artifact hosts stops those uploads and nothing else, since tool calls and results keep flowing. So the clone stays local, and the context the model reads does not.
Warp's Oz platform offers self-hosting on its Enterprise plan. Its security and networking page (updated October 30, 2026) describes two architectures: a managed one where the platform routes work to an oz-agent-worker you run (Docker by default, or Kubernetes Jobs, or directly on hosts), and an unmanaged one where your own CI or scripts invoke the agent command and Warp tracks the session. Stored and executed only on your infrastructure: repository clones and source files, build artifacts, runtime secrets and environment variables, and workspace state. Routed through Warp's backend: orchestration metadata, session transcripts (which the page says include agent-generated summaries of code context, file contents the agent reads and command output), and model requests and responses. Warp attributes the backend routing to Zero Data Retention agreements and states that it does not persistently store your source code or train on it; the page gives no retention period, so take those as Warp's statements about Warp, to be confirmed in your own agreement. A team-managed endpoint or a bring-your-own-LLM option routes inference through your own provider accounts, with cloud agent support varying by provider, and the endpoint must be reachable from Warp's servers.
This pattern satisfies "our clones, build outputs and runtime secrets stay in our network." It does not satisfy "no source-derived content leaves our network": the content the model reads still flows through the vendor and the model provider under their terms.
What changes when you self-host Claude Managed Agents?
Anthropic now documents two ways to move Claude Managed Agents onto your own infrastructure, and they draw the data boundary in different places. In the fully self-hosted option you run the server, its database, the sandboxes and the session history, and you choose the inference provider. In the older self-hosted sandbox option Anthropic still runs the service and receives the conversation and every tool result. Neither one is a local model, so a third route, serving an open-weight model yourself, is a separate decision. The facts below come from Anthropic's self-hosted overview, data and access page and differences page, as read on November 17, 2026. Recheck them before you plan around them.
Three routes, three data boundaries
- Fully self-hosted Managed Agents. The overview puts the service, the sandboxes, agents, sessions and each session's history on your cloud account or data center. You run the server, a PostgreSQL 16 or later database, the workers that run the agent's shell and file tools, and an admin console on your server, and the data and access page says Anthropic has no remote access to the server or its log. The model runs at the Claude API by default, or at Amazon Bedrock, Claude Models on Google Cloud, Microsoft Foundry, or a model gateway you run (inference provider docs). Access is by request: on November 17, 2026 every page in the set says to contact your Anthropic account team, and the server download ships under its own software license.
- Self-hosted sandboxes. Anthropic announced this route on May 19, 2026 as a public beta (Claude blog). Its documentation moves tool execution onto infrastructure you control while Anthropic keeps running the agent. Tool inputs and outputs still flow to Anthropic so the model can decide its next step, Anthropic stores session transcripts until you delete them, memory stores stay hosted by Anthropic, and the page lists the route as not eligible for zero data retention. Choose it when the requirement is "commands run inside our network," and read it as the same hosted service with a worker on your side.
- Local inference. None of the Managed Agents pages describes a local or offline model. The gateway option forwards model calls to whatever your gateway reaches, and the documentation does not describe what sits behind it. When the model request itself must stay on your hardware, serve an open-weight model yourself and use a harness that supports it, as described in the local model section below, with the access controls that section lists.
Self-hosting the service does not make it offline or zero-retention
The data and access page states that each model call carries the conversation so far, including prompts, tool inputs and tool results, and that what the server sends and receives falls under your organization's agreement with the provider that serves the model, including its retention terms. Running the server yourself moves storage and access to your side. Every model request still leaves the server for the provider you configured.
Three details from the same pages are worth knowing before a security review:
- Identifying headers. When the Claude API is the provider, each model call carries
anthropic-managed-agents-session-id,anthropic-managed-agents-agent-idandanthropic-managed-agents-environment-id. The IDs carry no name or content but encode when your server created them, and no setting turns them off. The API key on every request identifies your organization. IfANTHROPIC_BASE_URLnames a proxy or gateway, the headers go there, and under any other provider the server never sends them. - Credential checks. The server checks its Claude API credential at startup and every 60 seconds by default (
health.check_interval). Those calls run no inference. - Model fallback. Under the Claude API the server asks for server-side fallback by default: when a safety classifier declines a request, another Claude model, possibly a less capable one, can answer, and no event reports the change. Set
inference.model_fallback: falseto turn it off.
Security checks for a fully self-hosted deployment
Each item below is a documented default or limit, with a check you can run against your own deployment.
- Configure a database. With no database, which is the default, the server keeps its data in memory and a restart erases it. Check: create a test session, restart the server, and confirm the session still lists.
- Plan deletion beyond the API. An API delete removes a session and its history from the database but keeps the session's ID. It does not reach database backups, exported logs and traces, or what the agent wrote to a memory store, and on Kubernetes it leaves the session's
/workspacevolume in place. The server writes no log files and logs to standard error, so retention is whatever your log pipeline keeps. Check: delete a test session that contains a marker string, then search your backups, log pipeline, tracing backend and volumes for it. - Treat server egress and worker egress separately. The server connects to the inference provider, the database, the MCP servers and Git hosts you allow, and the collectors, identity providers and secret managers you configure. A worker has whatever network access its container or VM allows, and every command the agent runs through it inherits that access. Check: from a shell inside a session's sandbox, try to reach a host you did not allow and an internal address, and confirm both fail.
- Keep listeners private. The API and console listen on
127.0.0.1:8400by default, and the console page loads for anyone who can reach it, with actions behind sign-in. The Prometheus metrics listener has no credential; it is off by default, and the Helm chart turns it on at port 9464 of every pod. The optional egress gateway listener is plain HTTP on port 8410 on every interface, and its answers carry stored credential values; Compose and Helm let only the gateway reach it. The pages also ask for Docker Engine 28.3.3 or later, because some earlier releases let machines on the local network reach a port published on loopback. Check: from another host on the same network, request ports 8400, 9464 and 8410 and confirm each one is refused. - One deployment per tenant and per trust level. Environments in one deployment do not keep trust levels apart, and the server API key reaches every environment. Roles limit only the requests a caller makes with their own token: code the agent runs can call the server with any credential its sandbox holds, and an environment key can read events and post tool results in every session of its environment. The agent's
bashtool is a real shell with the worker's permissions, and the worker does not isolate it, so put each session's worker in its own container or pod, as Compose and the sandbox Helm chart do. - Start from an empty server. Nothing is copied from the hosted service, session history included. Agents, skills, vault credentials and memory stores have to be created again on your server.
What the self-hosted server does not do yet
The differences page, read on November 17, 2026, lists these gaps against the hosted service:
- Only self-hosted environments exist; a cloud environment request returns 400.
/v1/messagesand/v1/modelsreturn 404. - No Files API or file resources (memory stores work), no prebuilt document skills (upload them from the skills repository), no scheduled deployments, no dreams, and no webhooks: a worker that starts on a webhook never starts.
- MCP credentials of type
mcp_oauthare rejected because there is no OAuth refresh flow; use a static bearer token and replace it before it expires. - MCP servers need
mcp.allowed_hostnames, empty by default, matched exactly with no wildcards, over HTTPS. MCP tool results are cut at 100 KiB by default and the rest is lost. - Git repositories need
git.allowed_hostnamesandgit.allowed_push_refs. The server adds the token, so it never reaches the sandbox. It does not refuse force pushes, so an agent can overwrite any branch you list, and its log reportsokeven for a push your Git host refused. Keep branch protection on the Git host. - Web search and fetch are off until
web_tools.enabledis set, and depend on the provider. Environment-variable vault credentials need the egress gateway. Images and documents sent by URL are accepted, but the model never sees them. - Multiagent sessions support only a coordinator with 1 to 20 listed agents, and the Claude Console does not show what is on your server.
Can a local model keep prompts on-prem?
For the model request, yes, and that is the one flow a local model controls. Claude Code executes on your machine and calls Anthropic's API by default. Codex CLI is open source under Apache 2.0 and runs locally, with the reasoning at OpenAI. Wherever the agent runs, prompts carry code context to the model provider under its data terms.
Open-weight models served on your own GPUs change the destination of that flow. As of November 2026, Ollama (since v0.14.0), vLLM and llama.cpp's server each document an Anthropic-compatible Messages API, so Claude Code can be pointed at them through ANTHROPIC_BASE_URL. Ollama's Claude Code integration page documents the setup and now recommends a 64k or larger context window (up from the 32k its page gave in October), the same lesson as the OpenHands guidance above. Cline documents local inference through Ollama, LM Studio and Atomic Chat in its local-model guide. Three qualifications belong next to that sentence:
- The server project provides the compatibility, and Anthropic's support does not extend to it. Anthropic's LLM gateway documentation says it "doesn't endorse, maintain, or audit third-party gateway products, and doesn't support routing Claude Code to non-Claude models through any gateway." A local endpoint works because the server implements the API shape; when it breaks, the fix comes from that server's project.
- Changing the inference URL is one route, and the CLI has others. Claude Code's network configuration page lists the hosts it contacts beyond the API: authentication and token refresh, plugin and update checks, docs lookups, release notes, telemetry and error reporting, and the WebFetch domain safety check, which still goes to api.anthropic.com unless skipWebFetchPreflight is set. Several of those have documented switches (CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING); others, such as sign-in, are part of normal operation. The page also documents proxy variables and custom CA settings, which is how a locked-down network sees and limits this traffic instead of assuming it away.
- The cost is capacity and capability. You need suitable GPU hardware, and open-weight coding models still trail hosted frontier models on hard agentic work. Model releases change quickly, so benchmark the exact model and quantization you plan to serve (see the DeepSeek V4 Pro and GLM-5.3 model guides).
Most teams split the decision: self-host execution and custody, keep a frontier hosted model under your own accounts and keys, and cover the prompt flow with the provider's enterprise data terms. Teams whose policy says prompts never leave the network pick a local endpoint and then verify the other flows separately, starting with the check below.
A local model endpoint is not an access-control boundary
A loopback address or private IP controls who can open a connection. It does not establish which human or agent made a request, what that caller may do, who can read the request later, or whether one caller's cached content is visible to another. A team sharing one model server needs these controls around it:
- Identity for every human and every agent. Give each person a named identity and each automated agent its own credential and owner. A shared key makes spend and abuse attribution ambiguous; an agent key with no owner leaves offboarding incomplete. Use team identity for aggregate limits, not as a substitute for the human or service identity behind a call.
- A key lifecycle. Issue keys with only the required models and routes, an expiry, rotation and revocation. Test every alternate credential and live session during offboarding. Revoking one key does not revoke a second key, a service account or a session that already holds access.
- Rate limits at two scopes. Set per-key request, token and parallel-request limits to contain one runaway agent, and per-team limits to bound the group. These are admission controls, not GPU reservations, DLP or a guarantee that a response contains no sensitive data.
- Log governance. Prompts, responses and tool output can contain source code, credentials, customer data and internal hostnames. Inspect proxy spend logs, callback exporters, server debug logs, reverse-proxy access logs and client transcripts separately. Set retention and reader access for each; redacting one sink does not redact the others.
- Storage beyond the model weights. Inventory repository indexes, embeddings, response and prefix caches, and retained sessions. Record their tenant namespace, location, embedding provider, readers and deletion path. Separate keys do not prove separation in those stores.
- Egress beyond inference. Telemetry, web search, updates, model pulls and agent tools have their own routes. Control them with client settings and a firewall or filtering proxy, then verify with egress logs. A local model URL says nothing about those connections.
- Capacity and context under concurrency. Several agents share GPU memory, queue space and context capacity. Measure queueing, overload responses, preemption and the context the client actually sends. Long histories can be rejected or truncated by client or server limits; a successful HTTP response does not prove the whole history arrived.
Which controls are native, and which need a proxy
Ollama's API documentation says local requests do not need an API key. Its FAQ documents loopback binding by default, OLLAMA_HOST for network exposure, and OLLAMA_NO_CLOUD to disable cloud models and web search. For capacity, it says required RAM scales with OLLAMA_NUM_PARALLEL times OLLAMA_CONTEXT_LENGTH, and a full queue returns HTTP 503. vLLM's serve reference documents --api-key, but warns that it protects only paths under /v1, /v2 and /inference; /invocations exposes the same inference capability without that authentication. Do not rely on that flag alone. Its capacity controls include --max-model-len, --max-num-seqs, --max-num-batched-tokens and --max-num-queued-reqs, with HTTP 503 when the in-flight request limit is reached. The checked Ollama and vLLM documentation does not describe per-human key issuance, rotation and revocation or per-team quotas. Add a reverse proxy or gateway for those controls, keep the model server private to it, and restrict every server route, not only the route your client uses.
LiteLLM is one concrete gateway with those controls documented. Its virtual-key guide covers model and route scope, explicit user and team ownership, expiry, rotation with an optional grace period, and key blocking. Its budget and rate-limit guide covers per-key, per-user and per-team RPM, TPM and parallel-request limits. The virtual-key setup requires Postgres. Set user_id explicitly when an admin creates a key; the guide notes that an admin-created key without it has no owner. For multiple proxy instances, the same guide says Redis coordinates the counters, while the default Redis-outage behavior falls back to per-instance limits. Use fail_closed_rate_limit_enforcement when exceeding the configured limit during a Redis outage is unacceptable.
The logging defaults need equal attention. LiteLLM's log documentation says request and response content is not stored in spend logs by default, with store_prompts_in_spend_logs as the opt-in and a configurable retention period. Other logging callbacks have separate redaction settings. vLLM's engine reference says request logging is off by default, DEBUG request logs include prompt inputs, and enabling output logging records output text and finish reasons at INFO. Check the effective configuration instead of assuming that a local server or a proxy redaction switch covers every copy.
Caches need their own tenant rule. LiteLLM's official security mapping says its exact-match response cache is keyed on the request alone, so two keys or teams sending an identical request share a cached response unless a cache namespace is configured; only its semantic cache is tenant-scoped. It also documents vector-store access per store rather than per document. Repository indexing belongs to the agent or retrieval layer, not automatically to the model server. Cline states that it does not build a codebase index or embeddings; other clients and retrieval services need their own storage review.
Web search is a separate route even when the model is local. Ollama's Codex integration says Codex web-search requests through the Ollama profile are executed by Ollama for local and cloud models, require Ollama sign-in, and can be disabled for the session. Claude Code's documented WebFetch safety check and telemetry hosts, and Cline's documented default telemetry, are additional examples. Per-user keys improve attribution and revocation. They do not sandbox the model host, stop prompt injection, provide DLP, isolate a shared cache by themselves, or prove that a response cannot disclose data.
A model-access check with fake identities
Run this against a disposable LiteLLM proxy and local test model, never production. Create a throwaway master key, map the model name local-test to that model, and use only fake users, generated test keys and the fabricated source marker below. The commands print key inequality, HTTP statuses, response metadata and marker counts, never keys or prompt bodies. This is a control check, not a benchmark.
set -euo pipefail
D=$(mktemp -d)
P=http://127.0.0.1:4000
ADMIN=sk-fake-test-admin
BODY='{"model":"local-test","max_tokens":32,"messages":[{"role":"user","content":"Return AQ-FAKE-SOURCE-7f3a9c2e and nothing else."}]}'
new_key() {
curl -fsS "$P/key/generate" \
-H "Authorization: Bearer $ADMIN" -H 'Content-Type: application/json' \
--data "{"user_id":"$1","models":["local-test"],"rpm_limit":$2}" | jq -r .key
}
call() {
curl -sS -o /dev/null -w '%{http_code}
' "$P/v1/chat/completions" \
-H "Authorization: Bearer $1" -H 'Content-Type: application/json' --data "$BODY"
}
ALICE=$(new_key fake-alice 1)
BOB=$(new_key fake-bob 1)
test "$ALICE" != "$BOB" && echo 'distinct keys: yes'
curl -fsS "$P/key/block" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' --data "{"key":"$ALICE"}" >/dev/null
call "$ALICE" # Revoked key: record rejection
call "$BOB" # First request in this RPM window
call "$BOB" # Same window: record the documented rate-limit response
- Inspect every log sink. Send the marker once with a fresh key. In the LiteLLM Logs view, its database, callback exporter, reverse-proxy log and model-server log, record the path or table, identity fields, whether the marker is present, and the configured retention. Use
grep -R -c AQ-FAKE-SOURCE-7f3a9c2e "$D"for counts on disposable logs. Do not publish request or response bodies. - Locate derived source storage. Use a disposable client home and a fake repository containing only the marker. Snapshot file lists before and after the first task with
find "$D" -type f -print, including any vector-store or cache directory. Identify session, index, embedding and cache files and their namespaces. If the client documents no repository index, record that documentation rather than inferring the same design for every client. - Run two concurrent known-answer requests. Create a third fake agent key with a high enough RPM limit for this step. Send the same BODY twice concurrently, saving responses under "$D". Record HTTP status, elapsed time, queue or preemption metrics,
finish_reason, token usage and marker count withjqandgrep -c. Repeat with the production context limit and concurrency settings you intend to use. Record truncation or errors; do not infer them from throughput. - Verify egress. Enable only the intended client features, trigger one web-search request and one ordinary model request, and inspect firewall or filtering-proxy logs for destination hosts and allow or deny decisions. Repeat with the documented telemetry and cloud switches off, including OLLAMA_NO_CLOUD and the client's web-search setting. Record routes only, not payloads, and test the agent's other tools over the same window.
A routing check you can reproduce
A receiver on your own loopback shows where a CLI sends the model request, which is one line of its documentation worth confirming on your own machine. The check below uses a disposable home directory and an empty project outside any real checkout, a fabricated marker, a fake credential, and a listener on 127.0.0.1 that records one request and stops. No repository, account, inherited secret or external model is involved, and nothing in your real configuration changes.
# 1. A disposable home and project, outside any real checkout
export D=$(mktemp -d); mkdir -p "$D/home" "$D/project"; cd "$D/project"
# 2. A loopback receiver that records one request and exits
# (OpenBSD netcat syntax; other builds take -l -p 48131)
( nc -l 127.0.0.1 48131 > "$D/request.txt" ) &
# 3. The CLI with an empty home, a fake credential, and non-essential traffic off
env -i PATH="$PATH" HOME="$D/home" CLAUDE_CONFIG_DIR="$D/home/.claude-config" \
ANTHROPIC_BASE_URL=http://127.0.0.1:48131 ANTHROPIC_API_KEY=dummy-not-a-real-key \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 DISABLE_TELEMETRY=1 \
DISABLE_ERROR_REPORTING=1 DISABLE_AUTOUPDATER=1 \
timeout 30 claude -p "Reply with this marker: AQ-ROUTE-CHECK-7f3a9c2e" < /dev/null
# 4. What reached the receiver: the request line and whether the marker arrived
head -1 "$D/request.txt"; grep -c AQ-ROUTE-CHECK-7f3a9c2e "$D/request.txt"
Observed again on November 6, 2026, with Claude Code 2.1.318 on Linux and the settings above: the receiver recorded POST /v1/messages?beta=true HTTP/1.1 and the marker count was 1. The CLI timed out because the receiver never answered, which is the expected end of this capture-and-stop run. Header values and request bodies were not published or reproduced here; the request line and marker count are the reported evidence. This rerun replaces the November 1 observation made with Claude Code 2.1.316.
What this establishes and what it does not. It shows that with ANTHROPIC_BASE_URL set, this CLI version sent the model request, including the prompt text, to the configured endpoint. It does not show the absence of other connections: the check captured one loopback route, inside a window of thirty seconds, with the documented non-essential traffic switches on. Whether the CLI opened anything else during the run was outside the capture, and a real deployment answers that question with host egress logs or a filtering proxy, over a longer window, with the real configuration in place of an empty one. The check also measures nothing about model quality, and it certifies nothing about any vendor; it is a way to confirm one line of a vendor's documentation on your own machine, and to repeat the confirmation after each CLI update.
A local Cline CLI and configuration check
This second check uses a temporary package directory, home and project. It installs the published CLI, then runs only version and help commands with an empty environment. It makes no model call and supplies no credential. The npm install downloads the package; the subsequent commands are local inspection.
set -euo pipefail
D=$(mktemp -d)
trap 'rm -rf "$D"' EXIT
mkdir -p "$D/home" "$D/project"
env -i PATH="$PATH" HOME="$D/home" npm install --prefix "$D/pkg" \
--no-audit --no-fund --loglevel=error cline > /dev/null 2>&1
cd "$D/project"
CLINE="$D/pkg/node_modules/cline/bin/cline"
env -i PATH="$PATH" HOME="$D/home" "$CLINE" --version
env -i PATH="$PATH" HOME="$D/home" "$CLINE" --config "$D/home/.cline" --help
env -i PATH="$PATH" HOME="$D/home" "$CLINE" --config "$D/home/.cline" config --help
Observed on November 6, 2026: the version was 3.0.74. The top-level help listed --json, --auto-approve <boolean> with default true, --provider, --config, --worktree, and the schedule, hub and update commands. The configuration help printed Usage: cline config [options] and its --json option. These observations document the installed interface and its approval default. Help output does not prove a network boundary, an execution sandbox or the absence of telemetry. Verify those with the CLI's telemetry setting, your firewall or proxy logs, and the configuration you actually use.
How is self-hosted different from bring your own cloud (BYOC)?
They overlap, and vendors increasingly use both terms, so be precise about which you need. Self-hosted, in the strict sense this page uses, means you operate the software on infrastructure you control: the plain VM, OpenHands, Coder and Cline's open-source surfaces fit that description. It says nothing by itself about where model requests, telemetry or connectors go. Bring your own cloud (BYOC) means the workloads run on compute in your cloud account, whoever operates the software around them: some BYOC offers run vendor-managed infrastructure inside your tenant, and some (AQ's customer-owned VM option, or the Cursor and Warp worker options) pair machines you hold root on with a vendor-hosted coordination layer. Both keep code and credentials in your account; they differ in who administers the boxes and how much platform you run yourself. The bring your own cloud guide maps that landscape from the vendor's side, including the questions to ask any BYOC offer.
The options at a glance (November 2026)
| Option | Runs on your infrastructure | Goes through a vendor | Model request goes to |
|---|---|---|---|
| Plain VM + tmux | Execution, code, credentials, the CLI itself | The CLI vendor's sign-in, update and telemetry endpoints, to the extent its switches leave on | The hosted provider, or a local endpoint through the CLI's base URL |
| OpenHands | Harness, UI and execution | Nothing required by the open-source install | Any provider by API key, or a local server by base URL |
| Coder Agents | Platform, orchestration and execution; air-gap capable | Usage reporting to Coder by default; air-gapped installs arrange an alternative | Anthropic, OpenAI, Google, Azure, Bedrock, or any OpenAI-compatible endpoint |
| Cline CLI, Desktop and VS Code | Open-source agent surfaces, execution, code and provider credentials; the JetBrains plugin is not open-sourced | Telemetry by default, plus the sign-in, feature, update and connector flows you enable | Your chosen hosted provider, or Ollama, LM Studio or another supported local runtime |
| Agenta (adjacent team automation) | MIT-licensed shared workspace and separate agent runner; not a coding IDE or harness replacement | Your configured model, chat, MCP and app connectors, each with its own data path | Your configured hosted model or self-hosted Ollama runtime |
| Cursor Self-Hosted Machines | File edits, terminal commands, computer use, local MCP; the full checkout, build cache and machine-local credentials | Agent loop, planning and inference; file contents, terminal output, diffs, screenshots and MCP results sent during a run; artifact uploads | Cursor's hosted models |
| Warp Oz self-hosted | Clones, source files, build artifacts, runtime secrets, workspace state | Orchestration metadata, session transcripts, model requests and responses | Warp-managed inference, or your own provider accounts for enterprise teams |
| Claude Managed Agents, fully self-hosted (by request) | Server, database, sandboxes, sessions and session history | Access and the server download through your Anthropic account team; nothing else required by the documented setup | The Claude API, Amazon Bedrock, Claude Models on Google Cloud, Microsoft Foundry, or a gateway you run |
| Claude Managed Agents, self-hosted sandboxes (public beta) | Tool execution in sandboxes you operate | The service, agent loop, session transcripts, tool inputs and outputs, and memory stores | Anthropic |
| AQ | Agent CLIs, code, worktrees, credentials and execution on a machine that is yours alone: a VM in your own cloud account on Pro, or a dedicated AQ-managed VM | The web dashboard that streams sessions, previews and the team layer | Your own connected subscriptions (Claude Code, Codex, Cursor and others, unmetered), or AQ models on AQ credits through AQ's own provider accounts |
Can coding agents use private package registries and internal libraries?
Yes, when the machine running the agent can reach the registry and holds a credential that may read from it. The agent installs packages the same way a developer's build does, so the work is in the network path and the credentials. Most onboarding time for a custom build environment goes into three things: a network path from the agent machine to the registry and any internal services, a read-only token supplied without being written into the repository, and the toolchain versions the repository pins.
- Network path. A registry inside your VPC or behind a VPN is reachable only from a machine on that network, or through a tunnel you run. Allow the registry host in the machine's egress policy.
- Credentials as secrets. Use a read-only token scoped to the packages the project needs, supplied as an environment variable. Keep the config file that references it, such as
.npmrcwith//npm.example.internal/:_authToken=${NPM_TOKEN}, free of the value itself. The agent can read the variable, so assume the token can appear in a model request and scope it accordingly. - Toolchain. Pin Node, Python and the package manager in the repository so the agent machine installs the same versions as CI.
A check you can run on the agent machine, as the same user the agent runs as, before giving the agent a task:
# Which registry and scope does npm resolve to here?
npm config get registry
npm config get @yourco:registry
# Can this user read one internal package?
npm view @yourco/internal-lib version
# The same for Python, against your internal index
pip download --no-deps --index-url "$PIP_INDEX_URL" yourco-internal-lib -d /tmp/registry-check
If those commands fail for the agent's user and succeed for yours, the agent will fail the same way mid-task. On AQ, a saved secret reaches terminals, previews and agent runs as an environment variable, AQ cloud machines install the Node and Python versions a repository pins, and a host on your own private network is reachable through an overlay network you run from the repository's setup, as described in connecting to a private network. A customer-owned VM reaches whatever its own network allows.
How to compare coding agents for on-prem or private repositories
Compare them by where each piece of data lives and who can reach it. Ask every vendor the same questions and get the answers from its documentation:
- Where code runs. Which machine holds the clone and runs commands, and who else can run code on it.
- Where the control plane runs. Whether orchestration, the agent loop and the dashboard run on your infrastructure or the vendor's.
- Where transcripts live. Which store keeps prompts, tool output and session history, for how long, and what a delete removes.
- Where credentials live. Which tokens sit on the agent machine, which sit with the vendor, and whether agent-run code can use them.
- Egress. Which hosts the agent machine and the control plane each call, and whether you can restrict both.
- The model request. Which provider receives prompts, under which agreement and retention terms.
- Who can see sessions. Which people, roles and vendor staff can open a running or finished session.
The coding agent sandboxes guide covers what each isolation layer does, and the secure cloud workspace guide covers the host controls that apply whichever product you pick.
Deployment decision checklist
Before picking a route, write down the answers to these for your own environment. Each one names a boundary, the assumption that usually goes unexamined, and the way it fails.
- Host execution. Boundary: which machine runs the shell, and who else can run code on it. Assumption: "it is our VM, so it is isolated." Failure: a shared box or a shared checkout, where one task's agent reads or overwrites another's files; mitigate with one machine per team and one worktree or container per task, plus operating-system and process controls because a worktree is not a sandbox.
- Model request. Boundary: which endpoint receives prompts, and under what agreement. Assumption: "we set the base URL, so prompts stay local." Failure: a gateway or endpoint that forwards to a hosted provider, or a CLI update that changes a default; mitigate with the routing check above, repeated after updates, and the provider's written terms for whatever is hosted.
- Model-server access. Boundary: which identity and key authorize a call, which logs and derived stores retain it, and how much capacity it can consume. Assumption: "a local endpoint and separate keys isolate the team." Failure: an unauthenticated route, a stolen alternate key, full prompts in a debug exporter, a cross-team cache hit, or queue and context pressure from parallel agents; mitigate with a scoped gateway, private backend routes, explicit cache namespaces, log retention, per-key and per-team limits, and the synthetic check above.
- Hosted coordination. Boundary: transcripts, orchestration state, updates and telemetry. Assumption: "the vendor only sees metadata." Failure: transcripts that include file contents and command output, as Warp's and Cursor's documentation each spell out; mitigate by reading the vendor's data-flow page before the contract, turning off the switches the CLI documents, and restarting any background process whose settings require it.
- Tool and MCP output. Boundary: what the agent is allowed to read and run. Assumption: "it only reads the repository." Failure: a cat of an .env file, a verbose build log with a token in it, or a repository file that tells the agent to fetch a URL; mitigate with a permission mode that asks before access outside the project directory, secrets kept out of the agent's reach, and credentials scoped per task.
- Artifacts. Boundary: what gets uploaded to vendor storage for the dashboard or the PR. Assumption: "screenshots are harmless." Failure: a screenshot of an admin page, or a log reference with an internal hostname; mitigate by knowing the artifact hosts and deciding whether to block them, with the understanding that blocking uploads changes nothing about the other flows.
- Egress. Boundary: which hosts the machine may reach at all. Assumption: "nothing calls out except inference." Failure: package installs, update checks, telemetry, connectors, or a compromised process reaching anything the VM can; mitigate with a filtering proxy or firewall policy you own, verified against the host's own logs over a representative window, and with the understanding that any network check has a scope and a time limit.
- Review and release. Boundary: who can approve the branch and what can merge or deploy it. Assumption: "the tests passed and the worktree is separate, so the change is safe." Failure: injected instructions, an unwanted dependency, a weakened test or an over-scoped credential reaches production; mitigate with human diff and session review, required checks, branch protection and credentials that cannot bypass those controls.
Which self-hosted route should you pick?
Match the route to the boundary you need and the operations you can afford:
- One engineer, comfortable with SSH: the plain VM with tmux. Little to operate, every CLI works, and you can add a local model endpoint or move to a team product later without redoing anything.
- A harness UI on your own machines, operated by you: OpenHands. MIT-licensed, Docker deployment, and a documented path to a fully local model with no commercial tier involved.
- Regulated or air-gapped enterprise with a platform team: Coder Agents. The platform runs in your data center or cloud account against any hosted or self-hosted model endpoint, with usage reporting to settle for the air-gapped case.
- Open-source CLI, Desktop or VS Code surfaces with provider choice: Cline. Check the license scope for your surface, configure its approval behavior and telemetry opt-out, and use a local runtime when the model request must stay on your machines. For chat-triggered or scheduled work, use the documented CLI route and account for the hub, connector credentials, auto-approved tool calls and user restrictions.
- Several people or agents sharing one local model: add a gateway with per-identity keys, model scope, rotation, revocation and per-key and per-team limits. Keep Ollama or vLLM private behind it, namespace response caches and repository indexes, and test queueing and context behavior with the real agent workload. A model server alone does not supply that governance layer.
- Shared team automation around coding agents rather than a coding IDE: Agenta. Its own repository defines that adjacent role and its Docker Compose runner topology.
- Already on Cursor or Warp Enterprise, and the requirement is "execution inside our network": their self-hosted workers, accepting that the content the model reads, orchestration and inference route through the vendor.
- A team that wants the plain-VM pattern shared and persistent without operating a harness: AQ, covered next.
Whichever route you pick, decide the model question separately: a hosted frontier model under your own accounts and keys, or an open-weight model served locally when the policy requires that prompts stay in the network, verified with the check above.
Where AQ fits
AQ gives a team shared live coding-agent workspaces on a dedicated machine, with isolated worktrees, real CLIs and shared terminal, editor and preview access. The AQ product documentation describes those workspaces as persistent sessions that teammates with access can open and watch or steer. Agents run as real CLIs (Claude Code, Codex, Cursor Agent, Kimi, Grok, Antigravity, Devin, OpenCode, or a plain shell) in persistent sessions on a machine dedicated to one team, and each session is streamed to the browser. The Changes panel supports diff review, line comments and merge.
Mapped onto the five flows: host execution is on your machine, either a VM in your own cloud account that you connect on the Pro plan, where code, worktrees, agent sessions and CLI credentials live, or a dedicated AQ-managed VM in its own isolated network; there is no shared multi-tenant execution tier on either plan. The model request has two paths. A connected subscription uses each person's own CLI account, unmetered and without AQ markup. AQ models run through AQ's provider accounts and use AQ credits at the per-token price shown before selection; choose a named model or Auto, which selects a model for each turn and says why. Hosted coordination is the dashboard: the session stream, previews, comments and the team layer. Commits and PRs use per-user GitHub auth, every work item gets its own git worktree so parallel tasks never share a checkout (a worktree isolates files, and the agent's permission mode governs what it may run), and Linear issues flow in through an "ai-task" label. The security and isolation docs describe these boundaries in full, including the one this guide keeps repeating: whatever the machine can reach, the agent can reach, so the egress policy on that machine is yours to set.
AQ does not supply a self-hosted model server, per-user model proxy, DLP, repository-index governance, network egress policy or a privacy boundary you have not configured. Choosing a customer-owned VM does not move AQ's hosted dashboard onto that VM. Configure the model route, model-server access layer and host egress separately. The workspace documentation covers worktree and session lifecycle, and the secure cloud workspace guide covers the wider host controls.
Pricing is two plans. Free runs one person's agents on your own Mac with the AQ Mac app, with every agent CLI signed in with your own accounts and no AQ credits included. Self-hosting on VMs you bring, the subject of this guide, is part of the Pro plan, which also includes the dedicated AQ-managed machine and $10 of AQ credits per seat each month, at $50 per user per month early-access pricing (standard $200, billed monthly) with the rate locked for your first 12 months.
If you are one engineer and comfortable in tmux, use the VM pattern above. Choose AQ when a team needs shared access to those sessions, persistent workspaces and a common review surface. Your model choice and the machine's egress policy remain yours to decide.
Proof: two AQ work items in two browser contexts
Proof boundary: on November 6, 2026, I ran the production build of the real AQ React application with a fictional example/pocket-atlas repository and a mocked API and WebSocket event stream. The two application work items were "Add cache headers to status page" and "Retry failed webhook deliveries." Their API records and work item menus exposed distinct branches, ai/101-status-cache-headers and ai/102-webhook-retry, and distinct worktree paths. The assertions passed in dark and light themes.
I then opened the status-page work item in a second isolated Chromium context as a different fictional teammate. That context displayed the same session and app preview, both people in workspace presence, and a newly delivered live update. This verifies the rendered team workflow and application state separation. It does not test production authentication, external delivery or the isolation of a real host.
The BYOC operations guide covers machine provisioning and operations, and the implementation guide covers the installation path. Use those guides for the next step rather than treating these captures as deployment evidence.
Frequently asked questions
How do I run self-hosted AI coding agents on my own infrastructure?
Run an agent CLI such as Claude Code, Codex or OpenCode on a Linux VM you control, with tmux for persistence, or install an open-source platform there. OpenHands and OpenCode are both open source (MIT) and self-hostable, and both can use a local model server. Coder Agents and Cline's open-source surfaces are the other self-hosted routes. AQ runs your team's AI coding agents in isolated sandboxes on infrastructure you control: self-hosted VMs or servers in your own cloud account, a dedicated always-on cloud sandbox that AQ manages in its own isolated network, or locally on your Mac with the AQ Mac app, with every task in its own git worktree and branch. The AQ app itself (sign-in, threads and the web dashboard) is hosted by AQ, while your code, worktrees, agent runs and sign-ins stay on the machines you choose.
Are OpenHands and OpenCode self-hostable?
Yes. As of November 2026 both repositories are MIT-licensed. OpenHands runs its harness on your host through Docker, with a container per conversation. OpenCode is an agent CLI you install on your own machine, with a documented headless server (opencode serve) and built-in discovery of local Ollama, LM Studio and vLLM servers. Either way you operate it yourself, and the model route and egress controls on this page still apply.
Does self-hosting an AI coding agent keep my code off vendor servers?
It keeps the repository clone, build outputs and credentials on your machines, which is the highest-stakes flow. Unless you also serve an open-weight model locally, the prompt still goes to the model provider with the file contents and command output the agent read, and platforms such as Cursor and Warp route transcripts, orchestration and inference through their own clouds, as their documentation states. Cline has its own telemetry and connector flows even when you bring keys or a local model. Decide which of the five flows on this page your policy covers before reading any vendor's "self-hosted" label.
Which terminal coding agents support locally hosted models while keeping source code on-premises?
Claude Code can be pointed at any server that implements the Anthropic Messages API through ANTHROPIC_BASE_URL; as of November 2026 Ollama (since v0.14.0), vLLM and llama.cpp's server document that endpoint, and Ollama publishes a Claude Code walkthrough recommending a 64k or larger context window. OpenHands takes a custom base URL for Ollama, vLLM, SGLang or LM Studio. Coder Agents accepts any OpenAI-compatible endpoint. Cline documents Ollama, LM Studio and Atomic Chat for local inference. Two caveats: Anthropic states it does not support routing Claude Code to non-Claude models through any gateway, so compatibility rests with the server project, and a local model changes only the model request; the CLI's other connections and the agent's file and network access need their own controls.
Do per-user keys make a shared local model server secure?
They improve attribution, model scope, rotation and revocation, and they let you apply per-key and per-team rate limits. They do not sandbox the model host, prevent prompt injection, provide DLP or prove that responses cannot disclose data. vLLM's --api-key leaves routes outside its documented prefixes unauthenticated, Ollama's local API does not require a key, and LiteLLM's exact-match cache can share identical responses across keys unless you configure a namespace. Keep the server behind a gateway, restrict every route, govern prompt and tool-output logs, scope repository indexes and caches, and verify telemetry, web search and tool egress separately.
What should I use if I want AI pair-programming in my own cloud?
For one engineer, start with a Linux VM, tmux and your preferred agent CLI. Use OpenHands or Coder when you want to operate a self-hosted harness or platform, and Cline when you want open-source CLI, Desktop or VS Code surfaces with your own provider or local runtime. AQ's Pro plan fits a team that wants shared live coding-agent workspaces on a customer-owned VM, with isolated worktrees, real CLIs and shared terminal, editor and preview access; AQ's dashboard remains hosted coordination, not software on your VM. If the model must also stay in your cloud, serve it separately and add the proxy key, log, cache, capacity and egress controls covered on this page.
Can AI coding agents run in our own VPC or on-prem?
Yes, on every coding route in this guide. A plain VM with tmux runs any agent CLI inside your VPC or data center. OpenHands and Coder Agents run their harness and platform there too, with Coder documenting air-gapped deployment and a usage-reporting arrangement for it. Cline's open-source CLI, Desktop and VS Code surfaces execute there, with separate telemetry, update and model choices to configure. Cursor's and Warp's self-hosted workers execute inside your network over an outbound HTTPS connection while their coordination and inference stay with the vendor. AQ's Pro plan connects VMs in your own cloud account, where code, worktrees, sessions and CLI credentials live, with the dashboard hosted by AQ. Agenta can self-host its adjacent team workspace and runner. In each case, confirm separately where the model request goes and what the machine is allowed to reach.
Is every Cline surface open source and fully local?
No. Cline's repository lists Apache-2.0 code for the project and includes its CLI, open-source Desktop app, VS Code extension and SDK, but explicitly says the JetBrains plugin is not open-sourced. Local execution also leaves separate decisions about hosted or local inference, telemetry, updates, connectors and credentials. Cline documents telemetry as on by default even with your own keys, with an opt-out and a hub restart for the CLI. Teams and schedules are documented for the SDK, CLI and Kanban, while connectors are CLI-only. Scheduled runs approve their own tool calls, and connectors add platform credentials and user-access rules. Review the exact surface and configuration you plan to deploy.
Is Agenta a self-hosted replacement for OpenHands or Cline?
No. Agenta is MIT-licensed and self-hostable, but its repository explicitly says it is the wrong tool for an agentic development environment for writing code. It provides a shared team workspace around Claude Code, Codex and Pi, with files, access, triggers, versions and traces for adjacent team automation. Use OpenHands, Coder or Cline for the coding harness decision, and evaluate Agenta separately if that team automation is what you need.
Can I run Claude Code or Codex CLI without any cloud dependency?
The CLIs run on your machine, and by default they call hosted APIs at Anthropic and OpenAI. Claude Code can send its model request to a local Anthropic-compatible server instead, which the routing check on this page confirms for one CLI version and one configured endpoint. That changes the model request only: sign-in, update checks, telemetry, plugin and documentation lookups have their own hosts, several with documented off switches, and a build or a tool call can reach whatever the machine can. "No cloud dependency" is a property of the whole machine's egress policy, verified with its own logs, and no single setting delivers it.
What is the cheapest way to self-host a coding agent?
A small Linux VM, tmux, and the CLI subscription you already have. SSH in, start a named tmux session, run the agent, detach. Your only new cost is the VM. AQ's Pro plan wraps this pattern on VMs you bring, and the Free plan runs on your own Mac with the AQ Mac app instead, with the browser workspace on top, your own CLI accounts for the models, and no AQ credits included.
How do I set up a self-hosted AI coding agent environment?
One Linux VM you control, an agent CLI such as Claude Code, Codex or Cline, and tmux for persistence. Size the VM for your builds, keep SSH off the public internet, authenticate the CLIs once on the headless machine, and run each task in a named tmux session inside its own git worktree. The setup guide walks every step from a fresh Ubuntu server to a persistent working agent, and safe AI coding agents on your own repos covers the permission and credential side.
What is the best self-hosted AI agent platform for a team?
It depends on which flows you want to operate yourself. OpenHands is an established self-hostable harness if you will run and upgrade it, and Coder Agents extends that to the whole platform, with air-gapped deployment supported. Cline supplies open-source CLI, Desktop and VS Code surfaces with your own providers or local runtimes. Cursor and Warp Oz put workers on your machines while keeping transcripts, orchestration and inference in their clouds. Agenta addresses adjacent team automation around coding agents rather than the coding IDE. AQ keeps agent execution, code and credentials on a machine that is yours alone and adds the team layer on top: shared live sessions, previews and per-user auth, with your own CLI subscriptions or AQ models for the model request. When several agents share a local model, evaluate the gateway separately for per-identity keys, revocation, team limits, log retention, cache namespaces and capacity controls; none of these products supplies that boundary merely by running on your VM.
Can I self-host the entire coding agent stack, including orchestration and the model?
Three coding-focused ways as of November 2026. OpenHands runs its MIT-licensed harness and Docker-isolated execution on your machines and points at a local server through Ollama, vLLM, SGLang or LM Studio. Coder Agents runs the platform and execution in your data center or cloud account, air-gapped if needed, against any OpenAI-compatible endpoint, including a self-hosted one; its usage reporting to Coder is the one documented call home, with an alternative arranged for air-gapped installs. Cline's open-source surfaces can run against local model runtimes, with its own telemetry, update and connector behavior still to configure. Agenta self-hosts an adjacent team automation workspace, not the coding IDE. Every route makes you the operator, and none removes the need to decide what the agent may read and what the host may reach.
Is self-hosted the same as bring your own cloud (BYOC)?
They overlap. Self-hosted means you operate the software on infrastructure you control: a plain VM, OpenHands, Coder or Cline's open-source surfaces. BYOC means the workloads run on compute in your cloud account, whoever operates the software: that includes vendor-managed infrastructure inside your tenant and hosted coordination layers for machines you hold root on. Both keep code and credentials in your account; they differ in who administers the boxes. Neither term guarantees that inference, telemetry or connectors stay local. The bring your own cloud guide covers the BYOC side in detail.
Do Cursor's self-hosted cloud agents keep everything on my infrastructure?
No. As of November 2026, Cursor's documentation says the worker performs file edits, terminal commands, computer-use tools and local MCP servers, and that the full checkout, build cache and machine-local credentials stay on your machine. During a run the worker sends Cursor file contents, terminal output, diffs, screenshots, local MCP results and routing metadata; the agent loop, inference and planning run in Cursor's cloud; and artifacts such as screenshots, videos and log references go to Cursor-managed storage. Blocking the two documented artifact hosts stops the uploads and leaves the rest of the run unchanged.
Do I need Kubernetes to self-host coding agents?
No. A single Linux VM with tmux runs any agent CLI, and that is the right starting point for most teams. Kubernetes enters at fleet scale: Warp's managed worker can execute tasks as Kubernetes Jobs, and OpenHands documents a Helm chart for Agent Canvas, with the note that the application is single-tenant and unauthenticated as installed. If you are not already operating a cluster, do not stand one up for agents alone.
How do I keep secrets safe on a self-hosted agent machine?
Self-hosting puts credentials on hardware you control, and the agent can still read anything on the box and include it in a model request. Scope tokens per user and per task, keep production credentials off the agent machine, prefer short-lived credentials the agent requests at use time, and use a permission mode that asks before access outside the project directory. Keeping secrets out of coding agent prompts and coding agent permission modes explained cover the patterns.
What multiplayer AI dev workspace runs on my own VM?
AQ runs real agent CLIs such as Claude Code, Codex and Cursor Agent in persistent shared workspaces on a VM in your own cloud account on the Pro plan, or on a dedicated AQ-managed machine. Teammates with access open the same live session in the browser to watch or steer it, and every work item gets its own git worktree and branch. The code, worktrees, agent sessions and CLI sign-ins stay on that VM, while AQ's dashboard is hosted by AQ, so AQ is not self-hosted software. If you want to operate everything yourself, a shared VM with SSH and tmux works for a small team without a dashboard.
Can AI coding agents work with internal libraries and private package registries?
Yes, when the machine the agent runs on can reach the registry and holds a read credential for it. Give the agent's user a read-only token as an environment variable, reference it from .npmrc or your index URL instead of committing it, and allow the registry host in the machine's egress policy. Then run npm view or pip download for one internal package as the agent's user before assigning a task; if that fails, the agent will fail the same way.
How long does onboarding take for coding agents with custom build environments and private registries?
It depends on three things more than on the agent: a network path from the agent machine to the registry and internal services, read-only credentials supplied as secrets, and the toolchain versions the repository pins. When a developer's own build already works from a comparable machine, the agent usually works once those three are copied over. The registry check in the private registry section tells you which one is missing.
How do I compare AI coding agents for on-prem or private repositories?
Ask every vendor where code runs, where the control plane and agent loop run, where transcripts are stored and for how long, where credentials live and whether agent-run code can use them, what the agent machine and the control plane may reach on the network, which provider receives the model request, and who can see sessions. Take the answers from each vendor's own data-flow documentation. Products that all call themselves self-hosted give different answers to most of these.
Is self-hosted Claude Managed Agents offline or zero-retention?
No. As of November 17, 2026, Anthropic's documentation says each model call carries the conversation so far, including prompts, tool inputs and tool results, to the inference provider you configure, and that the provider agreement's retention terms apply. Self-hosting moves the server, database, sandboxes and session history onto your infrastructure; it does not keep model requests inside your network. The documentation lists no local or offline model option.
What is the difference between self-hosted Claude Managed Agents and self-hosted sandboxes?
With fully self-hosted Managed Agents, available by request through your Anthropic account team as of November 17, 2026, you run the server, database, sandboxes and session history, and pick the Claude API, Bedrock, Claude Models on Google Cloud, Foundry or your own gateway for inference. With self-hosted sandboxes, a public beta since May 19, 2026, only tool execution runs on your infrastructure: Anthropic runs the agent and receives tool inputs and outputs, stores transcripts until you delete them, and hosts memory stores.