How it worksSessions and trust

Updated 27 Oct 2026View as Markdown

Sessions and trust

A session lets a signed-in user of your app talk to one agent from your page, while your org API key stays on your server.

See it running: Plain HTML counter, Conversation list

MCP serverSDK and APIYour own cloud:AWSGCPAzureor hosted by MindsetMindset platformAgentScriptVersionRunConnectionOperationFunctionWidgetSecurity and complianceone posture · audit trail · personal data redactionBuilderscoding agentOperatorsAI clientor the StudioYour appthe SDKYour serverthe APIThe Huband schedulesBuilderscoding agentOperatorsAI client or the StudioMCP serverYour own cloud:AWSGCPAzureor hosted by MindsetMindset platformAgentScriptFunctionConnectionOperationWidgetVersionRunSecurity and complianceone posture for the org,audit trail and personal data redactionSDK and APIYour appthe SDKYour serverthe APIThe Huband schedules

Your server creates a session so a signed-in user of your app can talk to one agent from your page. It calls Mindset with your org API key and passes the response to the browser, where the SDK uses it.

WhereWhat it holds
Your serverThe org API key. It is admin-grade and never reaches a browser
The browserThe session: an opaque credential for one agent, one user, one org and one environment, kept in memory

The key is the authorization, so the agent needn't be shared with the user in the Hub. It does need Embedded in your own product ticked and an active version. See How agents are started and reached.

Why it matters#

Your users talk to the agent without a Mindset account, and the API key never leaves your server. A session is limited to one agent, one user and one environment, so one taken from a browser reaches nothing else.

How long it lasts#

While the page is open, the SDK renews its own short-lived access token, so you write no renewal code.

EventWhat happens
Not used within about 20 minutes of creationThe session expires
Idle for 7 daysThe session ends
30 days after creationThe session ends, however active it is
The page reloadsThe session is gone, because the SDK keeps it only in memory

When the SDK can't continue, it calls your page's getSession function again for a new session. A new agent version reaches the user on their next turn, but the agent's connections, widgets and functions are fixed for the life of the session.

Who the agent thinks the user is#

Mindset takes your server's word for who the user is, and creating a session finds or creates that user in your org. Your server names them one of two ways:

emailexternalId
Use it whenThe person might also use Mindset directlyYour users exist only in your app, or you'd rather Mindset didn't hold their email
MatchingCase-insensitive. One email is one person in your org, however they arriveExact, case included. It never merges with an email identity
Signing in to MindsetThe same user as their Mindset sign-in, if they have oneNever signs in to Mindset

Mindset doesn't check that an email's mailbox exists. Pick one form per user and keep it: switching gives you two users with two histories.

What the user can reach#

A session reaches only what the agent's run needs, such as model calls, tool calls and this user's conversations with the agent. It is refused on every management surface, even for an org admin. Two agents on one page need two sessions.

Access ends from the user's next turn when you untick Embedded in your own product, turn off the agent's Available switch, or remove the user from your org.

Keep secrets on your server#

A session works from any page that holds it, so treat it like a short-lived password for that user. Its contents change between releases, so don't decode, rebuild or store it.

Everything your page gives the agent lives in the browser, where the user and every script on the page can read it. That includes page tools, situational awareness and pass-through values.

Without a backend#

The element can sign a visitor in with Google for the same kind of session. That needs the website in the environment's Allowed websites list (Settings → Environments), self-signup on for your org, and the agent ticked for both The Hub and Embedded in your own product.

For the code, see Put an agent on your page and the Session API. To start an agent from your backend with no browser, see Start it from your server or a schedule.