You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hugo/content/en/bits_ai/bits_code/setup.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,15 +156,23 @@ To configure a repository environment:
156
156
1. Click {{< ui >}}Add Environment{{< /ui >}} to create a repository configuration:
157
157
1. Select a repository from the dropdown.
158
158
1. (Optional) Under {{< ui >}}Pre-installed Languages{{< /ui >}}, click {{< ui >}}Select Versions{{< /ui >}} to specify the language versions the sandbox should use.
159
-
1. (Optional) Define environment variables and secrets. Environment variables are available during both environment setup and Bits Code execution. Secrets are available as environment variables only during environment setup.
159
+
1. (Optional) Define environment variables and secrets. Environment variables are available during both environment setup and Bits Code execution. Secrets are available as environment variables only during environment setup. A value defined here replaces the [organization value](#configure-organization-environment-variables-and-secrets) with the same name.
160
160
1. (Optional) Add a shell script with setup commands to execute (for example: `pip install -r requirements.txt`).
161
-
1. Run the setup command to ensure it runs successfully.
161
+
1. Run the setup command to ensure it runs successfully. This requires write access to the selected repository.
162
162
1. Save the configuration.
163
163
164
164
Bits Code runs the setup command at startup and can use any tools installed in your environment. The setup command runs with network access enabled to download dependencies. After setup is complete, your [internet access](#configure-internet-access) policy controls outbound network access during agent execution. Because setup commands execute against code in your repository, enable them only if you trust the repository's code.
165
165
166
166
**Note**: For best results, add a [custom instructions file](#configure-custom-instructions) (like `claude.md`) to your repository with instructions on how to build and test your code.
167
167
168
+
#### Configure organization environment variables and secrets
169
+
170
+
Define environment variables and secrets once for your organization instead of repeating them in each repository. Every repository environment inherits them: organization environment variables are available during both environment setup and Bits Code execution, and organization secrets are available as environment variables only during environment setup. A repository environment with no setup command still inherits organization environment variables, but not organization secrets.
171
+
172
+
To configure them, go to {{< ui >}}Bits Code{{< /ui >}} > {{< ui >}}Settings{{< /ui >}} > [{{< ui >}}Repositories{{< /ui >}}][5], and find the {{< ui >}}Environments{{< /ui >}} section. Names must be valid shell environment variable identifiers. A repository environment can also opt out of an inherited environment variable or secret, which makes that name unavailable in the repository. Remove the opt-out to inherit the value again.
173
+
174
+
Managing organization environment variables and secrets requires one of the following permissions: [`Bits Code Write`][1], `Integrations Manage`, `User Access Manage`, or `Org Management`. None of these permissions require source code access to the repositories that inherit the values, so a user who has one of them can influence environment setup and agent execution across all of your repositories. Grant these permissions only to users who need them.
0 commit comments