F FourIA GitHub ↗

Feature Flags Reference

On this page

Feature flags are passed as a JSON object via the MOLTLAZY_FEATURE_FLAGS environment variable. They control which optional feature packs are active. All secret values (tokens, API keys) remain as environment variables and are never included in feature flags.

Format

The feature flags JSON is set directly as a per-customer binding (MOLTLAZY_FEATURE_FLAGS) and passed to the container as the MOLTLAZY_FEATURE_FLAGS env var. Flags are managed via the FourIA API.

Example

{
  "knowledgeGraph": true,
  "unifiedBilling": false,
  "channelsTelegram": true,
  "channelsDiscord": false,
  "channelsSlack": false,
  "microsoftGraph": false,
  "agents": "*",
  "agentTenant": ""
}

Flags

FlagTypeDefaultDescription
agentsstring""Premade agent filter: "*" for all, comma-separated IDs, or empty
agentTenantstring""Tenant name for tenant-specific agents
knowledgeGraphbooleanfalseEnable knowledge graph (memory, wiki, QMD)
unifiedBillingbooleanfalseEnable CF AI Gateway unified billing plugin
channelsTelegrambooleanfalseEnable Telegram behavioral config
channelsDiscordbooleanfalseEnable Discord behavioral config
channelsSlackbooleanfalseEnable Slack behavioral config
microsoftGraphbooleanfalseEnable Microsoft Graph plugin

Always-on config (no flag needed)

These config sections are always applied by the Config Module at startup, regardless of feature flags:

SectionSourcePurpose
gateway.*config/gatewayAuth mode, trustedProxies, controlUi
session.dmScopeconfig/sessionPer-channel-peer session isolation
tools.toolSearchconfig/toolsTool search enabled in “tools” mode
logging.*config/loggingProduction logging with redaction
agents.defaultsagents/Default model configuration

Secret-free guarantee

Feature flags and moltlazy.json never contain secrets. The gateway reads secrets from its own environment:

VariableScope
CLOUDFLARE_AI_GATEWAY_API_KEYCF AI Gateway auth
TELEGRAM_BOT_TOKENTelegram bot auth
DISCORD_BOT_TOKENDiscord bot auth
SLACK_BOT_TOKEN / SLACK_APP_TOKENSlack auth

Storage

Feature flags are set as a per-customer MOLTLAZY_FEATURE_FLAGS binding, managed via the FourIA API. There is no R2 storage and no worker-side cache — the binding is read directly at container startup. The legacy CONFIG_BUCKET / ETag-cache mechanism was removed.

Deprecated keys (removed in v0.3)

v0.2 keyv0.3 equivalent
MOLTLAZY_FORCE_GATEWAYRemoved — always-on
MOLTLAZY_FORCE_AI_GATEWAYRemoved — use unifiedBilling
MOLTLAZY_FORCE_CHANNELSRemoved — use channelsTelegram etc.
MOLTLAZY_FORCE_AGENTSRemoved — use agents
MOLTLAZY_AGENTSagents (in flags JSON)
AGENT_TENANTagentTenant (in flags JSON)
MOLTLAZY_TOML_CONTENTRemoved — use MOLTLAZY_FEATURE_FLAGS
MOLTLAZY_TOML_ETAGRemoved — no longer needed