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

# Cloud access with session OIDC tokens

Nori can act as an OpenID Connect (OIDC) identity provider for your sessions. A session asks Nori for a short-lived signed token and trades it with your cloud for temporary credentials, through the cloud’s workload identity federation. You do not store a long-lived cloud key in Nori.

Typical use: a nightly automation that scans a GCP project or an AWS account, with access granted only to that automation.

Availability: this feature is enabled per organization and may not be on for yours yet. While it is off, Nori publishes no issuer and refuses token requests. It works on hosted Nori only, because your cloud must reach the issuer over the public internet.

## How it works

- **Issuer**: your organization’s dashboard URL, such as `https://<org>.norisessions.com`. Nori serves the standard `/.well-known/openid-configuration` and `/.well-known/jwks.json` there.
- **Token**: an RS256-signed JWT that lives 15 minutes, for one audience.
- **Who can get one**: only a running session machine. People and outside callers cannot request tokens.
- **Claims**: Nori sets every claim from its own record of the session. The session chooses only the audience and which claims form the subject.

## Token claims

| Claim                                         | Value                                                                                                                              |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `org_id`, `account_id`                        | your organization’s ID                                                                                                             |
| `session_id`                                  | the conversation’s ID                                                                                                              |
| `trigger`                                     | how the session started: `webapp`, `automation`, `project`, `subworker`, or the surface name, such as `slack`, `cli`, or `discord` |
| `requesting_user_id`, `requesting_user_email` | the org member who started the session; left out when no member did (for example, an automation or a Slack guest)                  |
| `service_user_id`                             | the organization’s service identity, when it started the session                                                                   |
| `automation_id`                               | the automation’s ID, for automation runs only                                                                                      |
| `environment_id`                              | the [custom agent](https://docs.noriagentic.com/sessions/guides/custom-agents/) the session runs as                                |

The token also has `iss`, `aud`, `sub`, `jti`, `iat`, `nbf`, and `exp`.

**Subject.** `sub` is built from the claims you choose with `--subject-keys` (default `org_id`): each becomes `key:value`, joined by `:` in the order given. The default is `org_id:<org>`. With `--subject-keys trigger,automation_id` it is `trigger:automation:automation_id:<id>`. A key the session lacks, such as `automation_id` in a web chat, is refused.

## Scope your trust conditions

The default subject is the same for every session in your organization. A cloud role that checks only it admits any session, including any chat a member starts. To limit a role to one automation, require both `trigger == 'automation'` and its `automation_id`, either in the cloud’s attribute conditions or in the subject with `--subject-keys`.

`environment_id` alone is weak: anyone who can start a chat with that custom agent matches it. A person who replies in an automation’s conversation runs under that automation’s claims.

Find an automation’s ID with `nori-sessions triggers list`.

## Set up a cloud

Each setup has two halves: trust the Nori issuer in your cloud, then run a `nori-sessions oidc setup-*` command in the session. Put the command in the org setup script (**Settings → Environment → Setup script & tools**) so every machine has it. It writes files under `~/.nori/`; new shells pick them up, and in the current shell `source` the env file it prints.

### Google Cloud

Create a workload identity pool and an OIDC provider whose issuer is your dashboard URL:

```bash
gcloud iam workload-identity-pools create nori --location=global
gcloud iam workload-identity-pools providers create-oidc nori \
  --location=global --workload-identity-pool=nori \
  --issuer-uri=https://<org>.norisessions.com \
  --attribute-mapping="google.subject=assertion.sub,attribute.automation_id=assertion.automation_id" \
  --attribute-condition="assertion.org_id == '<org>' && assertion.trigger == 'automation' && assertion.automation_id == '<automation-id>'"
```

Grant `roles/iam.workloadIdentityUser` on the service account to the pool principal. Then, in the session:

```bash
nori-sessions oidc setup-gcp \
  --workload-identity-provider projects/<number>/locations/global/workloadIdentityPools/nori/providers/nori \
  --service-account <sa>@<project>.iam.gserviceaccount.com \
  --project <project>
```

`gcloud` and Google client libraries then fetch fresh tokens on their own. Omit `--service-account` to use the federated identity directly. The audience defaults to `https://iam.googleapis.com/<provider>`. Google limits `google.subject` to 127 bytes, so map extra claims to `attribute.*` rather than putting many keys in the subject.

### AWS

1. In IAM, add an OpenID Connect identity provider with the provider URL `https://<org>.norisessions.com` and audience `sts.amazonaws.com`.
2. Create a role whose trust policy allows `sts:AssumeRoleWithWebIdentity` from that provider, with conditions on `<org>.norisessions.com:aud` and `<org>.norisessions.com:sub`.
3. In the session:

```bash
nori-sessions oidc setup-aws --role-arn arn:aws:iam::<account>:role/<role> \
  --region us-east-1
```

This configures an AWS profile (default `default`; pick one with `--profile`) whose credentials come from fresh session tokens. Other options: `--audience`, `--subject-keys`, `--session-name`, `--duration-seconds`, `--sts-endpoint`, and `--set-default-profile`. Static keys (`AWS_ACCESS_KEY_ID` or `~/.aws/credentials`) take precedence, so remove them from the session.

### HashiCorp Vault

Enable a JWT auth method with `oidc_discovery_url=https://<org>.norisessions.com` and a role with `bound_audiences` and `bound_subject` or `bound_claims`. Then:

```bash
nori-sessions oidc setup-vault --vault-addr https://vault.example.com --role <role>
```

Options: `--auth-mount` (default `jwt`), `--audience` (default the Vault address), `--subject-keys`, and `--vault-namespace`. A `VAULT_TOKEN` environment variable overrides this setup.

### JFrog

Add an OIDC integration in the JFrog Platform whose provider URL is your dashboard URL, with an identity mapping on the claims. Then:

```bash
nori-sessions oidc setup-jfrog --jfrog-url https://example.jfrog.io --provider-name <name>
```

It wraps the `jf` CLI, which must already be installed, so every `jf` command signs in with a fresh token.

### Your own service

Print a token and send it to any service that verifies OIDC tokens against your issuer’s JWKS:

```bash
nori-sessions oidc token --audience https://api.example.com \
  --subject-keys trigger,automation_id
nori-sessions oidc print-general-token
```

`token` prints `{token, expiresAt}`. `print-general-token` uses the issuer itself as the audience.

## Common questions

**Do I store any cloud secret in Nori?** No. The cloud trusts Nori’s public signing keys, and each token lives 15 minutes.

**Can a token copied out of a session be reused later?** Each token expires after 15 minutes. A machine’s right to request tokens ends with its session, so a reused machine cannot mint tokens with a previous session’s claims.

**Why does my cloud say the issuer can’t be found?** The feature is not on for your organization, or you are on a self-hosted or BYOC deployment, which is not supported.

**Why was my token request refused with a subject error?** A `--subject-keys` claim is missing for this session, such as `automation_id` outside an automation run.
