Skip to content

Coding steps

A step that works on a repository is shaped by two of its tool grants: Bash and the coding agent (delegate_coding_task). Which ones a step grants decides where its commands run and what they can do. This page is written for the person shaping the step and for the run reading it.

The step grants Bash runs in What it holds
Bash, without the coding agent A lightweight interpreter, started fresh for each leg of the run python3, pip, node and git. No bun, no pnpm, no Rust.
Bash and the coding agent The run’s coding sandbox, kept for the whole run node 24 with npm, pnpm, yarn and bun; python 3.15 with pip, uv and poetry; go; java 21 and 17 with maven and gradle; rust with cargo; ruby with bundler; git, gcc and make, cmake, ripgrep and jq.

The coding sandbox exists only in a workflow run, and only where the workspace can run a coding agent. A chat’s Bash is always the interpreter.

In a workflow run, Bash refuses package installs (bun, npm, yarn or pnpm with install, ci or add) and cargo build / cargo install, in either place. The refusal says why: an install writes gigabytes to the shell’s disk.

The coding agent is what installs, builds and tests. It works in the same coding sandbox as the step’s Bash, on the repository cloned there with GitClone, for up to two hours per task, and it reports back. It never commits or pushes: the run reviews its diff in Bash and pushes with GitPush.

A repository can say how its sandbox is prepared by committing .alma/setup.json to its default branch. Before the coding agent starts, Alma runs its commands in order from the repository’s root, stopping at the first that fails:

{
"install": [
["pnpm", "install", "--frozen-lockfile"],
["pnpm", "run", "codegen"]
],
"env": { "CI": "1" },
"timeoutSeconds": 600
}
  • install is a list of commands, each written as its program and arguments. No shell reads them, so &&, pipes and $VARS are passed as plain text; run ["sh", "-c", "…"] if a step needs a shell.
  • env holds settings that are not secrets. A value that looks like a credential is refused, and so are HOME, PATH, any proxy setting and names starting GIT_ or ALMA_, which Alma sets.
  • timeoutSeconds is optional, and never more than 15 minutes.

The file is always read from the default branch, never from the branch the task works on, so a branch or pull request cannot change what setup runs: a change to the file takes effect once it is merged. If Alma cannot tell which branch is the default (a repository the task did not clone with GitClone), nothing declared runs, and if the branch has the file the report says it was not used.

The commands run where setup always runs, with the same network and no sign-in or credential: in the coding sandbox they reach the hosts listed under Network, and on a member’s own machine, the job’s hosts other than its coding agent’s provider. The file never widens either.

Without the file, a dev container on the default branch (.devcontainer/devcontainer.json) is used: its onCreateCommand, updateContentCommand and postCreateCommand run in that order, with its containerEnv and remoteEnv values. Alma does not build the dev container’s own image or install its features: the coding sandbox’s image (above) is used instead, and the report names the image and any feature it does not carry, as well as any setting that refers to another variable. Commands written for that image can fail on Alma’s; when they do, the lockfiles are installed after them. .alma/setup.json always wins over a dev container.

With neither, both the coding sandbox and a member’s machine install every ecosystem whose lockfile or manifest is at the repository’s root, exactly as locked:

Found Installed with
bun.lock, pnpm-lock.yaml, yarn.lock, package-lock.json (the first) bun, pnpm, yarn or npm, with install scripts off
uv.lock, else poetry.lock uv sync --frozen or poetry install, into .venv
go.mod go mod download
Cargo.toml cargo fetch (--locked with a Cargo.lock)
gradlew or a Gradle build, else pom.xml every Gradle configuration resolved, or Maven’s dependency:go-offline
Gemfile.lock bundle install, frozen

Python, Java and Ruby installs run the project’s own build code (a build backend, Gradle or Maven plugins, native extensions); Node installs run none. A repository with none of these leaves installing to the coding agent. A file that is not valid, is a link, or is larger than its limit is not used: the coding task’s report says why, and setup goes ahead with the next way. A setup that fails or runs out of time is named in the report too, with the lockfiles that did not install, and the coding agent is told to finish the job itself. Setup runs once per task: a task that continues after a restart finds it done.

Commands leave only through Alma’s egress proxy, which admits a fixed list of hosts. Fetch web pages and documentation with web_fetch instead.

The interpreter’s hosts
  • registry.npmjs.org
  • registry.yarnpkg.com
  • pypi.org
  • files.pythonhosted.org
  • crates.io
  • index.crates.io
  • static.crates.io
  • github.com
  • api.github.com
  • codeload.github.com
  • objects.githubusercontent.com
  • raw.githubusercontent.com
  • release-assets.githubusercontent.com
  • cdn.amazonlinux.com
  • docs.python.org
  • nodejs.org
  • developer.mozilla.org
  • docs.rs
  • doc.rust-lang.org
The coding sandbox’s hosts
  • registry.npmjs.org
  • registry.yarnpkg.com
  • pypi.org
  • files.pythonhosted.org
  • crates.io
  • index.crates.io
  • static.crates.io
  • github.com
  • api.github.com
  • codeload.github.com
  • objects.githubusercontent.com
  • raw.githubusercontent.com
  • release-assets.githubusercontent.com
  • proxy.alma.team
  • docs.python.org
  • nodejs.org
  • developer.mozilla.org
  • docs.rs
  • doc.rust-lang.org
  • repo.yarnpkg.com
  • proxy.golang.org
  • sum.golang.org
  • repo.maven.apache.org
  • repo1.maven.org
  • plugins.gradle.org
  • plugins-artifacts.gradle.org
  • services.gradle.org
  • downloads.gradle.org
  • rubygems.org
  • index.rubygems.org
  • static.rust-lang.org

GitClone refuses a repository larger than:

  • 150 MB in the interpreter, where the clone lasts one leg and is made again in the next;
  • 1 GB in the coding sandbox, where it lasts the whole run, uncommitted work included.

GitPush pushes with a token limited to the one repository’s contents, which does not carry GitHub’s workflows permission. GitHub refuses a push that adds or changes a file under .github/workflows/, so a coding step cannot change a repository’s Actions workflows. Leave those changes to a person.

  1. Grant GitClone, {DELEGATE_CODING_TASK_TOOL} and Bash, and GitPush with a branch_pattern (for example alma/*) so it pushes to its own branches without asking.
  2. In the instructions, have the run clone the repository, hand the change and its install, build and test commands to the coding agent, review the diff, then push and open a pull request.
  3. Say which checks prove the change, so the coding agent runs them before it reports.