Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chapter 12: Authentication & Security

User authentication, permission management, and resource protection for botserver.

Overview

botserver provides enterprise-grade security with flexible authentication options, granular permissions, and comprehensive rate limiting to prevent abuse.

Initial Setup

When General Bots starts for the first time, it automatically creates an administrator account and displays the credentials in the console. See Initial Setup & Bootstrap for details.

╔════════════════════════════════════════════════════════════╗
║       🤖 GENERAL BOTS - INITIAL SETUP COMPLETE            ║
╠════════════════════════════════════════════════════════════╣
║  Username:             admin                               ║
║  Email:                admin@localhost                     ║
║  Password:             (displayed in console)              ║
╚════════════════════════════════════════════════════════════╝

Important: Save the password shown in your console during first startup. It will not be displayed again.

Authentication Methods

MethodUse Case
Session TokenWeb/API access
OAuth2/OIDCSSO integration via Zitadel
API KeyService accounts
Bot AuthBot-to-bot communication

Quick Start

' Check if user is authenticated
IF user.authenticated THEN
  TALK "Welcome, " + user.name
ELSE
  TALK "Please log in first"
END IF

Security Features

  • Directory Service: Zitadel handles all user identity management
  • No Password Storage: Passwords never stored in General Bots
  • Session Management: Cryptographic tokens, configurable expiry
  • Rate Limiting: Per-user and global limits with HTTP 429 responses
  • System Limits: Loop protection, file size limits, resource constraints
  • Audit Logging: Track all authentication events
  • Organizations: Multi-tenant support with org-based isolation

Permission Levels

LevelAccess
adminFull system access, user management
org_ownerOrganization management
bot_ownerBot configuration and deployment
bot_operatorBot operation and monitoring
userStandard access
guestRead-only, anonymous chat

Organization Structure

Organization (e.g., "Acme Corp")
├── Users (with roles)
├── Bots (owned by org)
│   ├── sales-bot
│   └── support-bot
└── Drive Storage
    ├── acme-sales-bot.gbai/
    └── acme-support-bot.gbai/

Configuration

name,value
auth-session-ttl,3600
auth-max-attempts,5
auth-lockout-duration,900

Chapter Contents

Anonymous Chat Access

Anonymous users can use the chat functionality without logging in. The system automatically creates temporary sessions for anonymous users. Authentication is only required for:

  • User management (Settings)
  • Bot configuration
  • Administrative functions
  • Organization management

See Also