Lagaam

v1.0.0
io.github.lagaam-ai/lagaam Checked 18 hours ago Published 26 days ago

Stops an agent's Trino or Pinot query before it runs if it costs too much or reads outside its grant

Values you need

VariableWhat it is
LAGAAM_ALLOWED_TABLESrequired Comma list of catalog.schema.table grants; the server will not start without it
LAGAAM_ALLOW_ALL_TABLESoptional true to run with no grant at all: an explicit opt-out, off by default
LAGAAM_ENGINEoptional Which adapter to run Default: trino
TRINO_HOSToptional Trino coordinator host Default: localhost
TRINO_PORToptional Trino coordinator port Default: 8080
TRINO_USERoptional Trino user Default: lagaam
TRINO_PASSWORDoptional secret Password for TRINO_USER; unset means no login. Not with TRINO_JWT
TRINO_JWToptional secret JWT to log in with instead of a password; unset means no login
TRINO_HTTP_SCHEMEoptional http or https; unset means https once a password or JWT is set, else http
TRINO_VERIFYoptional TLS cert check: true, false, or the path of a CA bundle (PEM) Default: true
PINOT_CONTROLLER_URLoptional Pinot controller URL Default: http://localhost:9000
PINOT_BROKER_URLoptional Pinot broker URL Default: http://localhost:8000
PINOT_USERoptional Pinot user; unset means no auth
PINOT_PASSWORDoptional secret Pinot password; unset means no auth
LAGAAM_AGENT_NAMEoptional Identity stamped on the audit trail Default: anonymous
LAGAAM_MAX_SCAN_BYTESoptional Scan-bytes budget per query, checked before it runs (default 50 GiB) Default: 53687091200
LAGAAM_MAX_ROWSoptional Scanned-row estimate budget per query; unset means ungated
LAGAAM_MAX_INTERMEDIATE_ROWSoptional Rows the engine would build at its widest step, not rows returned, so a LIMIT doesn't lower it Default: 50000000
LAGAAM_MAX_RETURNED_ROWSoptional Rows returned to the agent per query, capped at 100000; a bigger LIMIT in the query is lowered to it Default: 1000
LAGAAM_QUERY_TIMEOUToptional Wall-clock seconds per query Default: 300
LAGAAM_METADATA_TTLoptional Metadata cache TTL, seconds Default: 300
LAGAAM_AUDIT_LOGoptional Audit JSONL file path; unset means stderr

PyPI (uvx)

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add lagaam -e 'LAGAAM_ALLOWED_TABLES=<LAGAAM_ALLOWED_TABLES>' -- uvx lagaam==1.0.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "lagaam": {
      "args": [
        "lagaam==1.0.0"
      ],
      "command": "uvx",
      "env": {
        "LAGAAM_ALLOWED_TABLES": "<LAGAAM_ALLOWED_TABLES>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "lagaam": {
      "args": [
        "lagaam==1.0.0"
      ],
      "command": "uvx",
      "env": {
        "LAGAAM_ALLOWED_TABLES": "<LAGAAM_ALLOWED_TABLES>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "LAGAAM_ALLOWED_TABLES",
      "id": "lagaam-allowed-tables",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "lagaam": {
      "args": [
        "lagaam==1.0.0"
      ],
      "command": "uvx",
      "env": {
        "LAGAAM_ALLOWED_TABLES": "${input:lagaam-allowed-tables}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.lagaam]
command = "uvx"
args = ["lagaam==1.0.0"]
env = { "LAGAAM_ALLOWED_TABLES" = "<LAGAAM_ALLOWED_TABLES>" }

For AI agents

  1. Ask the user for: LAGAAM_ALLOWED_TABLES. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json