> Index of all Nori docs pages for agents: https://docs.noriagentic.com/llms.txt · Ask a question: https://noriagentic.com/ask

# Environment variables and secrets

Custom environment variables give sessions API keys, tokens, and settings for services that have no dedicated [integration](https://docs.noriagentic.com/sessions/guides/integrations/). Each variable is exported on the session machine for the sessions allowed to have it.

## Who can use it

| Scope        | Who gets it                                                                                                                   | Who can add it    |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| **Org**      | Every session in the org                                                                                                      | Admins and owners |
| **Personal** | Only sessions you start                                                                                                       | You               |
| **Agent**    | Only sessions running that [custom agent](https://docs.noriagentic.com/sessions/guides/custom-agents/), including automations | Admins and owners |

Admins can delete someone else’s personal variable but can’t change it.

Availability: personal and agent scopes are being rolled out and may not be enabled for your organization yet. Without them, every variable is org-wide and members can edit org variables that are not admin-only.

## Add a variable

1. Open **Integrations → Nori Integrations → Custom environment variables**.
2. Under **Who gets it**, pick **Org**, **Personal**, or **Agent** (then choose the agent).
3. Enter the **Variable name** and **Value**.
4. For org variables, admins can tick **Admin only**.
5. Choose **Add variable**.

Saved values are masked and can’t be revealed in the dashboard. **Remove** deletes a variable.

From the CLI:

```sh
nori-sessions integrations set-custom --key MY_API_KEY --value-file ./key.txt
nori-sessions integrations set-custom --key MY_API_KEY --value-file ./key.txt \
  --scope personal
nori-sessions integrations set-custom --key DEPLOY_TOKEN --value-file ./token \
  --scope agent --agent marlin
```

| Command                                                                  | What it does                                                                    |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| `integrations set-custom --key <k> (--value <v> \| --value-file <path>)` | Add or replace a variable. `--value-file` keeps the secret out of shell history |
| `integrations list-custom [--all-scopes]`                                | List variables. Values are masked                                               |
| `integrations delete-custom --key <k>`                                   | Remove a variable. Add `--owner <email>` to delete someone’s personal entry     |
| `integrations update-custom --key <k> --admin-only true\|false`          | Change whether an org variable is admin-only                                    |

All take `--scope org|personal|agent` (default `org`) and `--agent <handle>`.

## Admin-only variables

An **Admin only** variable reaches only sessions started by an admin. Use it for credentials members should not be able to use, such as production keys. Admin-only applies to org variables only.

## How sessions receive them

- Saving, removing, or changing a variable pushes the new set to running session machines. You don’t need to restart the fleet.
- New shells and restarted agents see the change. A process that was already running keeps its old environment. Ask the agent to open a new shell, or use `!restart`.
- When the same name exists in several scopes, the most specific wins: agent, then personal, then org.
- Automations have no starter, so they never get personal variables.
- A custom agent with an integration list gets only the org variables on that list.

## Naming rules

- Use uppercase letters, digits, and `_`, not starting with a digit.
- Some names are reserved because Nori sets them, for example `ANTHROPIC_API_KEY`, `GITHUB_TOKEN`, `GH_TOKEN`, `SLACK_BOT_TOKEN`, the AWS credential variables, `PATH`, and `HOME`. Use a prefixed name such as `MY_GITHUB_TOKEN` instead.

## Hand a secret to a session

Don’t paste secrets into chat. Chat messages are stored in the transcript.

- **To keep it:** add it as a custom environment variable above.
- **For this session only:** ask the agent for a secure upload form. The agent serves a one-time form on the session machine, behind the session login, and reads the value from a private file. The secret stays on that machine.

### Credential requests

When credentials are scoped per conversation, an agent can ask for a named credential it doesn’t hold. In web chat, a card titled **Credentials:** and the requested names appears in the turn that asked; Slack, Discord, and the CLI get an approval link. **Open** (or the link) goes to the **Credential request** page, which shows the names requested, the agent’s reason, and who can approve each. Choose **Approve selected** or **Decline**.

A grant stays with the conversation, across machines, until the org’s credential grant lifetime ends or someone chooses **End** on it in the chat side panel’s **Credentials** tab (see [web chat](https://docs.noriagentic.com/sessions/guides/web-chat/#which-credentials-does-this-conversation-use)). Everyone directing the conversation can read a credential you give while the grant lasts. The reason is written by the agent and may be wrong.

Availability: this feature is being rolled out and may not be enabled for your organization yet.

## Common questions

**I saved a variable but the agent can’t see it.** Its shell started before the save. Ask it to run `source ~/.nori/env.d/*.sh` or open a new shell.

**Can members see the values?** No. Values are masked in the dashboard and CLI. They are readable on the machines of sessions that receive them.

**Does an automation get my personal variables?** No. Use an org or agent variable for automations.

**Why was my variable name rejected?** It uses lowercase or other characters, starts with a digit, or is reserved. For a reserved name, the error suggests a prefixed alternative.
