# Coding agent setup

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> Install any coding agent on a workstation, give it a key and sign in, then change the defaults Ringleader sets for the agents it supports.


Install any coding agent on a workstation, give it a key and sign in, then change the defaults
Ringleader sets for the agents it supports. The agent runs inside the workstation, so it sees
the files and tools you put there and none of the files on your computer.

The steps on this page work for every agent. [Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/)
says which agents Ringleader also configures, and the last section lists the defaults it sets for
each. For an agent that is not on that list, see
[Run your own coding agent in Ringleader](https://docs.ringleader.dev/guides/run-own-coding-agent/).

## Memory and outbound traffic

A coding agent is a long-running program, so size the workstation for it. Memory is a provider
setting. [Provider settings](https://docs.ringleader.dev/workstations/configuration/provider-settings/)
describes how to give a workstation more. Ringleader sets no memory for any agent.

<div class="callout callout-tip">
  <p class="callout-title">Give Claude Code a few GiB of memory</p>
  <div class="callout-body">
    In Ringleader&rsquo;s experience, Claude Code needs more memory than a 1 GiB workstation has. Give a
Claude Code workstation at least a few GiB.
  </div>
</div>


If the workstation restricts outbound traffic, the agent can reach only the hosts the policy
allows. Allow the host of the agent's model provider and the host it signs in at.
[Outbound restrictions](https://docs.ringleader.dev/security/outbound/outbound-restrictions/)
describes the policy. When an Integration adds a key to the agent's requests, the agent must
also trust Ringleader's certificate, as
[Effects of injection on a workstation](https://docs.ringleader.dev/security/credentials/injection-effects/) describes.

## Install a coding agent

Add the agent to the workstation. For a supported agent, declare its devtool, as
[Install a devtool](https://docs.ringleader.dev/workstations/packages-tools-settings/devtools-tool-configuration/#install-a-devtool)
describes, or apply one of the [stacks](https://docs.ringleader.dev/workstations/packages-tools-settings/stacks/), which
install an agent for you. Any other agent installs as a package or a script, as the
[Run your own coding agent in Ringleader](https://docs.ringleader.dev/guides/run-own-coding-agent/) guide describes.

Each supported agent has its own devtool and its own command, which
[Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/#install-and-defaults)
lists. Each command is on the system `PATH`, so it works for the login user and for `root`. The
[Devtools](https://docs.ringleader.dev/reference/tools/devtools/) reference lists the versions each devtool
installs.

## Start a coding agent

Open a shell on the workstation, then run the agent's command:

```bash
rl shell <workstation>
```

When the agent asks you to sign in, follow [Sign in to a coding agent](#sign-in-to-a-coding-agent).

## Give a coding agent a key

An agent that calls a provider with an API key needs the key in its environment. Put the key
in a Secret and name it in the workstation's `environment`. This example uses Claude Code's
variable. Each agent reads a different one, which
[Sign in to a coding agent](#sign-in-to-a-coding-agent) lists:

```yaml
spec:
  environment:
    ANTHROPIC_API_KEY: "${secret:anthropic-api-key}"
```

<div class="callout callout-warning">
  <p class="callout-title">The key is readable on the workstation</p>
  <div class="callout-body">
    The key is then in the workstation&rsquo;s environment.
<a href="https://docs.ringleader.dev/security/credentials/secret-handling/#secrets-on-the-workstation">Secrets on the workstation</a>
says what that exposes. To keep it off the workstation, use an <code>httpProxy</code> Integration, as
<a href="https://docs.ringleader.dev/workstations/coding-agents/llm-gateways/#keep-the-gateway-key-off-the-workstation">Keep the gateway key off the workstation</a>
describes. It works for any agent that calls a fixed host, and
<a href="https://docs.ringleader.dev/workstations/coding-agents/llm-gateways/#keys-added-to-requests-for-any-agent">Keys added to requests for any agent</a>
says what Codex, pi and OpenCode need besides.
  </div>
</div>


## Sign in to a coding agent

Sign in with your account, or give the agent an API key. A workstation has no browser, so an
agent that opens one to sign you in needs
[Browser sign-in](https://docs.ringleader.dev/workstations/connectivity/browser-sign-in/). If the agent
prints a sign-in link, follow
[Sign in to a tool from a workstation](https://docs.ringleader.dev/guides/tool-sign-in/).

The table gives each agent's sign-in and its API key variable, from the agent's own
documentation. Follow the documentation, because the agents change their sign-in more often than
Ringleader does.

| Agent | Sign in | API key variable | Documentation |
|-------|---------|------------------|---------------|
| Claude Code | Run `claude` and sign in when it opens the browser, or run `claude auth login`. | `ANTHROPIC_API_KEY` | [Authentication](https://code.claude.com/docs/en/authentication) |
| Codex | Run `codex login`. On a workstation with no browser, run `codex login --device-auth`. | `OPENAI_API_KEY`, passed to `codex login --with-api-key` | [Authentication](https://learn.chatgpt.com/docs/auth) |
| OpenCode | Run `/connect` in OpenCode and choose a provider. | The variable of the provider you choose, such as `OPENROUTER_API_KEY` | [Providers](https://opencode.ai/docs/providers/) |
| pi | Run `/login` in pi and choose a provider. | The variable of the provider you choose, such as `OPENROUTER_API_KEY` | [Providers](https://docs.pi.dev/latest/providers) |
| Cursor CLI | Run `cursor-agent login`. Cursor's documentation writes the command as `agent login`. | `CURSOR_API_KEY` | [Authentication](https://cursor.com/docs/cli/reference/authentication) |
| Antigravity CLI | Run `agy`. It opens a browser, or over SSH prints a link and asks for the code the browser shows. | `GEMINI_API_KEY`, with `"modelProvider": "gemini"` in `~/.gemini/antigravity-cli/settings.json` | [Authenticate](https://antigravity.google/docs/install?tab=cli) |

## Coding agent defaults

[Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/#install-and-defaults)
says what Ringleader sets for each agent. Each subsection below has the same two parts: how
the default works, and how to change it. A toolconfig writes an agent's own configuration
files. Add one only to change a default, set a model or add MCP servers.

### Claude Code defaults

- **Defaults:** Installing the `claude-code` devtool puts three settings in the managed
  settings layer:
  - `permissions.defaultMode` is `"bypassPermissions"`, so Claude Code does not prompt.
  - `skipDangerousModePermissionPrompt` is `true`, so Claude Code starts without the
    "Bypass Permissions mode" warning. Ringleader sets it only when it sets
    `permissions.defaultMode` itself.
  - `env.DISABLE_AUTOUPDATER` is `"1"`, so the background updater does not run. The updater
    runs as the login user and cannot write the root-owned install, so all it would do is
    print an `Auto-update failed` warning. `claude update` still works by hand.

  Folder trust is separate from these settings. Claude Code opens without a trust prompt in
  the folders in `sources[].path` and `trustedFolders`. Start it outside those folders, such as
  in your home directory, and it can ask whether you trust the folder.
- **To change:** Set the key in `managedSettings` of a
  [`claude-code` toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/claude-code/). Your value
  then stands:

```yaml
spec:
  toolconfigs:
    - id: claude-code
      name: claude-code
      config:
        managedSettings:
          permissions:
            defaultMode: default        # prompts return
            deny:
              - "Bash(rm -rf *)"
          env:
            DISABLE_AUTOUPDATER: "0"    # background auto-update returns
```

Setting `permissions.defaultMode` or `permissions.disableBypassPermissionsMode` leaves your
whole `permissions` block as you wrote it. The `allow`, `deny` and `ask` lists are kept either
way. If you set `defaultMode` to `"bypassPermissions"` yourself, also set
`skipDangerousModePermissionPrompt: true`, or Claude Code shows the warning when it starts.

To keep the warning with Ringleader's bypass mode, set `skipDangerousModePermissionPrompt` to
`false`. Claude Code can still skip the warning for a user who has already accepted it.

### Codex defaults

- **Defaults:** Ringleader sets one thing. It trusts the folders in `sources[].path` and
  `trustedFolders`, and only when the workstation declares any.
- **To change:** Add a [`codex` toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/codex/). Its
  `configToml` is your own `config.toml`, and `config` takes the same settings as YAML. To
  trust another folder, add it to `trustedFolders`.

```yaml
spec:
  toolconfigs:
    - id: codex
      name: codex
      config:
        configToml: |
          model = "o4-mini"
```

### OpenCode defaults

- **Defaults:** Ringleader sets two defaults on every workstation. Automations are off,
  through `automations: false` in `/etc/opencode/opencode.json`. OpenCode reads that file after a
  repository's own settings, so a repository cannot turn automations back on. The update
  offer is off, because login shells and OpenCode sessions set `OPENCODE_DISABLE_AUTOUPDATE=1`.
- **To change:** To turn automations back on, declare `automations: true` under `settings` of an
  [`opencode` toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/opencode/). To turn the update
  offer back on, set `OPENCODE_DISABLE_AUTOUPDATE` in the workstation's `environment`. Your
  value wins, and OpenCode's documentation says which values it reads as disabled.

```yaml
spec:
  toolconfigs:
    - name: opencode
      config:
        settings:
          automations: true
```

### pi defaults

- **Defaults:** None. Ringleader writes no pi setting unless you declare a `pi` toolconfig or an
  LLM Integration reaches the workstation.
- **To change:** Add a [`pi` toolconfig](https://docs.ringleader.dev/reference/tools/tool-configuration/pi/) to set the
  default model, install packages, or declare providers and MCP servers.

```yaml
spec:
  toolconfigs:
    - name: pi
      config:
        settings:
          defaultProvider: anthropic
          defaultModel: claude-sonnet-4-5
```

### Cursor CLI defaults

- **Defaults:** None. Ringleader installs Cursor CLI and sets nothing in it.
- **To change:** None, because Ringleader has no toolconfig for Cursor CLI. Write its own
  configuration files with the workstation's `files`.

### Antigravity CLI defaults

- **Defaults:** None. Ringleader installs Antigravity CLI and sets nothing in it. The CLI
  updates itself in the background.
- **To change:** None, because Ringleader has no toolconfig for Antigravity CLI. Write its own
  configuration files with the workstation's `files`.

## Next steps

- [Supported agents](https://docs.ringleader.dev/workstations/coding-agents/supported-agents/)
  says what Ringleader installs, sets and configures for each agent.
- [LLM gateways for coding agents](https://docs.ringleader.dev/workstations/coding-agents/llm-gateways/)
  points your agents at an LLM gateway.
- [MCP servers for coding agents](https://docs.ringleader.dev/workstations/coding-agents/mcp-servers/)
  gives your agents MCP servers.
- [Browser sign-in](https://docs.ringleader.dev/workstations/connectivity/browser-sign-in/)
  sets up the sign-in link that an agent opens.
- [Run your own coding agent in Ringleader](https://docs.ringleader.dev/guides/run-own-coding-agent/)
  runs an agent that Ringleader does not configure.
- [Lock down Claude Code for unattended runs](https://docs.ringleader.dev/guides/lock-down-claude-code/)
  keeps your keys and your local network away from a Claude Code workstation.

