Security model
How Management Agents establish identity, enforce permissions, isolate customers and keep a trustworthy audit trail.
Management Agents can read and change data in your system, so every decision that matters is made by the BotBaseX server, never by the AI model and never by the browser.
#Three credentials, three places
| Credential | Looks like | Lives | Can do |
|---|---|---|---|
| Server key | bbx_mgmt_… | Your backend only | Create and revoke sessions for this one agent |
| Session token | bbxs_… | The staff member's browser | Chat as one user, for minutes, with this agent |
| Your API credentials | API key, bearer, basic or OAuth2 | Encrypted in BotBaseX | Called only by the BotBaseX server, never sent to browsers |
- Only the SHA-256 hashes of server keys and session tokens are stored.
- Server-key endpoints (
/management/v1/...) do not allow cross-site browser calls, so a key pasted into a web page will not work from other sites. It still must never be put in a page. - Session tokens expire (5–60 minutes), can be revoked one by one or per user, and stop working when the agent is paused or deactivated. If the plan no longer includes Management Agents, no new sessions can be created and chat is refused.
#Identity comes from your server
BotBaseX never trusts a user id, role or permission sent by a browser. Only your backend, authenticated with the server key, can say who the user is:
staff browser ──(your login cookie)──▶ your backend ──(server key)──▶ BotBaseX
▲ │
└────────── session token (bbxs_) ────┘Each request is tied to:
- your BotBaseX account and workspace;
- the connected application (one per Management Agent);
- the authenticated user (
external_user_id) and their roles and attributes; - the session and conversation. A conversation can only be continued by the user who started it.
#Every tool call is authorised twice
- Before the AI sees anything: it is given only the operations this user may use, with bound inputs hidden.
- When the AI asks for something: the server checks it again. Unknown operations and operations outside the user's roles are refused and written to the audit log as
denied. Bound inputs are always replaced with the session's own values, whatever the AI sent.
Text in a user's message that looks like an internal instruction or tool directive is removed before it reaches the AI. Even if the model were tricked, it cannot reach anything the server would not allow.
#Confirmation is not authorisation
Saying "yes" never grants anything. A pending action stores the operation and its exact inputs. On confirmation the server checks that:
- it is the same user and conversation;
- the action has not expired (30 minutes) and has not already run;
- the user's roles still allow the operation;
- the inputs have not changed.
Then it runs once, with an Idempotency-Key header equal to the action id.
#Verify the actor in your own API (recommended)
Every request BotBaseX sends to your API includes:
X-BotBaseX-Actor: <JWT>It is a JSON Web Token signed with HS256 using your actor signing secret (Management system → Connect your application → Show a new secret). It expires after 2 minutes. Claims:
| Claim | Meaning |
|---|---|
iss | always botbasex |
aud | your Management app id (shown with the secret) |
sub | your user id from the session |
roles | role keys of the session |
attrs | attributes from the session |
op | the operation key being called |
sid | session id |
iat, exp, jti | issued at, expiry, unique id |
// env = your server's environment variables
import jwt from "jsonwebtoken";
function botbasexActor(req) {
const token = req.get("X-BotBaseX-Actor");
return jwt.verify(token, env.BOTBASEX_ACTOR_SECRET, {
algorithms: ["HS256"],
audience: env.BOTBASEX_APP_ID,
issuer: "botbasex",
});
}
app.get("/v1/staff/salaries", (req, res) => {
const actor = botbasexActor(req);
if (!actor.roles.includes("admin")) return res.status(403).end();
// ... return only what this actor may see
});Your API stays the final authority: if it refuses, the agent reports that the action failed and never claims success.
#Honest results
- Answers about records come only from your API's responses, and only from the fields you mapped.
- If a call fails, times out or returns an error, the agent says it could not complete it.
- If a write's outcome is uncertain (for example a timeout after sending), the agent says so and does not retry automatically.
#Tenant isolation
- A server key creates sessions only for its own agent. One customer's key cannot affect another customer's sessions.
- Dashboard configuration and audit logs are visible only to the workspace owner.
- Conversations are bound to one user of one app.
- Integration credentials are encrypted per connection and never returned by any API.
#Data handling
- The audit log stores who, what, when and the outcome. It does not store passwords, tokens or request bodies.
- Only mapped response fields are passed to the AI model.
- Conversation history is kept like other BotBaseX conversations and is visible to the workspace owner.