Skip to content

Bot Authentication 🟑 BETA

Prove that a bot identity is resolved from the server's own state and that one bot cannot read another bot's data.

Admin guide Β· bot identity runbook

When to use Before you start Steps Verify Roll back
Onboarding a bot, after a drive-sync change, during tenant audit Bot discovered in Drive, DB reachable Resolve the bot, inspect the session, query scoped rows No cross-bot read, no impersonation Restore bot row or disable the bot

When to use

Use this runbook when a bot is added or renamed, when a channel routes to the wrong bot, or when a tenant-isolation doubt needs a concrete check.

Before you start

  • Bots are discovered from .gborg / .gbai buckets by the drive monitors and materialised into the work directory; the database bots rows are the identity the server uses.
  • For git-owned bots the ALM repository is the source of .gbdialog/ scripts and .gbot/ prompts; a change made straight in Drive is archived on the next sync.
  • A chat session carries its own identity (token, user id or guest). Tool execution only runs tools associated with that session.
  • Bot context can come from the host; a bot is tested on its own platform host, not through a query parameter on another bot's host.

Steps

# 1. Confirm the bot row the server resolved (scope by name, never by a client value).
psql -h localhost -U postgres -d botserver -c \
  "SELECT id, name, org_id, branch_id FROM bots WHERE name = '<bot>';"

# 2. Confirm Drive actually materialised the bot's dialog/config folders.
source <(grep -E '^VAULT_' "${WORKSPACE}/.env")
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")
VAULT_BIN="${WORKSPACE}/botserver-stack/bin/vault/vault"
DRIVE_ACCESSKEY=$($VAULT_BIN kv get -field=accesskey secret/gbo/drive)
DRIVE_SECRET=$($VAULT_BIN kv get -field=secret secret/gbo/drive)
DRIVE_PORT=$($VAULT_BIN kv get -field=port secret/gbo/drive)
/tmp/oc alias set local "http://127.0.0.1:${DRIVE_PORT}" "$DRIVE_ACCESSKEY" "$DRIVE_SECRET" --api s3v4
/tmp/oc ls local/"<bot>.gbai"/"<bot>.gbdialog"/

# 3. Watch the discovery and compile events for this bot.
grep -E "drive_monitor|Registered tool|Compiled" botserver.log | tail -30

Verify

Check Command / surface Pass condition
Identity query on bots by name one row with the expected org and branch
Materialisation /tmp/oc ls on the .gbdialog/ prefix start.bas and the tool scripts are present
Compilation grep on botserver.log the bot's tools registered
Isolation a session of bot A reading bot B's bucket refused
Channel routing chat on the bot's own host replies as that bot
Session tools tool call in a chat turn only associated tools execute

Roll back

πŸ”΄ Deactivate the bot through the documented bot-management surface and correct the Drive tree in the bot's ALM repository, then let the drive monitor rematerialise it. Do not hand-edit a materialised Drive copy. Escalate cross-bot reads through incident response.