# Delegation

Start a beam with selected roles, verify its workload identity, and end its access when the task is done.

A beam has its own short-lived Teleport workload identity. An agent uses that identity to act on your behalf; it does not need a copy of your Teleport credentials. The delegation chain records who created the beam while keeping the beam's identity distinct from yours.

**Install the client tools and sign in**

Beams is a [Teleport](https://goteleport.com) project and uses [official Teleport client tools](https://goteleport.com/download/client-tools/).

The client tools include `tsh` to sign in and run commands, and `tctl` to administer your cluster if you have permission.



Cluster: `example.beams.run`. Edit this example to use your cluster name.

Install version **18.11.10** of the client:

**macOS**

Download and open the macOS installer, then follow its instructions.

```sh
curl -O https://cdn.teleport.dev/teleport-tools-18.11.10.pkg
open teleport-tools-18.11.10.pkg
```

**Linux**

For Linux x86-64, download and install the client tools:

```sh
curl -O https://cdn.teleport.dev/teleport-v18.11.10-linux-amd64-bin.tar.gz
tar -xzf teleport-v18.11.10-linux-amd64-bin.tar.gz
sudo ./teleport/install
```

**Windows**

For Windows x86-64, run these commands in PowerShell. Add the extraction directory (`$env:LOCALAPPDATA\Teleport`) to your user PATH to use `tsh` in future terminals; the last command adds it to this terminal's PATH.

```powershell
Invoke-WebRequest -Uri https://cdn.teleport.dev/teleport-v18.11.10-windows-amd64-bin.zip -OutFile teleport.zip
Expand-Archive -Path teleport.zip -DestinationPath "$env:LOCALAPPDATA\Teleport" -Force
$env:Path += ";$env:LOCALAPPDATA\Teleport"
```

Follow the official client [tools install guide](https://goteleport.com/download/client-tools/) for other versions and architectures.

Check that you’re running v18.11.10 of the client with `tsh version`.

```sh
tsh version
```

**Passwordless**

I sign in without a password (e.g. a passkey).

```sh
tsh login --proxy='example.beams.run' --auth=passwordless
```

**Password \& MFA**

I have a password & MFA set up for my account:

Replace `you@example.com` with your Teleport username.

```sh
tsh login --proxy='example.beams.run' --user=you@example.com
```

**SSO**

I sign in with SSO (e.g. Okta, GitHub, SAML).

```sh
tsh login --proxy='example.beams.run'
```

You need permission to create beams and at least one standing role that your cluster allows you to delegate. Choose a role that grants only the access the task needs. `beam-user` is a starting point on clusters with the standard Beams roles. It is not a zero-access role: for example, it can grant access to the cluster's LLM Gateway.



## 1. Start a beam with selected roles

Check your current identity and roles with `tsh status`. Create a beam with `beam-user`, or replace it with your cluster's task-specific role. Use a comma-separated list if the task needs more than one role.

**Local terminal**

```sh
tsh status
tsh beams add --roles=beam-user --no-share-connected-accounts --no-console --format=json
```

Note the `id` in the output and use it in place of `my-beam` below. `--no-share-connected-accounts` opts out of sharing connected accounts such as GitHub at creation. It does not change Teleport roles; check actual access inside the beam.

If you omit `--roles`, Teleport selects your standing roles that are eligible for delegation. On clusters with the standard wildcard policy this can include all your standing roles. Do not rely on temporary access from your own access requests being carried into the beam. If Teleport rejects your selection, check that you hold the role and that your cluster lets you delegate it. Always pass at least one role, such as `beam-user`.

## 2. Check the identity and effective access

**Local terminal**

```sh
tsh beams ssh my-beam
```

**Inside the beam**

```sh
tsh status
tsh apps ls
tsh db ls
tsh git ls
```

In `tsh status`, look for a separate `bot-beam-…` username and a **Delegation chain** that links your user to the beam. The beam can have Teleport-managed roles in addition to the roles you selected. Check the resource lists for the access you expect; also check that access you meant to withhold is absent. With `--no-share-connected-accounts`, `tsh git ls` lists no organizations, even if `tsh status` still shows a GitHub username. If the task later needs another resource, use an [access request](/docs/identity/access-requests/) rather than starting over with broad standing access.

## 3. End access when the task is done

Save any work you need before deleting the beam. Deleting it discards unsaved workspace changes. Exiting the shell alone does not stop the beam or its processes.

**Local terminal**

```sh
tsh beams rm my-beam
tsh beams ls
```

Confirm the beam no longer appears. If you suspect unintended activity, stop the beam and ask your Teleport administrator to investigate. Use the beam ID and `tsh status` identity to correlate activity with its creator. Do not treat disconnecting, or dropping a request from one CLI profile, as revoking the beam's access everywhere.

## Control which roles can be delegated

Administrators control eligibility through `allow.delegation.roles` and `deny.delegation.roles` on Teleport roles. The preset `beam-user` uses `allow.delegation.roles: ["*"]`. A wildcard makes existing roles eligible; it does not assign new roles. Use a deny rule to exclude sensitive roles when a wildcard would otherwise allow them.

Review the full role set before limiting delegation. A role can restrict access even if it does not grant access to the resource at hand. For example, one role can turn off SSH file copying for the whole identity. Do not drop a role without checking its `deny` rules and restrictive options. Test both allowed and denied access in an ephemeral runtime before rolling out changes.

## Keep identity and runtime boundaries separate

Delegation controls Teleport access. It does not approve every action an agent can take, make a published app public, or block outbound internet traffic. See [Access control](/docs/identity/authorization/) for roles and ownership and [Runtime limits](/docs/runtime/limits/) for isolation and networking. Keep static credentials out of workspace images and review outputs before publishing or saving a phase snapshot.
