Skip to main content
A session is a time-bound grant in an Agent Vault project, and it works only through a proxy in that project. It’s scoped to the services you give it when you create it. Infisical returns a session token that identifies the session, and the agent uses that token to authenticate to the proxy on every outbound request. The proxy then attaches the real credential from the matching service before it forwards the request. A session also gives the agent skills: its access bundle’s, skills in the project that you pick, and skills you send with the session. The CLI installs them when the agent starts. You choose how long a session lasts when you create it. After the session expires, or after you revoke it, the proxy stops attaching credentials to the agent’s requests within one poll interval.

Create a session

Create a session and start an agent with its token.

Revoke a session

End a session before it expires so its agent stops getting credentials.

Sessions on behalf of users

Let a machine identity create sessions on behalf of users, so each session uses the personal values of the user it’s for.

Inline services

Services and credentials that you configure when you create a session.

Session statuses

The Sessions page shows each session as Active, Revoked, or Expired. It keeps expired and revoked sessions, so you can still see the access an agent had during each session:
The Sessions page listing active, revoked, and expired sessions with their label, identity, access bundle, creation time, and expiry, including a release-bot session on behalf of a user and a session with an inline service

Label a session and add metadata

A label is a short description of what a session is for, such as nightly deploy or support ticket triage. If one identity creates many sessions, you can use the labels to tell the sessions apart on the Sessions page and to search for them. A label can be up to 128 characters, and can’t contain line breaks, tabs, or invisible characters such as zero-width spaces. Metadata is a set of keys and values that record which run a session belongs to, such as the run ID, the ticket, or the user or Slack channel the agent works for. A session can have up to 20 metadata keys. A key can be up to 255 characters and a value up to 1020, and neither can contain line breaks, tabs, or invisible characters. A value can’t be empty, and a key can’t contain =. To add a label and metadata when you create a session:
In the Create Session dialog, on the Create Now tab, enter a Label. To add metadata, select Add Metadata, then enter a key and a value. Select Add Metadata again for each other key.
You can change a session’s label and metadata later, even after the session expires or is revoked:
  • In your Agent Vault project, go to Sessions, open the session’s menu, and select Edit Session
  • From an agent or a script, call the Update session endpoint, for example to record what the agent is working on (if you send metadata, it replaces all of the session’s metadata)
The Sessions page with the menu of the Nightly deploy session open, showing View Session Logs, Edit Label, and Revoke Session
To find the sessions of a run, list sessions by metadata with the List sessions endpoint or an SDK. A session is listed only if it matches every key and value you pass:

View session logs

Session logs record every request an agent makes during a session. To view them, go to Sessions in your Agent Vault project and select View Session Logs on the session’s row. You can filter and search the requests, and while the session is active, new logs keep appearing.
The Session Logs sheet for the Review PR #1486 session, listing each request's time, method, host, path, upstream status, and outcome: brokered requests to GitHub, Anthropic, and Slack, a DELETE blocked by the service's method rules, and requests to registry.npmjs.org and pastebin.com blocked by the proxy's traffic policy

Access changes

You choose a session’s services and skills when you create it, and you can’t change them afterwards. However, the proxy checks each session’s access again once every poll interval (60 seconds by default). Here’s how common access changes affect a session:
  • If someone no longer has any grant on an access bundle, directly or through a group, their sessions for that bundle stop getting credentials
  • If someone still has another grant on the bundle, such as through a group, revoking one grant doesn’t affect their sessions
  • If you delete an access bundle, every session scoped to it stops getting credentials (the session still lists the bundle’s name)
  • If you remove a service from an access bundle, the bundle’s sessions stop getting that service’s credential
  • If you delete a service, every session that uses it stops getting the service’s credential
  • If someone loses access to a service they picked for a session, the session stops getting that service’s credential
  • If you remove someone from the project, the proxy refuses every request on their sessions
  • If the user or machine identity that created a session loses the Admin role in the project, the session stops getting credentials for its inline services
  • If someone loses access to a skill they picked for a session, agents that start with the session afterwards don’t get the skill
  • If you delete a skill, agents that start afterwards don’t get it
None of these changes removes the skills that the CLI already installed on the agent’s host. To stop agents from using those skills, delete the installed copies.
If a session stops getting credentials because of a lost grant, a deleted bundle, or a lost Admin role, the proxy still forwards the agent’s requests, without credentials. The proxy’s traffic policy sets which hosts those requests can still reach.

Audit trail

When you create a session, change its label, or revoke it, Infisical writes an audit event. To review these events, open Audit Logs in your Agent Vault project, or scope an audit log stream to the Agent Vault product. Audit events record changes in Infisical, not the agent’s requests. To see the requests an agent made while its session was running, view its session logs.