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

# Credentials

> How 2501 keeps and uses usernames, passwords, keys and tokens

A credential is a named value: a username, a password, an SSH key, a token or an API key. Agents use credentials to log in to hosts and to run commands. 2501 also uses them to connect to jump hosts, gMSA configurations, satellite clusters, LLM providers and plugins. [Credentials](https://docs.2501.ai/0.22/configure/credentials.md) has the setup steps.

## Variables and Secrets

A credential is a variable or a secret. You choose when you create it.

* A **variable** holds a value that is not secret, such as a username. 2501 shows its value in the credentials list, on its page and in the fields that use it, and the [API](https://docs.2501.ai/0.22/api/overview.md) returns it.
* A **secret** holds a value that must stay hidden, such as a password, a key, a token or an API key. 2501 never shows its value after you save it. To change the value, edit the credential and enter the new value.

You can change a variable into a secret in the Command Center, not through the API. Its value is hidden from then on. If it has already been used, rotate it, because task history may hold it. You cannot change a secret into a variable. Credentials created before variables existed are secrets.

A password, private key, token or API key field takes only a secret. A username, public key or certificate field takes a variable or a secret.

## Where the Value Is Kept

The type of a credential tells where 2501 gets its value.

| Type | The value is kept in | 2501 reads the value |
| - | - | - |
| **Variable** | 2501, in clear | Each time it uses the credential |
| **Secret**, **SSH private key** | 2501, encrypted with the [credential key](https://docs.2501.ai/0.22/deployment/configuration.md#secrets) of your installation | Each time it uses the credential |
| **Vault path** | The HashiCorp Vault of your installation, through the Vault PAM system that the upgrade added | One time for each task |
| **PAM account** | A PAM system: CyberArk, WALLIX or HashiCorp Vault | One time for each task |

## Agents and Credentials

An agent uses a credential in two ways:

* **To log in to its host.** A role tells how the agent uses each credential: the login, the password or the SSH key. See [assigning credentials to agents](https://docs.2501.ai/0.22/configure/credentials.md#assigning-credentials-to-agents).
* **By name in a task.** The agent writes `{{secret:<name>}}` in a command or a plugin call, and 2501 puts in the value when the command runs. The agent can use only the credentials on its [allowlist](https://docs.2501.ai/0.22/core-concepts/agents.md#credential-access-control).

The model sees the names and the descriptions of the credentials. It never sees the value of a secret.

## Credentials and Organizations

A credential belongs to one organization or to the tenant. An agent can use the credentials of its organization and the tenant-wide credentials. When both have a credential with the same name, the agent uses the credential of its organization. See [Organizations](https://docs.2501.ai/0.22/core-concepts/organizations.md#shared-resources).

## PAM Accounts

A PAM system is the privileged access management system that keeps your account passwords. A credential of the PAM account type names a PAM system and a path. 2501 reads the value when a task starts to use the credential.

**CyberArk.** A task reads each path one time. The next task reads the path again. Thus, a task uses the new password after CyberArk rotates it.

**WALLIX.** A task checks out each account one time, and 2501 checks it in when the task ends. At check-in, WALLIX can rotate the password. Tasks that use the same account at the same time share one checkout. Outside a task, 2501 keeps the value for 5 minutes.

[Privileged access](https://docs.2501.ai/0.22/configure/privileged-access.md) has the setup steps.

## Session Proxies

A session proxy is the part of a PAM system that opens SSH sessions for its users. CyberArk calls it PSM for SSH, and WALLIX Bastion calls it the SSH proxy. When a host uses a session proxy, 2501 never connects to the host and never gets its password or key.

```mermaid theme={null}
flowchart LR
  E[2501 engine] -->|"SSH as svc-2501@root@srv42"| P[Session proxy]
  E -.->|optional| J[Jump hosts] -.-> P
  V[(PAM vault)] -->|"password or key of root"| P
  P -->|"SSH as root, recorded"| H[srv42]
```

2501 signs in to the proxy with the user of the PAM system. The agent username names the account, for example `root@srv42`. The PAM system gets its password or key from the vault, then opens and records the session.

2501 opens one session for each command that runs at the same time, so a task can show more than one session. A sign-in test shows as a refused session for the account `2501-test`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.