---
title: "Data protection"
description: "How Baz handles your source code, credentials, and model traffic, and the deployment options that keep code inside your own infrastructure."
canonical: "https://baz.ai/docs/security/data-protection"
---

# Data protection

How Baz handles your source code, credentials, and model traffic, and the deployment options that keep code inside your own infrastructure.

Baz needs to read your code to review it. This page explains what happens to that code, how credentials are stored, which controls limit what agents can do, and the deployment options for teams with strict data residency requirements.

## How Baz handles your code

Review agents only read a checkout of the pull request; they never run your code. Code runs only where you set it up: the [sandbox](/docs/integrations/sandbox) for Fixer and similar agents, and your preview environment for the Verification Agent. Integration credentials and sandbox environment variables are stored encrypted, and API keys are shown once, can be revoked at any time, and can have an IP allowlist. Coding guidelines are read from your default branch, so a pull request cannot loosen the rules used to review it.

## Controls on what agents can do

- **Agents inherit your permissions.** Baz works within the repositories and branches you grant to its app, and respects branch protection.
- **Write actions are opt-in.** Committing fixes, opening fix PRs, approving, and labeling PRs as ready to merge only happen when you enable the agent and its rules: [Fixer](/docs/agents/build/fixer), [Merger](/docs/agents/deploy/merger), and the maintain agents' PR limits.
- **Learning is governed.** You choose who can contribute to memories and whether new memories stay disabled until an admin enables them. See [How memory works](/docs/brain/how-memory-works).

## Model providers and zero data retention

Baz uses managed model providers to run its agents. Organizations can have zero data retention (ZDR) applied. With ZDR on, Baz routes model calls and agent web searches only to providers covered by a zero data retention agreement, and skips providers that are not. Contact Baz to enable ZDR for your organization.

## Deployment options

On **SaaS**, available on every plan, Baz runs everything in isolated AWS environments and reads your code only while it analyzes it. **SaaS with private mode** (Pro and Enterprise) keeps your repositories in your own infrastructure, and Baz reads files through a small service you run. **Self-hosted** and **Bring your own cloud (BYOC)** (Enterprise) put the whole platform in your own cloud.

### Private mode

With private mode, you run a single Baz file service pod in your own Kubernetes cluster (Amazon EKS), deployed with a Helm chart and exposed through your ingress. The file service gives Baz temporary, read-only access to diffs, files, and directories only when a review needs them. Code is processed on Baz infrastructure during analysis and wiped when the review completes or errors.

- Connections from Baz are protected by an IP allowlist, TLS, and API key authentication.
- The file service clones repositories with a GitHub token you control, so your system receives no secrets from Baz.
- Every file service operation is logged inside your environment.
- If the pod goes down, reviews pause and resume when it is back. No data is lost.

Setup is done together with Baz support. See [Deployment options](/docs/admin/deployment-options) for prerequisites and steps.

### Self-hosted and BYOC

The self-hosted deployment is a Helm umbrella chart that installs the Baz platform, the review agents, the MCP server, the sandbox services, and the web app in your cluster.

For BYOC on GCP, Baz provisions the deployment into a project you own with Terraform:

- A private GKE cluster, with agent sandboxes on a dedicated node pool isolated with gVisor.
- Cloud SQL for PostgreSQL with a private IP only.
- A single external HTTPS load balancer with a Cloud Armor policy. Nodes and the database have no public IPs.
- Access through short-lived impersonated credentials. No service account keys are created.

BYOC on AWS works the same way through a role you grant in your account.

## Compliance

- Baz is SOC 2 certified. Certifications, subprocessors, and control details are in the [Trust Center](https://trust.baz.ai/).
- Production runs on AWS in environments isolated from development, deployed on Kubernetes through authenticated CI/CD, with infrastructure managed as code.
- Baz is listed on the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-x4wlbo2is2gqa) for procurement under an existing AWS agreement.

<span id="securing-our-cloud-environment"></span>

### Report a security concern

Email nimrod@baz.ai, Baz's CTO. Baz responds as soon as possible. There is no bug bounty program at the moment.

## Related

<CardGroup cols={2}>
  <Card title="Deployment options" href="/docs/admin/deployment-options" icon="server">
    Set up private mode, self-hosted, or BYOC.
  </Card>
  <Card title="Sandbox" href="/docs/integrations/sandbox" icon="boxes">
    Where Baz builds and tests your code.
  </Card>
  <Card title="Users and permissions" href="/docs/admin/users-and-permissions" icon="users">
    Roles, Experts, and who can change agents.
  </Card>
  <Card title="Security overview" href="/docs/security" icon="shield">
    How Baz finds vulnerabilities in your code.
  </Card>
</CardGroup>
