Environment prerequisites

Check access, connect source control, and configure runtime secrets before using Environments.

Check access and compute policy

Environments must be enabled for your organization in the hosted Factory experience. If Settings → Environments is missing, contact a manager or owner, or support@factory.com, to check access. A local-only or air-gapped installation does not provide this hosted surface.

Factory-hosted instances require an active paid subscription and an allowed compute policy. Free accounts cannot launch Environment sessions; trial, ended, or overdue subscription states can also block managed compute. Factory-hosted compute is currently unavailable for organizations in the EU region.

Your organization can restrict Environments to creating persistent Droid Computers. In that case, Environments may be visible in settings but absent from new-session and automation run pickers. Use the Droid Computer creation wizard in Settings → Droid Computers → Create to select a Ready Environment when its selector is available, or ask a manager or owner about your organization's access.

Managers and owners can create, edit, delete, and set defaults for organization Environments. Members can manage their own personal Environments and use organization Environments whose repositories they can access. Settings → Fleet is available to managers and owners.

Configured OpenCompute sources use your organization's infrastructure and provider policy. Their availability and capacity can differ from Factory-hosted compute.

Connect GitHub in both places

Warning

For repository-backed GitHub Environments, connect GitHub both personally and for your organization. One connection does not replace the other. The GitHub App must also have access to every repository the Environment uses.

  1. 1
    Open Settings → Account → General and connect your personal GitHub account under Code providers.
  2. 2
    Ask a manager or owner to open Settings → Organization and connect the organization's GitHub integration.
  3. 3
    In the GitHub App installation, grant access to the required repositories. If the installation uses selected repositories, add each repository explicitly.
  4. 4
    Confirm that your personal GitHub account can access those repositories, then return to Settings → Environments.

The organization integration supplies repository access for building; your personal connection verifies which repositories and Environments you can use. An organization Environment does not grant members access to its code. A member needs access to every included repository.

If the repository picker is empty or an Environment is missing, check all three: personal connection, organization connection, and GitHub App repository grants. You can create an Environment without repositories, but that does not fix repository access.

GitLab integrations and configured self-hosted source control are also supported. Other providers appear only when enabled for your organization. Use the repositories actually available in the picker rather than assuming every provider is enabled.

Configure runtime secrets

Environment instances use the managed-computer secrets in Settings → Account → Secrets. These values become environment variables at runtime; there are no per-Environment variable or secret fields in the Environment editor.

  1. 1
    Open Settings → Account → Secrets.
  2. 2
    Choose Personal, or Organization if you are a manager or owner adding shared values.
  3. 3
    Click Add secret. Enter a Secret name, such as PACKAGE_TOKEN, and its Secret value, then save.
  4. 4
    To rotate a value later, use Edit from its menu. Saved values cannot be viewed again.

Names use uppercase letters, numbers, and underscores, starting with a letter or underscore. Runtime-reserved names are not allowed. Values must be nonempty and single-line.

Secret limits

Factory checks these limits when you save a secret. Personal and organization secrets are counted separately.

LimitValue
Name1 to 128 characters: uppercase letters, digits, and underscores, starting with an uppercase letter or underscore.
Value1 to 10,000 characters on a single line. Line breaks (\n, \r) and NUL characters are rejected.
Secrets per scope100
Combined value length per scope50,000 characters

Store multi-line values

Private keys, certificates, and JSON service-account files span several lines, so they cannot be saved as is. Encode them as one base64 line on your own workstation, save the encoded text as the secret, and decode it in the session.

Bash
# Encode on your workstation. tr removes the line breaks that base64 adds on Linux.
base64 < service-account.json | tr -d '\n' > service-account.json.b64
Bash
# Decode in a session, into a file only your user can read.
(umask 077 && printf '%s' "$SERVICE_ACCOUNT_JSON_B64" | base64 -d > "$HOME/.config/service-account.json")

Base64 grows the value by about one third, so the original file can be at most about 7,500 bytes. For keys, prefer compact formats such as Ed25519 and binary exports over ASCII armor. To sign commits with a key stored this way, follow Sign commits on managed computers.

Reserved secret names

The managed computer runtime sets these variables itself, so a secret with one of these exact names is rejected with Secret name is reserved by the managed computer runtime.

CategoryReserved names
Shell and systemPATH, HOME, USER, LOGNAME, SHELL, PWD, OLDPWD, LANG, LC_ALL, TERM, TMPDIR, TEMP, TMP, PORT, HOSTNAME, HOSTTYPE, MACHTYPE, OSTYPE, VENDOR, GROUP, EDITOR, PAGER, MANPATH, INFOPATH
Loaders and interpretersLD_LIBRARY_PATH, LD_PRELOAD, CPATH, LIBRARY_PATH, PROMPT_COMMAND, BASH_ENV, ENV, NODE_ENV, NODE_OPTIONS, PYTHONPATH, PYTHONSTARTUP, RUBYOPT, PERL5OPT
Source controlGH_TOKEN, GH_HOST, GH_ENTERPRISE_TOKEN, GITLAB_TOKEN, GITLAB_HOST, GITLAB_SH_TOKEN, GITLAB_SH_HOST, AZURE_DEVOPS_TOKEN, AZURE_DEVOPS_SERVER_TOKEN
Factory runtimeFACTORY_API_KEY, FACTORY_ENV, FACTORY_DEPLOYMENT_ENV, FACTORY_PROVISIONING_ID, FACTORY_MACHINE_TYPE, FACTORY_SCM_CREDENTIAL_MODE, FACTORY_SCM_CREDENTIAL_PREM_ORIGIN, FACTORY_EXPECTED_PREM_ORIGIN, REMOTE_MACHINE_ID, REMOTE_UPDATE_SERVER_URL, REMOTE_UPDATE_SERVER_TOKEN, ENABLE_SENTRY, DROID_FORCE_BLOCKING_UPDATE, TESTING_BYPASS_TOKEN_PASSWORD

Matching is exact and case-sensitive: GITLAB_TOKEN is reserved, but MY_GITLAB_TOKEN and GITLAB_TOKEN_READONLY are allowed. Source-control credentials come from your source-control integrations, not from secrets.

Some names save successfully but can be removed or replaced on the computer because Factory's source-control setup also manages them. Do not use them for your own values:

  • GITHUB_TOKEN, GITHUB_ENTERPRISE_TOKEN, GITLAB_ACCESS_TOKEN, and OAUTH_TOKEN are not written to the computer when Factory's daemon manages source-control credentials.
  • BITBUCKET_TOKEN, GLAB_IS_OAUTH2, FACTORY_GLAB_CLOUD_TOKEN, and FACTORY_GLAB_SELF_HOSTED_TOKEN are cleared and rewritten when source-control credentials refresh.
  • Other names starting with FACTORY_ or DROID_ can collide with variables that the runtime adds later.

Any other name is available. Examples include GPG_SIGNING_KEY_B64, SSH_SIGNING_KEY_B64, NPM_TOKEN, and PACKAGE_TOKEN; Factory gives none of them special handling.

Organization secrets apply to managed computers for members and service accounts. Personal secrets apply to your computers in that organization. A personal secret overrides an organization secret with the same name. A delegation or automation running as a service account uses that account's secrets and the organization's defaults, not the configuring user's personal secrets.

New instances receive current values. Existing computers keep their current environment until credentials are refreshed and the relevant processes are restarted; changing a secret does not update a running process immediately. Deleting a personal override lets the organization value apply after refresh and restart.

Warning

Runtime secrets are not available during the Environment build. Setup scripts cannot use these values to authenticate to private package registries, artifact stores, or cloud CLIs. Run credential-dependent commands explicitly in a session after the instance starts, or keep them out of the build. Do not put tokens in setup scripts or commit credential files into the snapshot.