AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Does Sweep Store or Train AI Models on Your Proprietary Codebase? Enterprise Privacy, Ephemeral Indexing, and Self-Hosting Explained

Choo Leng Jen · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

No. Sweep does not store your proprietary codebase for long-term retention, nor does it train or fine-tune public foundation models on your intellectual property.

That is the short answer every Chief Information Security Officer (CISO) and VP of Engineering wants to hear before connecting a GitHub App to production repositories. But at 365Finds, we believe legal reassurances alone are cheap. In enterprise software supply chains, trusting a privacy policy without inspecting the underlying execution topology is negligent. If an autonomous coding agent has write permissions across internal microservices, you need to understand exactly where the code travels, how long embeddings exist in memory, and how to pull the plug with on-premises isolation.

Here is the architectural reality of how Sweep processes code, where enterprise telemetry boundaries sit, and whether self-hosting is truly necessary for your threat model.


1. The Legal Guarantee: Absolute Zero Training

Sweep’s commercial terms and enterprise licensing establish a strict "No Training" policy.

When Sweep receives a GitHub webhook—such as an issue trigger (@sweep: fix bug) or a pull request comment—it extracts code context and sends prompts to upstream foundation models (primarily Anthropic Claude or OpenAI GPT engines). Under standard commercial and enterprise API agreements, these model providers are contractually prohibited from using API payloads for model training. Sweep itself operates strictly as an orchestration and agentic reasoning layer; it does not compile customer codebases into proprietary training corpuses.

However, a legal promise does not answer two critical operational concerns:

To evaluate these risks, engineering leaders must look past the terms of service and inspect the compute engine.


2. Under the Hood: Ephemeral Indexing via Modal Sandboxes

Sweep does not maintain a massive, persistent vector database holding a static mirror of your company's entire repository. Doing so would be both an engineering nightmare and an immediate enterprise compliance failure.

Instead, Sweep relies on an ephemeral indexing pattern executed inside isolated, stateless compute sandboxes—traditionally provisioned on infrastructure like Modal:

[GitHub Webhook / Issue]
          │
          ▼
┌───────────────────────────────────────────────┐
│  Stateless Orchestrator                       │
│  (Validates webhook HMAC, checks permissions) │
└───────────────────────┬───────────────────────┘
                        │ Spins up
                        ▼
┌───────────────────────────────────────────────┐
│  Modal Ephemeral Compute Sandbox              │
│  ├─ Git shallow clone of target branch        │
│  ├─ AST parsing & localized symbol indexing   │
│  ├─ Ephemeral in-memory embeddings generation │
│  ├─ Multi-file diff generation & lint/test    │
│  └─ Push PR branch back to GitHub             │
└───────────────────────┬───────────────────────┘
                        │
                        ▼ Container Terminated
             [Memory & Disk Wiped Clean]

The Life Cycle of a Sweep Task

  1. On-Demand Provisioning: When a task triggers, a sandboxed micro-container initializes. It executes a shallow git clone of only the target branch and files relevant to the issue.
  2. Dynamic In-Memory Indexing: Sweep parses the abstract syntax tree (AST) and generates contextual embeddings on the fly. These vectors reside in volatile memory or temporary local caches strictly during the lifetime of that specific pull request run.
  3. Execution and Testing: The agent tests changes, runs linter checks or unit suites defined in sweep.yaml, and pushes a commit directly back to GitHub via the GitHub API.
  4. Immediate Teardown: Once the GitHub PR is opened or updated, the container shuts down. The compute instance terminates, wiping all local ephemeral volumes, temporary clone directories, and indexing caches.

Because compute instances are disposable, Sweep does not maintain permanent disk snapshots of your repository. 365Finds considers this ephemeral sandbox pattern vastly superior to legacy SaaS architectures that maintain long-lived relational stores of client source code.


3. Cloud Enterprise Tier: ZDR, Dedicated Tenants, and SOC 2

For teams using Sweep’s hosted cloud platform, standard SaaS multi-tenancy may still fail compliance audits in heavily regulated verticals (fintech, healthcare, defense). Sweep’s Enterprise Tier introduces three structural controls designed specifically to pass SOC 2 Type II scrutiny:

Enterprise ControlStandard Cloud TierEnterprise TierWhat It Means for Compliance
Data Retention (ZDR)Standard API logs (up to 30 days for operational debugging)Zero Data Retention (ZDR) guaranteeCode snippets in transit are purged immediately post-execution; zero logs at upstream LLM endpoints.
Tenant IsolationShared worker pool with container boundariesSingle-tenant / Dedicated infrastructureCompute sandboxes run in dedicated tenant environments, eliminating noisy-neighbor and co-tenancy data leak vectors.
Model API RoutingManaged Sweep API keysBring Your Own Key (BYOK)Requests route directly through your company’s enterprise Azure OpenAI or Anthropic contracts.
Audit ComplianceStandard GitHub App eventsSOC 2 Type II Reports & ISO 27001Formal third-party attestation of physical, network, and operational security controls.

How BYOK Alters the Privacy Posture

When you configure Bring Your Own Key (BYOK), the contractual relationship with the LLM provider transfers entirely to your organization. If your company holds an enterprise agreement with Microsoft Azure OpenAI featuring Zero Data Retention (ZDR), Sweep sends context through your provisioned endpoint. Sweep cannot view or monetize those model tokens, and the model provider cannot retain prompts for any offline evaluation.


4. Self-Hosting for Zero Egress: Absolute Air-Gapped Code

If corporate policy outright forbids third-party GitHub Apps from accessing proprietary source code over the public internet, self-hosting is the only viable path.

Because Sweep maintains an open-source core (sweepai/sweep), organizations can host the entire bot on private infrastructure—inside an AWS VPC, GCP project, or on-premises Kubernetes cluster.

What Self-Hosting Delivers

365Finds Technical Warning: Pitfalls of Self-Hosting

365Finds does not recommend self-hosting blindly. Running Sweep yourself eliminates vendor trust assumptions, but shifts the entire security burden to your infrastructure team. If you deploy the open-source repository, audit the following items immediately:

  1. Telemetry Stripping: The default open-source codebase historically included product analytics hooks (such as PostHog client keys). In a true zero-trust deployment, your network egress firewalls must block external analytics hosts, or you must explicitly disable telemetry environment variables before building the Docker image.
  2. Container Privilege Management: Ensure the Sweep worker container does not run as root. Restrict container capabilities and execute isolated builds using non-root users inside hardened container runtimes (such as gVisor or Firecracker).
  3. Webhook Authentication: Never expose the Sweep webhook endpoint nakedly to the public internet without validating the GITHUB_WEBHOOK_SECRET HMAC signature on every incoming payload. Unauthenticated webhook listeners invite remote code execution through spoofed issue payloads.
  4. Least-Privilege GitHub Permissions: When creating your private GitHub App, grant only read and write on Contents and Pull requests. Avoid granting organization-level administration, secrets access, or workflow modification rights unless strictly required.

5. 365Finds Strategic Assessment

At 365Finds, our stance on Sweep is clear:

  1. For General Commercial Software Teams: Sweep’s hosted enterprise tier with Bring Your Own Key (BYOK) and Zero Data Retention provides more than enough defense-in-depth. The operational overhead of running stateful webhook workers and ephemeral sandboxes yourself rarely pays off when the commercial tier already guarantees zero model training and transient sandbox teardown.
  2. For Zero-Egress Regulated Environments: Self-hosting is mandatory. Do not rely on SaaS trust portals if banking regulations (such as FINRA or DORA) prohibit source code transmission to multi-tenant clouds. Deploy the open-source Docker image within your internal VPC, strip telemetry calls, and route inference exclusively through private corporate LLM endpoints.

Sweep does not train models on your code. Whether its transient memory footprint is safe enough for your codebase depends not on marketing claims, but on whether you configure it to operate inside your perimeter or theirs.


References