Agent Sessions is in private preview. The feature is enabled per workspace by the Orq.ai team and the API is not part of the public SDKs yet.
Use cases
- Exchange the session token for temporary cloud credentials without storing a cloud access key in Orq.ai.
- Restrict a relying party to one workspace, Factory, repository, agent, or isolation tier.
Overview
Session identity gives each session an RS256-signed OIDC token. The token identifies the workspace, Factory, session, repository, requester, agent, and isolation tier. A relying party validates the token against the Orq.ai federation issuer, then applies its own access policy. Session identity uses the same SSO entitlement as workload federation and is disabled by default.Enable session identity
Open Managed Agents > Factories, select a Factory, then open Configuration > Governance. Turn on Enable session identity tokens and enter one audience per line. The same setting is available through the private Factories API:Configuration
An empty audience list uses
orq-agent-sessions. Set a provider-specific or Factory-specific audience when the relying party requires a narrower trust boundary.
Claims
The token lifetime is one hour. Trust policies should match stable claims such as
workspace_id, factory_id, and the sub prefix instead of one session id.
AWS IAM
Create an IAM OIDC provider for the Orq.ai federation issuer and register a distinct client ID such asorq-factory-<factory_id> for each trusted Factory. Add that value to the Factory audiences. Replace the issuer condition-key prefix with the issuer URL without https://.
AWS STS exposes standard OIDC claims such as aud and sub as IAM condition keys but ignores arbitrary custom claims. The JWT factory_id claim cannot be used directly in an IAM trust policy. A distinct audience per Factory provides the factory boundary instead.
JSON
initialize commands then inherit short-lived credentials from the session token.
Google Cloud Workload Identity Federation
Create an OIDC provider in a Workload Identity Pool. The default Factory audience works when the provider allowsorq-agent-sessions.
HashiCorp Vault
Configure the JWT auth method with the federation discovery URL, then bind a role to the session subject and Factory claim.Generic JWKS verification
Read the issuer discovery document from$ORQ_FEDERATION_ISSUER/.well-known/openid-configuration. Use its jwks_uri, select the public key matching the JWT kid, require RS256, and validate iss, aud, exp, nbf, and sub. Apply authorization checks to the custom claims after signature validation.
TypeScript
Token delivery and rotation
The runtime writes the JWT to/run/orq/identity-token with mode 0600 and exports ORQ_IDENTITY_TOKEN_FILE to every supported agent process. The token is minted when the computer becomes ready, at run start, and after resume. Ready and running sessions receive a replacement at half of the one-hour lifetime.
Pausing removes the computer and its ephemeral /run/orq volume. Resuming creates a new computer and pushes a fresh token. Sessions in a Factory with identity disabled do not receive the file. Turning identity off clears an existing file at the next credential push or scheduled refresh; an already issued JWT remains valid until expiry unless the relying party removes its trust. Orq.ai does not write the JWT to MongoDB, the pod specification, logs, or session events. Only expiry and refresh scheduling metadata are stored; session.identity_issued records the key id, expiry, and audiences.
The provider recipes describe the required configuration. Live AWS and Google Cloud token exchanges are not part of the local Agent Sessions verification.