checkout_gitlab_repo; issue and merge
request work happens through glab in the sandbox. A GitLab MCP server, if you
connect one, is a separate connection with its own credential.
Setup
On the agent’s Tools page, choose Add tool → GitLab. Supply a personal access token from that agent’s own GitLab.com account, withapi and
write_repository scopes. Optionally set default_repository to
namespace/project (nested groups are supported), then Save changes.
Checkout and workspace tools become available automatically when a
sandbox runtime is configured. Manage tools
and Coding account access provide optional opt-outs.
Sandbox delivery is on by default: once saved, the token is usable in this
agent’s own sandbox without a separate step. An explicit opt-out under Coding
account access is kept. GitHub and GitLab permissions are independent, and an
agent can have either or both. No instance acting identity, shared account, or
another agent’s token is inherited. Provider permissions are the real resource
boundary: a default project does not restrict a broad PAT.
Workflow
checkout_gitlab_repo accepts project, ref, and branch, verifies the
GitLab account and project through glab, and returns the checkout path. Use it
as workspace_exec’s cwd, edit and test, commit, and push with Git. Open the
merge request with:
--draft when needed. An existing local branch is preserved, including
unpushed commits. Push before finishing: unpushed work is lost when the
workspace is released, and Formation retains a workspace only for a paused task.
Git credentials are host-scoped and commit identity is repository-local, so
switching providers does not relabel an earlier checkout. GitLab project paths
and snapshot keys include gitlab.com, keeping GitHub’s existing paths intact.
The glab installer pins a release and verifies upstream SHA-256 checksums for
Linux AMD64/ARM64. The token reaches the sandbox through the protected grant
file, never a literal clone URL or command argument.
Supported boundary
This release supports GitLab.com over HTTPS with a personal access token. It does not support self-managed/Dedicated hosts, SSH keys, OAuth, CI job tokens, or multiple GitLab accounts for one agent. Account identity comes from GitLab’s current-user API, including the account’s configured commit email. An empty repository must be initialized before checkout. The agent’s token must have access to the target project and permission to push/create merge requests. Rotating the token or changing either provider’s delivery permission invalidates the run’s sandbox and retires reusable snapshots; continuation cannot revive an older permission. See sandbox credential delivery for teardown, long-lived PAT exposure, failure behavior, and provider-side token revocation.Upgrading
The multi-provider credential migrations (0076–0078) recorded GitLab
delivery as disabled for every agent that already had a GitHub credential
issuance. Those rows are explicit opt-outs: the later automatic default applies
only where no permission row exists, and existing disabled GitLab and GitHub
permissions remain unchanged. On an upgraded install, turn GitLab delivery on
under Coding account access for those agents; until then checkout reports
that sandbox delivery must be enabled.
These migrations are a planned maintenance step, not a zero-downtime change.
Stop old application replicas before applying them: the old binary uses a
single-run conflict key. The index build runs in its own transaction and blocks
issuance writes while allowing reads; a short exclusive DDL transaction follows,
and backfill and CHECK validation run after its locks are released. The
multi-provider issuance schema cannot be downgraded to its old single-row
primary key once a run has both provider records; roll forward to recover.