Devsy
Developing in a Workspace

Reuse local credentials

Devsy makes your local Git credentials, opt-in GitHub CLI authentication, Docker registry credentials, and GPG keys available inside the dev container, so you do not configure them in each workspace.

Only use with trusted repositories

Code in the container, including lifecycle commands and features from devcontainer.json, can use these credentials. Do not enable them for repositories or devcontainer.json files you have not reviewed.

SSH agent forwarding never exposes your private key. Anything in the container can request signatures and so act as you against any service the key can reach, while the workspace runs.

Git

Devsy provides HTTPS credentials through a git credential helper. To turn off this injection in the default context:

devsy context set default -o SSH_INJECT_GIT_CREDENTIALS=false

SSH agent forwarding is separate. It is on by default (SSH_AGENT_FORWARDING=true). To turn it off in the default context:

devsy context set default -o SSH_AGENT_FORWARDING=false

Commit signing

If your host Git configuration sets gpg.format = ssh and user.signingkey, Devsy signs commits made in the workspace with your host key. The workspace never gets the private key. The GIT_SSH_SIGNATURE_FORWARDING context option controls this. It is on by default:

devsy context set default -o GIT_SSH_SIGNATURE_FORWARDING=false

user.signingkey can be a path to a private or public key file, or a literal public key. Devsy expands ~/ and ~user/ on the host, so ~/.ssh/git_signing_ed25519 points to your host home directory. A private key file needs no ssh-agent. To use a different key than the one in your Git configuration, pass --git-ssh-signing-key to devsy workspace up or devsy workspace ssh.

A workspace that selects a different key through its own user.signingkey can sign only if an ssh-agent holds that key. Otherwise signing fails and no commit is created. Devsy signs with the git namespace only.

GitHub CLI

GitHub CLI credential forwarding is off by default. Turn it on for a trusted context:

devsy context set <context> -o SSH_INJECT_GITHUB_CREDENTIALS=true

To turn it off:

devsy context set <context> -o SSH_INJECT_GITHUB_CREDENTIALS=false

Desktop shows the same option as GitHub CLI Credentials in the context's credential forwarding settings. It is independent of Git HTTPS credentials, Docker credentials, SSH agent forwarding, and signing. If a platform workspace's policy turns off Git credential forwarding, GitHub CLI forwarding is off too.

Scope and prerequisites

Install and sign in to gh on your macOS, Linux, or Windows host. In the Linux guest, install gh for the intended user. An executable version-manager shim also works. Devsy does not install GitHub CLI or sign you in. If the guest CLI is missing, install it and reconnect to retry setup.

An enabled relay gives workspace code the host's active account on every configured GitHub host, including GitHub.com and each GitHub Enterprise host. Each token keeps its API permissions, which reach beyond the workspace repository. Code can call GitHub APIs directly with these tokens. Enable it only for code you trust with that access.

The host needs an active user in its GitHub CLI configuration, with a file token or a keyring credential that Devsy can access. Devsy does not use host GH_TOKEN, GITHUB_TOKEN, GH_ENTERPRISE_TOKEN, or GITHUB_ENTERPRISE_TOKEN values for account lookup and does not forward environment-only host logins. GitHub CLI picks the target host for commands, aliases, and extensions.

Guest authentication and saved changes

Explicit guest authentication environment variables and local file or keyring tokens take priority, even when an API rejects them. Devsy does not retry a failed guest login with the host account. A registered guest account whose token cannot be read also blocks forwarding, because GitHub CLI cannot tell a missing keyring entry from a locked one. To use forwarding, repair or remove the guest registration.

Forwarded calls use a private temporary configuration. Devsy removes forwarded values before it writes changes back. Logins and keyring changes you make on purpose stay under GitHub CLI control. Saving the exact forwarded token back to a file can still count as forwarding, so turn forwarding off before a login that must stay separate from the host. If Devsy finds a newer complete local login, it keeps that login. It does not merge accounts or undo a logout.

An unwrapped gh process or another editor does not use Devsy's write lock. An edit made between Devsy's final check and the file replacement can be overwritten. Avoid changing authentication through the wrapper and an unwrapped CLI or editor at the same time. Devsy does not roll back keyring changes made outside Devsy.

Normal completion removes forwarded credentials before Devsy writes config back. An interrupted process can leave private temporary credentials until a later invocation recovers the session. Cleanup failures appear on stderr. This is not secure erasure. Guest commands do not change host configuration or keyring accounts.

Connections and troubleshooting

After you change the option, close existing service connections and reconnect. Restart a browser IDE to replace its services connection, and restart any older browser tunnel after you opt in. Changing the option does not revoke tokens that running code already has.

The guest's shared credential port has one live services owner. SSH sessions carry their expected host and service identity, and a mismatched or older service falls back to local authentication. Browser terminals and external SSH clients carry no session data, so they use the first live services owner. If two hosts use the same guest user, end the first connection before you change the owner. A second browser connection does not change or revoke the first owner's access.

If forwarding is unavailable, the wrapper runs the real CLI with local configuration. Run gh --version and gh auth status on the host and in the guest, confirm the context option, then reconnect. Check the guest user's PATH and noninteractive sudo access for wrapper setup. A locked keyring, a missing session bus, old agents, failed setup, and occupied credential ports can also block forwarding. DEVSY_LOG_LEVEL=debug gh ... writes the chosen authentication source and a sanitized failure category to stderr without changing GitHub CLI's stdout or exit status.

Docker

Devsy provides registry credentials through a Docker credential helper. The container can then pull and push private images. To turn this off for all workspaces:

devsy context set default -o SSH_INJECT_DOCKER_CREDENTIALS=false

GPG

Devsy can forward your GPG keys into the container over the SSH tunnel, so you can sign commits there. To turn it on for all workspaces:

devsy context set default -o GPG_AGENT_FORWARDING=true

Or for one workspace:

devsy workspace up --ssh-gpg-forwarding my-workspace

On this page