> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-sandboxes-integrations-placement.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I log metrics without saving my code?

To keep proprietary source code or training data out of W\&B for privacy or compliance reasons, limit what W\&B captures so that your runs log only metrics.

By default, W\&B logs code and system metrics but doesn't log dataset examples.

To turn off code logging, use environment variables at the run level or change team-wide defaults as an admin.

## Turn off code logging with environment variables

Use one of the following environment variables to turn off code logging for an individual run or process:

* Set `WANDB_DISABLE_CODE` to `true` to turn off all code tracking. This action prevents retrieval of the Git SHA and the diff patch.
* Set `WANDB_IGNORE_GLOBS` to `*.patch` to stop syncing the diff patch to W\&B servers while keeping it available locally for application with `wandb restore`.

## Enforce settings at the organization or team level

If you want to turn off code saving for everyone on a team (rather than relying on each user to set environment variables), change the default in your team or organization settings.

Organization admins can enforce privacy settings for all teams in their organization from the **Privacy** section of the **Settings** tab in the account or organization dashboard. If organization admins enforce a setting, team admins can't configure that setting in their teams.

As a team admin, you can turn off default code saving for runs in your team:

1. Go to `https://wandb.ai/[TEAM-NAME]`, replacing `[TEAM-NAME]` with your team name.
2. Select **Team settings** in the left navigation.
3. Open the **Privacy** section and turn off **Enable code saving by default**.

After you complete these steps, new runs in your team no longer save code by default. W\&B continues to log metrics and system information.

For more information, see [Privacy settings](/platform/hosting/privacy-settings).

***

<Badge stroke shape="pill" color="orange" size="md">[Administrator](/support/models/tags/administrator)</Badge><Badge stroke shape="pill" color="orange" size="md">[Team Management](/support/models/tags/team-management)</Badge><Badge stroke shape="pill" color="orange" size="md">[Metrics](/support/models/tags/metrics)</Badge>
