Can Claude Code run in our own infrastructure? What stays in-house and what still goes to Anthropic
Claude Code can be partly self-hosted in two different ways, and reviewers should treat them as separate decisions. The first is self-hosted environments, which run Claude Code cloud sessions on runners inside your network. They are in public beta on Team and Enterprise plans, they are off by default, and an Owner turns them on in the Cloud environments admin page. The second is the self-hosted Claude apps gateway, a single Linux binary backed by PostgreSQL 11 or later that signs developers in through your OIDC identity provider and forwards inference to a cloud provider such as Amazon Bedrock, Google Cloud, Microsoft Foundry or the Anthropic API. Both options keep some data in your environment, but neither keeps prompts, responses and session transcripts inside your organization. In a self-hosted environment, repository checkouts, build artifacts, secrets and modified files stay on your machines, while prompts, responses and tool results still go to api.anthropic.com and Anthropic stores the session transcript. Read the self-hosted environments documentation before assuming otherwise.
The gateway changes where inference is billed and routed, but not everything it touches stays local. Its own data plane sends nothing to Anthropic unless the Anthropic API is configured as an upstream, and it keeps telemetry, audit logs, managed settings and identity under your control. Confirm which upstreams your gateway will use, because selecting the Anthropic API as one of them reintroduces Anthropic in the data path. The gateway also requires Claude Code v2.1.195 or later on both the server and developer machines, and it supports OTLP over HTTP only, so confirm that your telemetry pipeline accepts that protocol before rollout. Review the Claude apps gateway documentation for the exact upstream and identity settings.
The choice depends on three settings you should confirm before any pilot. Self-hosted environments are unavailable to organizations with zero data retention or the HIPAA configuration, so a regulated team that needs either control must choose the gateway path or accept cloud sessions. Ask your Anthropic account team which plan, retention and HIPAA terms apply to your organization, and record the answer in your approval file. Then map each data class (source code, secrets, build output, prompts, transcripts and telemetry) to a location and an owner. Any class that must not reach api.anthropic.com needs a control that prevents it, not a note in a policy document.
Self-hosted options by plan, deployment and what still reaches Anthropic
This table compares self-hosted environments, the Claude apps gateway and standard cloud sessions across plans, privacy configurations and required outside components. Read each row against your plan and your retention commitments, then check which data paths still reach Anthropic before approving a design.
| Option | Self-hosted environment (runners) | Claude apps gateway | Standard cloud sessions |
|---|---|---|---|
| Release status | Public beta on Team and Enterprise, off by default until an Owner enables it | Self-hosted gateway, confirm current release status with Anthropic | Generally available on Team and Enterprise plans |
| Available on Team plan | Yes | Not applicable | Yes |
| Available on Enterprise plan | Yes | Not applicable | Yes |
| Available with zero data retention or HIPAA configuration | No | Not applicable | No |
| Outside component required | Runners in your network that make outbound HTTPS calls to api.anthropic.com | Linux binary, PostgreSQL 11 or later, OIDC identity provider, and a cloud provider account or Anthropic API upstream | None beyond the Anthropic-hosted service |
| Code, checkouts and secrets stay in your environment | Yes, repository checkouts, build artifacts, secrets and modified files stay on your machines | Yes for the gateway's own data plane, which keeps telemetry, audit logs and managed settings under your control | No, sessions run in Anthropic-hosted infrastructure |
| Prompts, responses and tool results reach Anthropic | Yes, sent to api.anthropic.com, and Anthropic stores the session transcript | Only when the Anthropic API is configured as an upstream, otherwise inference goes to your chosen cloud provider | Yes, all session content is processed by Anthropic |
| Inbound connections from Anthropic into your network | None, Anthropic never connects into your network | Not described as a feature, confirm firewall rules with Anthropic documentation | Not applicable |
Where repositories, prompts and sessions travel in each deployment
The diagram starts at the developer and splits into two paths. In a self-hosted environment, runners inside your network hold checkouts, artifacts and secrets, and they make only outbound HTTPS calls to api.anthropic.com, where prompts, responses and tool results still go and the session transcript is stored. In the gateway path, developers sign in through your OIDC identity provider and inference goes to your chosen cloud provider or the Anthropic API, while telemetry and audit logs stay with you. Check which Anthropic-hosted components each path still touches before approving it.
Data paths for self-hosted runners and the Claude apps gateway, with Anthropic-hosted components marked.
How self-hosted environments and the apps gateway divide the data path
The first decision is which architecture you are approving, because the two options place different parts of the data path inside your network. With self-hosted environments, you run runners inside your own network that execute Claude Code cloud sessions. Repository checkouts, build artifacts, secrets and modified files stay on your machines. Anthropic still hosts the control plane, the queueing and the claude.ai interface, and prompts, responses and tool results still go to api.anthropic.com. Anthropic stores the session transcript. The runners make only outbound HTTPS connections to api.anthropic.com, and Anthropic does not connect into your network. Treat this as a split of code and secrets from conversation content, not as a way to keep prompts off Anthropic's systems. Confirm the feature's current status on the Claude Code self-hosted environments documentation before you plan around it, since it is in public beta and off by default until an Owner enables it.
The second option is the Claude apps gateway, a self-hosted gateway delivered as a single Linux binary backed by PostgreSQL 11 or later. The gateway signs developers in through your OIDC identity provider and forwards inference to Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry or the Anthropic API. It also keeps telemetry, audit logs, managed settings and identity under your control. Its data plane sends nothing to Anthropic unless the Anthropic API is configured as an upstream, so the choice of upstream decides whether Anthropic receives inference traffic at all. Ask your reviewers to trace each upstream you configure and to confirm the contract terms that govern it.
Two version and telemetry limits shape the rollout. The gateway requires Claude Code v2.1.195 or later on both the gateway server and every developer machine, so your version pinning and update policy must cover both. The gateway supports OTLP over HTTP only, so confirm that your collector accepts that transport before you promise usage monitoring to security. Also note that self-hosted environments are unavailable to organizations with zero data retention or the HIPAA configuration, so those controls cannot be combined with this option. Confirm which architecture fits your compliance scope before procurement.
How the answer changes by plan, cloud provider, regulated data and air-gapped networks
Self-hosted environments are a feature for organizations on Team or Enterprise plans. They are in public beta, they are off by default, and an Owner must enable them on the Cloud environments admin page before any developer can use them. The runners sit inside your network and execute Claude Code cloud sessions, but the session itself is still orchestrated by Anthropic.
- Who enables it: Only an Owner can turn the feature on, so confirm who holds that role before you plan the rollout.
- What stays local: Repository checkouts, build artifacts, secrets and modified files remain on your machines.
- What still goes out: Prompts, responses and tool results are sent to api.anthropic.com, and Anthropic stores the session transcript.
- Network direction: Runners make only outbound HTTPS connections, and Anthropic does not connect into your network.
- Hosted components: The control plane, queueing and the claude.ai interface remain Anthropic-hosted.
Before approving this path, confirm with your security team that sending transcripts to Anthropic is acceptable for the code involved. Check the current beta status and the admin controls on the Claude Code self-hosted environments documentation before committing.
The self-hosted Claude apps gateway is a single Linux binary backed by PostgreSQL 11 or later. It signs developers in through your OIDC identity provider and forwards inference to the provider you configure. The supported upstreams are Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry or the Anthropic API. Which upstream you pick determines where inference runs and which vendor terms apply.
- Upstream choice: Choose among Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry or the Anthropic API.
- Anthropic traffic: The gateway's own data plane sends nothing to Anthropic unless the Anthropic API is a configured upstream.
- Control you keep: Telemetry, audit logs, managed settings and IdP identity stay under your control.
- Version requirement: The gateway requires Claude Code v2.1.195 or later on both the server and developer machines.
- Telemetry format: Only OTLP over HTTP is supported.
If you use an upstream other than the Anthropic API, confirm the data terms of that provider directly, because they govern the inference traffic. Read the Claude apps gateway documentation for the current upstream list and setup requirements.
Self-hosted environments are unavailable to organizations with zero data retention or the HIPAA configuration. If your agreement with Anthropic includes either, the runner-based cloud session path is not an option. That constraint shapes the rest of your design, so resolve it before you assess any other part of the feature.
- Feature unavailable: Self-hosted environments cannot be enabled under zero data retention or the HIPAA configuration.
- Alternative to evaluate: Ask whether the apps gateway with an upstream that fits your data terms can meet your requirements instead.
- Gateway trade-off: Gateway telemetry and audit logs remain under your control, but the upstream provider's terms still apply to inference.
- Plan check: Confirm with your account team which retention and HIPAA settings your organization actually holds.
- Documentation: Confirm the current eligibility rules in writing before procurement.
If you handle regulated data, request written confirmation of which deployment paths are eligible under your specific contract. Use the Claude Code self-hosted environments documentation as the starting reference for that discussion.
A fully air-gapped or fully on-premise requirement does not fit the cloud session model. Self-hosted runners still need outbound HTTPS connections to api.anthropic.com, and cloud sessions depend on Anthropic-hosted control plane components. Treat these tools as unable to run cloud sessions with no outbound path, and plan a separate design for isolated networks.
- Required outbound path: Runners need outbound HTTPS to api.anthropic.com.
- Hosted dependencies: The control plane, queueing and claude.ai interface stay with Anthropic.
- Gateway option: The gateway can keep telemetry, audit logs and identity inside your environment, but inference still needs a reachable upstream.
- Network review: Ask your network team whether egress to that endpoint can be permitted and how it would be monitored.
- Isolated work: Confirm with your architects which development tasks, if any, can run without any external connection.
Document the egress rules you approve and have your security team verify them against the endpoints in the vendor documentation. Confirm the air-gapped position in writing with Anthropic before you describe it to auditors or leadership.
Decisions to make before choosing self-hosted environments or the gateway
Four choices shape a self-hosted Claude Code rollout: the deployment model, the identity and network path, the data retention and HIPAA position, and the cloud provider that carries inference. Each one changes what stays in your infrastructure and what still reaches Anthropic, so settle them together before a pilot begins.
Choose runners or the gateway
Self-hosted environments run cloud sessions on runners inside your network, while the self-hosted Claude apps gateway is a single Linux binary that routes developer inference to a cloud provider. The two solve different problems, so pick the one that matches where your developers work and where your model traffic must land. Confirm whether your team needs cloud sessions on your own machines, managed sign-in with routed inference, or both, because the gateway requires Claude Code v2.1.195 or later on the server and developer machines.
Self-hosted environments docsSet the OIDC identity provider
The gateway signs developers in through your OIDC identity provider, so the identity configuration decides who can reach Claude Code at all. Confirm the issuer, client registration, group claims and session lifetime with your identity team before rollout, and decide whether personal accounts are blocked at the same layer. Ask the vendor which claims the gateway reads and how it behaves when the provider is unreachable.
Claude apps gateway docsRule out ZDR and HIPAA first
Self-hosted environments are unavailable to organizations with zero data retention or the HIPAA configuration. If your compliance position requires either, the runner model is off the table, and you must evaluate the gateway and the other supported routes instead. Confirm your retention and HIPAA status with Anthropic before designing the architecture, since changing it later means rebuilding the rollout around a different deployment.
Pick the inference cloud provider
The gateway forwards inference to Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry or the Anthropic API. Your choice determines which provider's contract, region, logging and data terms apply to prompts and responses, and whether the gateway sends anything to Anthropic at all. The gateway's data plane sends nothing to Anthropic unless the Anthropic API is a configured upstream, so the provider decision is also the main data-residency decision.
Route telemetry and audit logs
The gateway keeps telemetry, audit logs, managed settings and identity under your control, and it supports OTLP over HTTP only. Decide which collector receives the telemetry, how long logs are kept and who can read them, and confirm that your collector accepts OTLP over HTTP rather than another transport. Without this decision, usage visibility depends on what your SIEM can ingest.
Allow egress through proxies
Runners make only outbound HTTPS connections to api.anthropic.com, and Anthropic never connects into your network. Your network team must permit that outbound path through egress proxies and firewalls, and confirm that TLS inspection does not break the connection. Test the path from a runner before go-live, and record which hosts, ports and proxy settings are approved so reviewers can verify the boundary.
Order of work to bring a self-hosted option into production
This sequence moves a self-hosted Claude Code option from plan and policy checks to a piloted rollout, so each control is confirmed before developers depend on it. Each step names the evidence that closes it.
Confirm plan, owner and admin page access
Confirm that your organization is on a Team or Enterprise plan, since self-hosted environments for cloud sessions are in public beta on those plans. Ask a named Owner to confirm that they can open the Cloud environments admin page, because only an Owner can turn self-hosted environments on there, and the option is off by default. Done means a written note naming the Owner and the plan, with the setting visible to that person.
Check zero data retention and HIPAA status
Confirm in writing whether your organization has zero data retention or the HIPAA configuration, because self-hosted environments are unavailable to both. If either applies, the self-hosted cloud session option is excluded and you must choose a different deployment model before continuing. Done means a signed record from the account owner stating which retention and HIPAA settings apply, so the decision can be audited later.
Choose the deployment model and data boundary
Decide whether you need self-hosted environments (runners in your network that run cloud sessions), the self-hosted Claude apps gateway (which routes inference to a cloud provider you already use), or both. Record what stays on your machines, such as checkouts, build artifacts, secrets and modified files, and what still goes to Anthropic, which includes prompts, responses, tool results and the stored session transcript. Done means a one-page data flow approved by security and privacy reviewers.
Build egress rules for the chosen endpoint
Allow outbound HTTPS only from runners or gateway hosts to api.anthropic.com for self-hosted environments, or to the upstream provider you configured for the gateway. Anthropic does not connect into your network, so inbound rules from Anthropic are not needed. Verify the rules with your network team by testing from a runner host and confirming that no other destination is reachable from the workload. Done means a firewall change record and a test log showing the allowed connection only.
Configure OIDC sign-in and PostgreSQL for the gateway
If you deploy the gateway, connect it to your OIDC identity provider so developers sign in with corporate accounts, and provision PostgreSQL 11 or later as its backing database. Keep telemetry, audit logs, managed settings and identity records under your control, and confirm that the gateway data plane sends nothing to Anthropic unless the Anthropic API is a configured upstream. Done means a test sign-in by a non-admin account and a database backup that restores successfully.
Pin and verify Claude Code version on all hosts
Require Claude Code v2.1.195 or later on the gateway server and on every developer machine, since the gateway requires that version on both sides. Pin the version in your software distribution or configuration, and check it with a version command on sample machines from each group. For standard auto-update installs and manual updaters, record which group each machine belongs to, because manual updaters must upgrade themselves. Done means an inventory report showing zero hosts below the minimum version.
Route OTLP telemetry to your collector
Point Claude Code telemetry at your own OpenTelemetry collector using OTLP over HTTP, the only transport the gateway supports. Confirm which events and metrics arrive, and that no telemetry goes to an endpoint you did not configure. Done means a dashboard or log query in your environment that shows session events from a test developer, with the collector endpoint documented.
Pilot with a small group and verify secret locations
Run a pilot with a small group of developers on a non-production repository. Verify that checkouts, build artifacts and secrets remain on your runners or machines, search for any credentials that appear in transcripts or prompts, and confirm that the session transcript is stored as the documentation describes. Review the results with security before widening access. Done means a signed pilot report listing the tested paths, any exceptions, and the decision to expand or stop.
Evidence a security reviewer asks for and where it comes from
This table lists the evidence a reviewer should collect before approving self-hosted environments or the apps gateway, and the place each item comes from. Read the rows as a checklist: the Claude Code documentation answers the architecture, plan and gateway questions, while the Anthropic Trust Center and your own records answer the assurance and configuration questions. Confirm each item against the current documentation on the day of review.
| Evidence | What to record | Where it comes from |
|---|---|---|
| Architecture of what stays local | Repository checkouts, build artifacts, secrets and modified files stay on your machines. Prompts, responses, tool results and the session transcript go to Anthropic in a self-hosted environment. | Claude Code self-hosted environments documentation |
| Egress allowlist | Runners make only outbound HTTPS connections to api.anthropic.com. Anthropic does not connect into your network. Record the firewall rule and the proxy path that permits this. | Claude Code self-hosted environments documentation, plus your network firewall configuration |
| Plan and Owner setting | Confirm the organization is on Team or Enterprise, that self-hosted environments are enabled in public beta, and which Owner switched them on in the Cloud environments admin page. | Claude Code self-hosted environments documentation and the Cloud environments admin page in your account |
| Zero data retention and HIPAA status | Confirm whether the organization has zero data retention or the HIPAA configuration, because self-hosted environments are unavailable under either. Keep the account record that shows this status. | Claude Code self-hosted environments documentation and your Anthropic account or contract records |
| Gateway and PostgreSQL versions | Record the gateway binary version, the PostgreSQL version (11 or later) and the Claude Code version (v2.1.195 or later) on the gateway server and on developer machines. | Claude apps gateway documentation, plus your own inventory of installed versions |
| OIDC configuration | Document the identity provider, client settings, token lifetimes and group mapping used by the gateway to sign developers in. | Claude apps gateway documentation and your identity provider configuration |
| Audit and telemetry destinations | Show where gateway telemetry, audit logs and managed settings are stored and who can read them. Confirm OTLP over HTTP is the only export format in use. | Claude apps gateway documentation and your own logging and SIEM configuration |
| Upstream inference route | Record which provider the gateway forwards to (Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry or the Anthropic API). Confirm whether the Anthropic API is a configured upstream, since only then does the data plane send data to Anthropic. | Claude apps gateway documentation and your gateway configuration |
| SOC 2 Type 2 report and ISO 27001 certificate | Obtain the current SOC 2 Type 2 report and ISO 27001 certificate, and confirm their scope covers the services you use. DeployOpen does not issue these documents. | Anthropic Trust Center at trust.anthropic.com, requested under your vendor agreement |
Questions buyers ask before approving a self-hosted Claude Code setup
Do prompts and responses stay inside our network with a self-hosted environment?
No. In a self-hosted environment, repository checkouts, build artifacts, secrets and modified files stay on your machines, but prompts, responses and tool results still go to api.anthropic.com, and Anthropic stores the session transcript. Runners make only outbound HTTPS connections to api.anthropic.com, and Anthropic never connects into your network. The control plane, queueing and the claude.ai interface remain Anthropic-hosted. Your security team should treat the model traffic and transcript storage as leaving your perimeter and review that against your data classification policy before approval. Confirm the transcript retention terms for your plan with Anthropic in writing.
Can we combine zero data retention with self-hosted environments?
No. Self-hosted environments are unavailable to organizations with zero data retention or the HIPAA configuration. If your agreement with Anthropic includes zero data retention, a self-hosted environment for cloud sessions is not an option under that setup. The alternative to evaluate is the self-hosted Claude apps gateway, which routes inference to a cloud provider you already use, such as Amazon Bedrock, Google Cloud, Microsoft Foundry or the Anthropic API. Ask your account team to confirm which retention and HIPAA settings apply to your organization before you design around either option.
What does the self-hosted Claude apps gateway need to run?
The gateway needs four things. It is a single Linux binary. It is backed by PostgreSQL 11 or later. It signs developers in through your OIDC identity provider. It requires Claude Code v2.1.195 or later on both the gateway server and developer machines. The gateway supports OTLP over HTTP only for telemetry. Its data plane sends nothing to Anthropic unless the Anthropic API is a configured upstream, and it keeps telemetry, audit logs, managed settings and identity under your control. Confirm the exact operating system versions, database sizing and network paths against the current gateway documentation before scheduling the build.
Can our own team run a self-hosted Claude Code setup without outside help?
It depends on the skills you have in house. The setup needs network engineering to plan outbound HTTPS paths to api.anthropic.com or your chosen inference provider, identity engineering to connect OIDC sign-in and managed settings, and database operations for PostgreSQL. It also needs someone to own upgrades, since the gateway and clients must stay on compatible Claude Code versions. If those skills exist and staff can own the service after go-live, an internal build is feasible. If one of them is missing, outside help usually costs less than a delayed rollout.
What drives the cost of a self-hosted Claude Code rollout?
Costs fall into three groups. First, plan seats: Team and Enterprise are billed per seat, and self-hosted environments are available on those plans. Second, inference billing: API or cloud provider usage is billed by consumption through the route you choose. Third, your own infrastructure: compute for runners or the gateway, a PostgreSQL database, identity integration, network changes and staff time. Setup work is one-time, while seats, inference, hosting and upkeep recur. Costs rise with the number of developers, the number of runners and the amount of inference used. Ask Anthropic for current seat and usage pricing in writing, since this page does not state prices.
What should we ask for in a DeployOpen quote for this work?
DeployOpen works from a fixed-scope written proposal agreed before work starts. Ask for the scope of each deliverable, such as runner placement, gateway deployment, identity integration, managed settings and telemetry. Ask which systems and accounts DeployOpen will touch and which your staff must provide, including cloud accounts, network changes and the PostgreSQL instance. Ask for the timeline and acceptance criteria per deliverable, the documentation you will receive, how handover and support work, and whether ongoing support or upgrades are covered by a separate retainer. Request the quote only after you confirm which Claude Code plan and deployment route you have chosen.
Which self-hosted option should we pick if we need the strictest data boundary?
No option keeps model traffic inside your network, so the strictest boundary depends on what you can accept leaving. With self-hosted environments, code, secrets and build artifacts stay on your machines, but prompts and tool results go to Anthropic. With the gateway, the data plane sends nothing to Anthropic unless the Anthropic API is configured as an upstream, so routing inference through a cloud provider you already contract with may fit your policy better. Compare both against your data classification and confirm the provider terms with each vendor.
How DeployOpen helps an organization approve and run Claude Code self-hosted options safely
DeployOpen approaches Claude Code self-hosted runners, gateways and on-premise options as a written, fixed-scope engagement inside your own infrastructure. We map what stays on your machines and what still reaches Anthropic, then build, test, document and hand over the setup for your security and compliance reviewers to approve.
How we scope
- We confirm which option applies: self-hosted environments, the self-hosted Claude apps gateway, or a cloud provider route.
- We record your plan, data retention settings and HIPAA status, since self-hosted environments are unavailable with zero data retention or the HIPAA configuration.
- We agree the scope, deliverables and timeline in writing before any work starts, with the data flows to Anthropic written out.
How we build
- We deploy runners or the gateway in your cloud accounts, data centers or air-gapped networks, using only outbound HTTPS to api.anthropic.com for runners.
- We configure OIDC sign-in, telemetry, audit logs and managed settings so the identity and monitoring data stays under your control.
- We run security testing against the deployment, including prompt injection and sandbox checks, and report findings before handover.
How we hand over
- We deliver architecture documentation showing each component, network path and data flow, including what still goes to Anthropic.
- We provide evidence and configuration records that your auditors or certification bodies can review. DeployOpen does not issue audit reports or certifications.
- We walk your engineering and security teams through the runbook, upgrade steps and the Claude Code version requirements for the gateway.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- We track published Claude Code security advisories and plan upgrades on managed machines, including auto-update versus manual update paths.
- We review changes to the gateway, runners or plan terms with your team before they reach production.

