Athena AssistantDeveloper documentation

Athena Assistant: Integration Guide

For: developers adding the Athena Assistant to an application (for example Oven, Metlone or Tenax).

Time: about half a day. Most of it goes into the token endpoint (step 5).

You will follow seven steps: accept your invite, get your application, create a signing key, set up the application, add a token endpoint to your backend, add the assistant to your pages, then test and go live.

Using .NET and Angular? Complete, copy-ready code is in step 5: .NET (ASP.NET Core) and step 6: Angular.


Overview

The Athena Assistant lets your users ask questions about your application's data in plain English, such as "What were total sales by item last week?". It answers with text, a sortable table, a chart and the SQL that ran.

You add one script to your pages. It shows a chat button in the bottom-right corner; clicking it opens the assistant in a side panel (full screen on phones). Users don't sign in again: your application tells Athena who they are.

How it works

 Your application page                         Athena                              Your database
┌──────────────────────────┐            ┌──────────────────────────┐         ┌──────────────────┐
│ embed.js (chat button +  │  iframe    │ Athena UI                │         │                  │
│ side panel)              │───────────►│                          │         │                  │
│                          │            │                          │         │                  │
│ getToken() ──► your      │  token via │ sends the question +     │  SQL    │  read-only user  │
│ backend signs a 5-minute │ postMessage│ token to the Athena      │────────►│  your tables     │
│ token for the user       │───────────►│ backend, which checks    │ (read   │  only            │
└──────────────────────────┘            │ the token, writes and    │  only)  │                  │
                                        │ checks the SQL           │         └──────────────────┘
                                        └──────────────────────────┘
  1. The user clicks the chat button. Athena opens inside your page.
  2. Athena asks your page for a token that says who the user is. Your page gets it from your own backend, which signs it.
  3. Athena checks the token, writes a SQL query using only the tables registered for your application, adds your row filters, runs it read-only on your database and shows the answer.

Your application only talks to two things: the Athena address https://qaathena.chatbot.thekosmoz.com (for the script) and your own backend (for tokens). It never calls the Athena backend directly.

Who does what

Athena admin teamYour team
Creates your application: App ID, name and the database connection, and invites you by email (step 1)Opens the invite link and creates an account (step 1); provides a read-only database user (step 2)
Can turn any application offCreates a signing key, sets up the application, adds the code, tests and goes live (steps 3–7)

Before you start

Have these ready:

You needExampleWhy
A read-only database user, able to read only the tables the assistant should useathena_roAthena only reads; a read-only user guarantees it (see step 2)
The tables and columns users may ask about, with a one-line description eachorders: one row per orderAthena never sees tables you don't list
Roles, if some tables are only for some usersorders → managerMatches the roles you put in each user's token
Row filters, if users may only see their own rowsrestaurant_id = :restaurant_idAdded to every query, from the user's token
Your application's web address(es)https://app.oven.comOnly these pages can show the assistant
A backend where you can add one endpointNode.js, .NET, Python, …It signs the tokens (step 5)

Step 1: Accept your invite

Athena is invite only. The Athena admin team creates your application and sends you an invite link on Teams or by email, for example https://qaathena.chatbot.thekosmoz.com/invite/Xk9f....

  1. Open the link. It shows the application you're invited to and your work email.
  2. New to Athena: enter your name, team and a password (at least 12 characters), then click Create account and continue. Already have an account: enter your password and click Sign in and continue.
  3. You land in the Athena portal, with the application under Your applications as Not set up.

The link works once, only for your email, and expires after 7 days. If it has expired or was lost, ask the admin team for a new one. Next time, just Sign in with your work email.

No invite yet? Ask the Athena admin team. Tell them the application's name, the websites that will show the assistant and where its database runs. Never put passwords or connection strings in a chat or email. The admin team asks for database credentials through a secure channel.


Step 2: Get your application

The admin team has already created your application with its App ID (e.g. oven) and the database connection, and invited you to it (step 1). What they need from your side is a read-only database user.

For your database administrator: the read-only user can be created like this (PostgreSQL; grant only the tables the assistant needs):

CREATE USER athena_ro WITH PASSWORD '<strong password>';
GRANT CONNECT ON DATABASE <your_database> TO athena_ro;
GRANT USAGE ON SCHEMA public TO athena_ro;
GRANT SELECT ON orders, products, restaurants TO athena_ro;

Step 3: Create a signing key

Your backend signs each user's token with a private key. Athena checks the signature with the matching public key, so it can trust the token but can never create one.

Usually the Athena admin team (SRE) does this for you when they create your application: they click Generate key pair, store the private key straight in your application's secret store, and register the public key. You then see, in the portal under Your applications:

  • Private key: where it is stored, e.g. Key Vault kv-qa / oven-athena-private-key
  • Settings for your backend: the values to put in your configuration (step 5), ready to copy

In that case skip to step 4: you never handle the key yourself. The steps below are for the admin team, or for teams that manage their own keys.

Create one key pair per environment (QA, production, …). A key from one environment must never work in another.

3.1 Generate the key pair

In the admin screen: in New app for a developer, choose Sign-in: The admin team, now, click Generate key pair, store the private key it shows (3.2), tick I have stored the private key, and fill in Where the private key is stored. The key is made in the browser and never sent to Athena.

Or with openssl, on a trusted admin machine or in Azure Cloud Shell (not a shared server, never inside your repository), for each environment:

# QA
openssl ecparam -name prime256v1 -genkey -noout -out oven-qa-private.pem
openssl ec -in oven-qa-private.pem -pubout -out oven-qa-public.pem

# Production
openssl ecparam -name prime256v1 -genkey -noout -out oven-prod-private.pem
openssl ec -in oven-prod-private.pem -pubout -out oven-prod-public.pem

prime256v1 is the curve for ES256, the algorithm you choose in step 4.

FileWhat it isWhere it goes
…-private.pemSigns tokens. Secret.Only your backend's secret store (3.2)
…-public.pemChecks tokens. Not secret.Pasted into the portal (step 4)

3.2 Store the private key in your secret store

Azure Key Vault (recommended), one vault per environment:

# QA
az keyvault secret set --vault-name <qa-vault>   --name oven-athena-private-key --file oven-qa-private.pem

# Production
az keyvault secret set --vault-name <prod-vault>   --name oven-athena-private-key --file oven-prod-private.pem

Or a Kubernetes secret, in your application's namespace for each environment:

# QA
kubectl -n <your-namespace-qa> create secret generic oven-athena-key   --from-file=private.pem=oven-qa-private.pem

# Production
kubectl -n <your-namespace-prod> create secret generic oven-athena-key   --from-file=private.pem=oven-prod-private.pem

3.3 Give the key to your backend

Your backend reads the key as the setting ATHENA_PRIVATE_KEY (the PEM text) or from a file path. For example, in your Kubernetes deployment:

env:
  - name: ATHENA_PRIVATE_KEY
    valueFrom:
      secretKeyRef: { name: oven-athena-key, key: private.pem }

With Key Vault, use your platform's Key Vault reference (App Service setting @Microsoft.KeyVault(...), the Key Vault CSI driver on Kubernetes, or the Key Vault SDK at start-up).

3.4 Delete the local private key files

rm oven-qa-private.pem oven-prod-private.pem

Keep the public files for step 4. The private keys now exist only in the secret stores.

Rules for signing keys

RuleWhy
A different key pair for each environmentA leaked QA key can't create production tokens
The private key only in Key Vault or a Kubernetes secretNever in git, Docker images, logs, chat or email
Only the public key goes to AthenaAthena can check tokens but never create them
Rotate at least yearly, and at once after a suspected leakSee Rotating the signing key below

For the highest protection in production, create the key inside Azure Key Vault (an EC P-256 key) so the private key never leaves the vault, and sign tokens through Key Vault's sign operation. This needs a small change to your token code; the steps above are the standard setup and are fine for most applications.


Step 4: Set up your application

In the portal, open Your applications, click Set up next to your application and fill in:

SectionFieldWhat to enter
ApplicationAllowed websitesYour exact web address(es), one per line, with no path: https://app.oven.com. For testing you can add http://localhost:4200 and remove it later.
DataBusiness contextPlain-English rules, for example "Amounts are in INR. Only orders with status 'completed' count as sales."
DataTablesEach table, a short description and its columns. Put a role on tables only some users may see, e.g. manager.
Who sees whatRow filtersOne per line, table: condition, e.g. orders: restaurant_id = :restaurant_id. The :restaurant_id value comes from the user's token.
Who sees whatRestricted columnsOptional: table.column: roles, e.g. employees.salary: hr_admin.
Sign-in(all fields)If the admin team set up sign-in, this section is read-only: nothing to do. Otherwise:
Sign-inHow the app signs tokensPublic key (app keeps the private key)
Sign-inPublic key (PEM)The whole content of this environment's public key file (e.g. oven-qa-public.pem in QA), including the BEGIN and END lines
Sign-inAlgorithmES256
Sign-inIssuerA name for your backend, e.g. oven-app
AssistantWelcome text, suggested questionsWhat users see when they open the chat

Click Save settings. Athena checks every table and column against your database, so typing mistakes are caught here. Don't click Go live yet.

Note these values for step 5:

ValueExample
App IDoven
Issueroven-app
Audiencegritstone-athena-chatbot (the same for every application)

Using your company sign-in (Azure AD, Okta, Keycloak)? Choose Company sign-in / SSO and enter its JWKS URL instead; its tokens must include app_id and roles. A Shared secret is for quick local tests only and is refused in QA and production.


Step 5: Add a token endpoint to your backend

Add one endpoint, for example GET /api/chatbot-token. It must:

  1. Work only for signed-in users (your normal login or session).
  2. Return { "token": "<token>" }, signed with private.pem using ES256.
  3. Make each token valid for 5 minutes. Athena rejects tokens valid for more than 15 minutes.
  4. Send Cache-Control: no-store.

Keep the settings in configuration, not in code. Copy them from Settings for your backend under Your applications in the portal:

ATHENA_APP_ID=oven
ATHENA_ISSUER=oven-app
ATHENA_AUDIENCE=gritstone-athena-chatbot
ATHENA_PRIVATE_KEY=<the private key, from your secret store (step 3.3)>

What goes in the token

ClaimValue
subThe user's ID in your application
app_idYour App ID, e.g. "oven"
rolesThe user's roles, e.g. ["manager"]. They decide which tables the user may query.
issYour Issuer, e.g. "oven-app"
aud"gritstone-athena-chatbot"
expNow + 5 minutes
Row-filter valuesEvery value your row filters use, e.g. restaurant_id: 101. A token without it is refused, so no query ever runs unfiltered.
nameOptional: the user's display name

Example: Node.js (Express)

import jwt from "jsonwebtoken";

app.get("/api/chatbot-token", requireLogin, (req, res) => {    // requireLogin: your normal login check
  const token = jwt.sign(
    {
      sub: String(req.user.id),
      name: req.user.name,
      app_id: process.env.ATHENA_APP_ID,
      roles: req.user.roles,                  // e.g. ["manager"]
      restaurant_id: req.user.restaurantId,   // only if your app has row filters
    },
    process.env.ATHENA_PRIVATE_KEY,
    { algorithm: "ES256", issuer: process.env.ATHENA_ISSUER, audience: process.env.ATHENA_AUDIENCE, expiresIn: "5m" },
  );
  res.set("Cache-Control", "no-store").json({ token });
});

Example: .NET (ASP.NET Core)

1. Add the package

dotnet add package System.IdentityModel.Tokens.Jwt

2. Add the settings to appsettings.json (one file per environment, e.g. appsettings.QA.json). No secrets here: the private key comes from the secret store.

"Athena": {
  "AppId": "oven",
  "Issuer": "oven-app",
  "Audience": "gritstone-athena-chatbot"
}

3. Give the private key to the app as the setting Athena:PrivateKey:

Where the key is storedHow it reaches Athena:PrivateKey
Kubernetes secretEnvironment variable Athena__PrivateKey (two underscores), see below
Azure Key Vault + AddAzureKeyVaultSecret named Athena--PrivateKey (two dashes)
Azure App ServiceApp setting Athena__PrivateKey = @Microsoft.KeyVault(SecretUri=...)
env:
  - name: Athena__PrivateKey
    valueFrom:
      secretKeyRef: { name: oven-athena-key, key: private.pem }

4. Add the endpoint: Controllers/ChatbotTokenController.cs

using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Cryptography;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;

[ApiController]
[Route("api/chatbot-token")]
[Authorize]                       // only signed-in users get a token
public class ChatbotTokenController : ControllerBase
{
    private readonly IConfiguration _config;
    public ChatbotTokenController(IConfiguration config) => _config = config;

    [HttpGet]
    [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
    public IActionResult Get()
    {
        var athena = _config.GetSection("Athena");

        // The PEM text; "\\n" is accepted too, for secrets stored on one line.
        using var ecdsa = ECDsa.Create();
        ecdsa.ImportFromPem(athena["PrivateKey"]!.Replace("\\n", "\n"));
        var creds = new SigningCredentials(
            new ECDsaSecurityKey(ecdsa), SecurityAlgorithms.EcdsaSha256);   // ES256

        var claims = new List<Claim>
        {
            new("sub", User.FindFirstValue(ClaimTypes.NameIdentifier)!),
            new("name", User.Identity?.Name ?? ""),
            new("app_id", athena["AppId"]!),
        };
        // Roles decide which tables the user may query.
        claims.AddRange(User.FindAll(ClaimTypes.Role)
            .Select(r => new Claim("roles", r.Value)));

        // Only if your application has row filters, e.g. restaurant_id:
        // claims.Add(new Claim("restaurant_id",
        //     User.FindFirstValue("restaurant_id")!, ClaimValueTypes.Integer));

        var jwt = new JwtSecurityToken(
            issuer: athena["Issuer"],
            audience: athena["Audience"],
            claims: claims,
            notBefore: DateTime.UtcNow,
            expires: DateTime.UtcNow.AddMinutes(5),
            signingCredentials: creds);

        return Ok(new { token = new JwtSecurityTokenHandler().WriteToken(jwt) });
    }
}

Using minimal APIs instead of controllers? Put the same body in app.MapGet("/api/chatbot-token", (ClaimsPrincipal User, IConfiguration _config) => { ... }).RequireAuthorization();.

Example: Python (Flask)

import os, time, jwt
from flask import jsonify
from flask_login import login_required, current_user

@app.get("/api/chatbot-token")
@login_required
def chatbot_token():
    now = int(time.time())
    token = jwt.encode({
        "sub": str(current_user.id), "app_id": os.environ["ATHENA_APP_ID"], "roles": current_user.roles,
        "iss": os.environ["ATHENA_ISSUER"], "aud": os.environ["ATHENA_AUDIENCE"], "iat": now, "exp": now + 300,
    }, os.environ["ATHENA_PRIVATE_KEY"], algorithm="ES256")
    return jsonify(token=token), 200, {"Cache-Control": "no-store"}

Check: open /api/chatbot-token in your browser while signed in. You should see {"token":"eyJ..."}. Signed out, it must refuse (for example 401).


Step 6: Add the assistant to your pages

1. Load the script in your main layout:

<script src="https://qaathena.chatbot.thekosmoz.com/embed.js" defer></script>
<script src="/js/athena-chat.js" defer></script>

2. Start it from your own JavaScript file (/js/athena-chat.js), on pages where the user is signed in:

window.addEventListener("load", () => {
  AthenaChat.init({
    appId: "oven",
    getToken: async () => {
      const r = await fetch("/api/chatbot-token", { credentials: "include" });
      if (!r.ok) throw new Error(`token endpoint returned ${r.status}`);
      return (await r.json()).token;
    },
  });
});

Use a file rather than an inline <script> block: sites with a strict Content Security Policy block inline scripts, and the assistant would silently never start.

3. On logout, remove it so the next user starts fresh:

AthenaChat.destroy();

4. If your site has a Content Security Policy, allow Athena's script and panel:

script-src 'self' https://qaathena.chatbot.thekosmoz.com;
frame-src https://qaathena.chatbot.thekosmoz.com;

A chat button now appears in the bottom-right corner. To open it from your own button, call AthenaChat.open().

React

useEffect(() => {
  const s = document.createElement("script");
  s.src = "https://qaathena.chatbot.thekosmoz.com/embed.js";
  s.onload = () => window.AthenaChat.init({
    appId: "oven",
    getToken: () => fetch("/api/chatbot-token").then((r) => r.json()).then((r) => r.token),
  });
  document.body.appendChild(s);
  return () => window.AthenaChat?.destroy();
}, []);

Angular

1. Add the Athena settings to src/environments/environment.ts (and environment.prod.ts with the production values):

export const environment = {
  production: false,
  athenaUrl: 'https://qaathena.chatbot.thekosmoz.com',
  athenaAppId: 'oven',
};

2. Add a service: src/app/core/athena-chat.service.ts. It loads embed.js once, starts the assistant and gets tokens from your backend (step 5).

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { firstValueFrom } from 'rxjs';
import { environment } from '../../environments/environment';

declare global { interface Window { AthenaChat?: any; } }

@Injectable({ providedIn: 'root' })
export class AthenaChatService {
  private loading?: Promise<void>;

  constructor(private http: HttpClient) {}

  /** Call once the user is signed in. */
  async start(context?: Record<string, unknown>): Promise<void> {
    await this.loadScript();
    window.AthenaChat.init({
      appId: environment.athenaAppId,
      title: 'Oven assistant',
      context,                      // optional hint, e.g. { page: 'orders' }; never grants access
      getToken: async () => {       // Athena calls this whenever it needs a fresh token
        const r = await firstValueFrom(this.http.get<{ token: string }>(
          '/api/chatbot-token', { withCredentials: true }));
        return r.token;
      },
    });
  }

  /** Open the assistant from your own button. */
  open(): void { window.AthenaChat?.open(); }

  /** Call on logout, so the next user starts fresh. */
  stop(): void { window.AthenaChat?.destroy(); }

  private loadScript(): Promise<void> {
    if (window.AthenaChat) return Promise.resolve();
    return this.loading ??= new Promise<void>((resolve, reject) => {
      const s = document.createElement('script');
      s.src = `${environment.athenaUrl}/embed.js`;
      s.defer = true;
      s.onload = () => resolve();
      s.onerror = () => {
        this.loading = undefined;
        reject(new Error('Athena embed.js failed to load'));
      };
      document.body.appendChild(s);
    });
  }
}

If your API runs on another address, use its full URL for /api/chatbot-token. If your API uses a Bearer token instead of a cookie, your existing HttpInterceptor adds it as usual.

3. Start it on login, stop it on logout, e.g. in app.component.ts (use your own auth service):

export class AppComponent implements OnInit {
  constructor(private auth: AuthService, public athena: AthenaChatService) {}

  ngOnInit() {
    this.auth.isLoggedIn$.subscribe((loggedIn) => {
      if (loggedIn) this.athena.start().catch(console.error);
      else this.athena.stop();
    });
  }
}

4. Optional: your own button. A chat button already appears bottom-right; to open it from your page too:

<button (click)="athena.open()">Ask the assistant</button>

5. Content Security Policy, if your site sets one: allow Athena as shown above (script-src and frame-src).

For production, change only environment.prod.ts (athenaUrl, athenaAppId) and the backend's Athena settings and private key. The code stays the same.


Step 7: Test, then go live

Deploy to your test environment and check:

TestExpected result
Open your application signed inThe chat button appears; the welcome text and suggested questions show
Ask a question you know the answer toThe numbers match your data; the SQL that ran is shown
Sign in as users with different rolesEach can only use the tables their role allows
Sign in as users with different row-filter values (e.g. two restaurants)Each sees only their own rows; the SQL contains the filter
Leave the page open for 10 minutes, then ask againIt still works: a new token is fetched automatically
Log outThe chat button disappears
Browser console (F12)No Content Security Policy or "refused to connect" errors

When everything passes, click Go live in the portal. Until then the assistant doesn't answer. You can change the settings later with Edit settings.


Production checklist

  • The database user is read-only and can read only the tables the assistant needs.
  • Tokens are signed with a public key (ES256) or company SSO, not a shared secret.
  • Each environment has its own key pair; the private key is only in a secret store and the local files are deleted.
  • Tokens expire after 5 minutes, and the endpoint requires your normal login.
  • Allowed websites lists only your real address(es); test and localhost addresses are removed.
  • The Content Security Policy allows https://qaathena.chatbot.thekosmoz.com, and the start-up code is in a JavaScript file.
  • AthenaChat.destroy() runs on logout.
  • Roles and row filters were tested with real users (step 7).

Rotating the signing key

Rotate at least once a year, and immediately if a private key may have leaked. Do it for one environment at a time.

In the admin screen (no terminal):

  1. Open the application with Edit and, under Sign-in, click Generate new key pair. The new public key is filled in, and the new private key is shown once.
  2. Store the new private key in the application's secret store (step 3.2), replacing the old one under the same secret name, and tick I have stored the private key.
  3. Update Where the private key is stored if it changed, then Save changes.
  4. Restart or redeploy the application's backend right away so it signs with the new key.

Or with openssl: generate a new pair (step 3.1), replace the private key in the secret store (step 3.2), paste the new public key under Edit (admin) or Edit settings (portal), save, redeploy the backend, and delete the local private key file (step 3.4).

A lost private key can't be recovered from Athena: Athena never stores private keys, only the public key. Rotating is how you replace a lost key.

Between saving and redeploying, tokens signed with the old key are refused, so users may see one failed question. Do both together, outside busy hours. Users don't need to do anything: a new token is fetched automatically.


Troubleshooting

What you seeLikely causeFix
No chat buttonembed.js didn't load, or AthenaChat.init wasn't calledCheck the browser console. Check the CSP script-src, and that init runs after embed.js has loaded.
Panel is blank or "refused to connect"Your address isn't in Allowed websites, or differs (www., a port, http vs https)Add the exact address from your browser's address bar (Edit settings). Check the CSP frame-src.
"The application did not provide a sign-in token"getToken failed, took longer than 10 seconds or returned nothingOpen your token endpoint in the browser while signed in; it must return { "token": "..." }.
"invalid token: Signature verification failed"The public key or algorithm in the portal doesn't match your private keyPaste the matching public.pem and set the algorithm to ES256.
"invalid token: Invalid issuer" or "Invalid audience"iss or aud differ from the portalUse exactly the Issuer from the portal and the audience gritstone-athena-chatbot.
"token was not issued for this application"app_id is missing or wrongSet app_id to your App ID.
"token lifetime is longer than 900 seconds"Token valid for too longSet the expiry to 5 minutes.
"token is missing claim(s) required by this app's row filters"A row-filter value isn't in the tokenAdd it, e.g. restaurant_id.
"That needs data your role doesn't have access to"The user's roles don't include that table or columnExpected for that user, or adjust the table roles (Edit settings).
"too many questions, please wait a minute"Per-user rate limitWait a minute; contact the admin team if real use needs more.
The assistant doesn't answer at allThe application isn't live, or the admin team turned it offClick Go live. If the portal says the admin team turned it off, contact them.

Reference

AthenaChat.init options

OptionDefaultDescription
appIdrequiredYour App ID
getTokenrequiredReturns a token, or a Promise of one. Called whenever a token is needed or has expired.
contextnoneWhat the user is looking at (see Page context)
title"Assistant"Accessible name of the panel
buttonLabel"Open assistant"Accessible label of the chat button
position"right""left" puts the button and panel on the left
width400Panel width in pixels on desktop (phones always use full screen)
zIndex2147483000Raise or lower it if it clashes with your own overlays
openfalseOpen the panel immediately
onOpen, onClosenoneCallbacks, for example for analytics

Methods

CallEffect
AthenaChat.open() / .close() / .toggle()Show or hide the panel, e.g. from your own "Ask Athena" button
AthenaChat.setContext({...})Update the page context
AthenaChat.destroy()Remove the button and panel, e.g. on logout

Page context (optional)

Tell the assistant what the user is looking at, so questions like "why is this batch delayed?" are understood:

AthenaChat.init({ appId: "oven", getToken, context: { page: "batch", recordId: "B-1042" } });

// single-page apps: update it when the user navigates
router.afterEach((to) => AthenaChat.setContext({ page: to.name, recordId: to.params.id ?? null }));

At most 10 fields; names use letters, numbers and _; values are text (up to 200 characters), numbers, true/false or null. Context is only a hint: it never grants access. What a user can see is decided only by the roles and values in their signed token.

Messages between your page and Athena

You don't need these to integrate (embed.js handles them); they help with debugging. All use window.postMessage, and Athena accepts them only from your registered websites.

DirectionMessageMeaning
Athena → page{ type: "athena:ready", appId }The assistant has loaded
Athena → page{ type: "athena:token-request", appId }It needs a (new) token
page → Athena{ type: "athena:token", token }The token from your backend
page → Athena{ type: "athena:token-error", message }Your backend couldn't provide one
page → Athena{ type: "athena:context", context }Page context
Athena → page{ type: "athena:close" }The user closed the panel (X or Escape)

Security: what Athena does for you

ProtectionEffect
Only your websites can show your assistantThe browser refuses to display it anywhere else.
Token checked on every questionSignature, issuer, audience, expiry (15 minutes or less) and app_id. A token for another application is rejected.
Your tables onlyThe model only knows the tables and columns registered for your application.
SQL guardOnly SELECT: no writes, no other tables, no restricted columns. A row limit is added.
Row filtersAdded to every query from the signed token. A missing value means the request is refused.
Read-only, per-application connectionEach application uses its own encrypted connection string.
Tokens stay in memoryNever in URLs, browser storage or logs.
Rate limits and off switchPer-user limits; the admin team can turn an application off instantly.

Support

You manage your application's tables, roles, allowed websites and keys yourself in the portal (Edit settings). For a new application, its database connection, or an application the admin team turned off, contact the Athena admin team. When reporting a problem, include your App ID, the time, and the request_id shown in the error message, if any.