Enterprise Agent Governance 🟑 BETA

Centralized monitoring, token auditing, and safety guards for AI agents

Overview

Enterprise Agent Governance provides administrators with a centralized control room to observe, audit, and secure all AI agents operating across the workspace. It combines real-time telemetry, dynamic security guards, script execution isolation, and a live dashboard with kill-switch capabilities.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Governance Dashboard (HTMX)         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Live     β”‚ β”‚ Token    β”‚ β”‚ Kill Switches    β”‚ β”‚
β”‚  β”‚ Metrics  β”‚ β”‚ Auditing β”‚ β”‚ (bot-level)      β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ SSE / WebSocket
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Metrics Ingestion Pipeline          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ LLM Call β”‚ β”‚ Tool     β”‚ β”‚ Script           β”‚ β”‚
β”‚  β”‚ Interceptβ”‚ β”‚ Executionβ”‚ β”‚ Guard            β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Telemetry Ingestion

A middleware intercepts all LLM calls and tool executions across the system, ingesting:

MetricDescription
TimestampEvent time
Bot IDWhich bot triggered the event
Session IDUser session context
ModelLLM model used
Prompt tokensInput token count
Completion tokensOutput token count
Tool nameExecuted tool/script
LatencyExecution duration

Metrics are persisted to the database and pushed to Valkey for live dashboard rendering via SSE.

Dynamic Security Guards

The script guard (script_guard.rs) inspects Rhai BASIC scripts before execution, detecting 17+ dangerous patterns:

PatternDetection
Secret key leakageReads from /tmp/vault-token-gb, env vars
Shell injectionCommand::new(), shell execution
File system escapeWrites outside .gbdrive/
Network probingInternal IP/port scanning
Resource exhaustionInfinite loops, excessive allocations

Blocked events are logged to an immutable security_audit_logs table.

Administrator Console

Dashboard

The governance dashboard at /suite/governance provides:

  • Live Metrics: Real-time WebSocket throughput and token consumption costs grouped by bot and department
  • Kill Switches: Immediately disable specific bots or revoke external tool access
  • Security Incidents: Real-time alarms via Server-Sent Events (SSE)
  • Audit Log: Searchable history of all security events

Kill Switch

When a bot is disabled via the kill switch:

  1. WebSocket connections for that bot are rejected
  2. Pending tool executions are cancelled
  3. An incident is logged to the audit table
  4. Administrators are notified via the dashboard

Configuration

config.csv keyDescriptionDefault
governance-enabledEnable governance featurestrue
governance-audit-logEnable immutable audit logtrue
governance-alert-emailEmail for critical alerts(none)

Feature Flag

Enable with monitoring feature flag:

botserver = { features = ["monitoring"] }

Security

  • Metric ingestion failures never block bot conversation paths β€” background threads with bounded channels
  • User message content is redacted from monitoring console logs unless detailed auditing is explicitly enabled
  • Kill switch fail-safe: DB pool overflow falls back to local file logging