AI agents

Keep signed-in pages for signed-in visitors

Generate a session secret so agents get the screens and actions that need sign-in only for a visitor who is signed in to your site.

By default, agents get every screen and action Flamio knows about your site, whether the visitor is signed in or not. With a session secret, agents get the parts that need sign-in only for a signed-in visitor, and ask a signed-out visitor to sign in.

Needs two packages in beta

Your page hands the signed session to the Flamio agent panel. The panel needs web SDK 0.11.0 and the @flamioai/agent-panel package, both in beta. Without them on your pages, your site cannot pass a signed session to Flamio, so a secret keeps the signed-in parts from every agent.

Before you begin

Turn on signed-in sessions

Find Signed-in visitors

Open AI agents, click Agents in the left rail and find Signed-in visitors. Its pill reads Off.

Generate the secret

Click Generate secret and copy the secret shown. Flamio shows it once — "Copy this secret now — Flamio won’t show it again."

Sign sessions on your backend

Store the secret on your backend. For a signed-in visitor, your backend signs a JWT with it — HS256, aud: "flamio-panel", expiring within 15 minutes — and your page passes it to agentPanel.session in Flamio.init.

Treat the secret like a password

Keep the secret on your backend only. Never put it in page code, a repository or a log. Anyone with it can sign sessions for your site.

Result

The pill reads On: "agents get screens and operations that need sign-in only with a session your site signed". On Activity, the Signed in card shows the share of agent calls made while the visitor was signed in.

Replace the secret

  1. On Signed-in visitors, click Rotate secret.
  2. In Rotate the session secret?, click Rotate secret and copy the new secret.
  3. Put the new secret on your backend right away. Sessions signed with the old secret stop working at once.