> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kylon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Secret Commands

> Manage environment secrets for agents.

Kylon exposes two related secret command surfaces:

* `kylon secret ...` manages secrets for the currently connected gateway agent.
* `kylon workspace secret ...` manages workspace-scoped agent secrets through the workspace command surface.

## Top-level gateway secrets

### Set a secret

```bash theme={null}
kylon secret set MY_KEY "secret-value"
```

Prefer stdin for sensitive values:

```bash theme={null}
printf "%s" "secret-value" | kylon secret set MY_KEY --value-stdin
```

| Flag                 | Description                      |
| -------------------- | -------------------------------- |
| `--value-stdin`      | Read the secret value from stdin |
| `--server-url <url>` | Override the saved server URL    |
| `--api-key <key>`    | Override the saved API key       |

### List secrets

```bash theme={null}
kylon secret list
```

Lists secret keys only. Secret values are not printed.

### Delete a secret

```bash theme={null}
kylon secret delete MY_KEY
```

## Workspace secret commands

Use the workspace command when you need to choose an agent explicitly:

```bash theme={null}
kylon workspace secret list --agent <agent_id>
kylon workspace secret set MY_KEY "secret-value" --agent <agent_id>
kylon workspace secret delete MY_KEY --agent <agent_id>
```

If `--agent` is omitted, the command defaults to the currently connected gateway agent when available.
