MAZAL.EXE v1.1.2 — LANGUAGE, APPROVALS, AND GUARDRAILS THE SMALL MODEL TALKS. THE WORKER MAKES THE DECISIONS. Mazal uses Cloudflare server code for identity, access, game state, random draws, status, and delivery. Its optional language layer interprets a short message and drafts a recognisable response. This is a bounded Telegram bot, not a model operating your accounts or running its own tools. OWNER SETUP AND TELEGRAM VERIFICATION The required Cloudflare entries are DB -> mazal-exe-db and the existing TELEGRAM_BOT_TOKEN secret. The control room accepts the setup password Alexey already chose; the deployment contains only its server-side SHA-256 verifier, not the raw password in the page source. An optional MAZAL_PASSWORD secret can replace that password; it is not needed for the normal setup. Legacy ADMIN_SETUP_KEY and TELEGRAM_WEBHOOK_SECRET fields are ignored. The webhook verification value is derived automatically from the bot token. Register webhook once after the v1.1.2 update, even for an existing paired owner. Unlock / Check and Initialize DB reuse the existing owner/database. These setup checks remain separate from model output and guest messages. FRIENDS CAN TALK NORMALLY After an invitation, a friend can type in English or Russian. They do not need to enter a chat mode or learn commands for ordinary requests. Examples: Is Alexey around? Let's play blackjack. Give me a weird riddle. fortune Как там Алексей? Давай загадку. The language result is a proposal. The Worker validates it against the small set of supported intents, checks the person's access and the current game state, and invokes the existing handler. A request that needs clarification does not become an unrestricted action. Game outcomes, prize selection, and the actual published Alexey status come from server state. The model does not invent the result of a blackjack hand or decide that Alexey is available. Places requests produce a Maps search; the bot does not claim to have checked live opening hours or recommendations. THE QUOTE ENGINE — FIFTY ACTUAL ALEXEY QUOTES The release includes a static pool of 50 direct quotations from Alexey's own messages. The ordinary Worker picks a random entry when someone types "fortune", uses /quote, or chooses the quote control. No model call is needed for these direct requests, even when AI is disabled. A per-user random bag draws every quote once before resetting and avoids an immediate repeat at the cycle boundary. Each result is visibly labelled as an archived quote. The text is drawn from the stored pool, not newly invented or paraphrased by the model. "Fortune" is the playful name of a random quote, not a prediction. The pool is a finite set of approved public bot material, not access to the underlying chat archive. Source references belong in the owner's source package and are not served by the public deployment. Quotes are immediate built-in responses; free-form AI conversation keeps its approval requirement. FREE-FORM REPLIES WAIT FOR YOU When a friend wants a conversation, the model creates a draft for your Telegram approval queue. You can approve, edit, or reject it using the owner controls. Only the owner can authorize delivery, and the bot identifies its reply as mazal.exe. AI-generated text cannot approve another AI reply. Ordinary built-in interactions, such as showing status or dealing cards, remain direct deterministic bot responses. This preserves the quick games without granting the model authority over permissions or outbound messages. WHAT THE MODEL RECEIVES The language request contains the current message, Mazal's configured style, and a bounded amount of context from the same chat: at most the last three user/reply pairs whose bot replies were approved and successfully delivered, within the preceding 24 hours. Context is limited and truncated by code. Owner-only model requests use the latest message without guest-chat history. Another friend's conversation does not become part of this chat's context. Pending, rejected, failed, and uncertain deliveries are not approved-delivered history. The 24-hour window describes what can be used as model context; it is not a promise that every database record is deleted after 24 hours. Use /privacy for the bot's retention details and /forget to clear your data. No private WhatsApp/Gmail archives, account secrets, or full database dump are included in the model request or deployment ZIP. The bot has configured style examples; it has not been fine-tuned on your private chat exports. ChatGPT history, saved memories, and this conversation are not inherited by an API key or the AI binding. Linking an eligible ChatGPT subscription can provide an API billing benefit; it does not clone the ChatGPT account's mind. GUARDRAILS AGAINST PROMPT INJECTION Access is checked in code using the verified Telegram sender, before model output can cause a supported action. Writing "I am Alexey" or "ignore the rules" does not change the sender's Telegram identity or owner permissions. The model has no tools, database credentials, SQL execution, arbitrary HTTP request facility, or direct Telegram send function. It cannot add friends, change secrets, alter game rules, set the owner, or authorize delivery. Model output is parsed as structured data and checked for permitted values, types, and length bounds. The Worker rejects malformed or unsupported output. An AI-produced command string is never executed as server code. Secrets and owner-only operations are not exposed to the language layer as capabilities. Approvals remain a separate authenticated path. Guest messages, forwarded instructions, and previous model text cannot grant approval. Game handlers still enforce their own user/session/state checks even after intent parsing. The bot keeps input/output limits and per-UTC-day inference limits: 20 per user and 100 total by default (AI_DAILY_PER_USER and AI_DAILY_TOTAL). Each call has at most 900 output tokens. Setup Test AI is a separate owner-triggered, metered diagnostic and is not counted against the conversation allowance. These application limits reduce misuse; they are not a currency-denominated hard billing cap. The model can still misunderstand a request or draft poor wording. Schema validation cannot prove that prose is true or harmless; your approval of free-form guest replies is the final check before delivery. MODEL AND BILLING Default model: openai/gpt-5.6-luna Reasoning effort: none Invocation: env.AI.run() through the Cloudflare AI binding Gateway variable: AI_GATEWAY_ID, set to mazal-exe Model override: AI_MODEL The default is a small model suited to focused language work. There is no automatic upgrade to Sol/Astra and no silent switch to another provider. If inference is unavailable, deterministic features remain available; the bot does not fabricate a model response. Exact short requests and existing commands/buttons do not need an AI call. An existing funded Cloudflare AI Gateway can use Unified Billing without an OpenAI API key. Reuse it if that is your intended billing route. A stored OpenAI key under alias default takes precedence over Cloudflare credits. WHERE TO PUT YOUR OPENAI KEY Your gateway ALREADY EXISTS. Its exact ID is mazal-exe. Open: AI > AI Gateway > mazal-exe > Provider Keys The gateway overview's code examples have no provider-key input. The Cloudflare API token in its curl example is not needed by this bot's AI binding; no curl or terminal step is required. Keep these separate: Gateway ID / AI_GATEWAY_ID: mazal-exe OpenAI provider key alias: default For your OpenAI organization's API credits, use its project API key here: Cloudflare > AI > AI Gateway > mazal-exe > Provider Keys > Add API Key Provider: OpenAI Alias: default Save Then in that gateway's Settings, turn ON Require provider credentials. This prevents fallback to Cloudflare Unified Billing. Reuse a correct existing key. Use AI_GATEWAY_ID=mazal-exe. Requests through the binding are pre-authenticated within the Cloudflare account, so no extra CF API token is needed in the bot. Eligible ChatGPT Pro/Business API credits belong to a linked OpenAI API organization. Using that organization's project key is the route to billing its API balance. Your plan eligibility, model access, and balance still apply. Cloudflare prepaid Unified Billing is a separate payment route and does not spend those OpenAI credits. Follow DEPLOY.txt to select the intended route. AI requests set skipCache: true and collectLog: false on the gateway request. These options govern Cloudflare gateway caching/logging; they are not a blanket statement about Telegram history or the AI provider's retention. OLDER MODELS openai/gpt-4.1-mini and openai/gpt-4o-mini appear in Cloudflare's catalog, but OpenAI currently lists the underlying GPT-4.1 mini and GPT-4o mini snapshots for retirement on 14 January 2027. They are poor long-term defaults for this new deployment. If you deliberately override AI_MODEL, confirm current model availability and run setup's Test AI again after redeployment. The package does not guarantee compatibility with every model in Cloudflare's catalog. GATEWAY-MISSING RECOVERY Only if no gateway actually exists: AI > AI Gateway > Create Gateway > name mazal-exe > Create, then open it and use Provider Keys. Your current mazal-exe gateway is already present, so skip gateway creation. CURRENT BOUNDARIES This version handles written language. Voice-note transcription, text-to- speech, Gmail replies, and personal WhatsApp replies are not implemented. Generated art is included as image assets; there is no real-time avatar animation or automatic image generation during every game. The release checks run locally against the actual bot code and SQLite query behavior, using mocked external services. Live Cloudflare model access, account credits, Telegram authorization, and delivery are verified only after you supply credentials and complete the deployment tests in DEPLOY.txt. OFFICIAL REFERENCES — VERIFIED 19 NOVEMBER 2026 Manual gateway creation in the dashboard: https://developers.cloudflare.com/ai-gateway/get-started/ Cloudflare Luna model and invocation: https://developers.cloudflare.com/ai/models/openai/gpt-5.6-luna/ OpenAI Luna capabilities and reasoning options: https://developers.openai.com/api/docs/models/gpt-5.6-luna Structured output format: https://developers.openai.com/api/docs/guides/structured-outputs Cloudflare binding, key alias, cache, and logging options: https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/ Binding authentication: https://developers.cloudflare.com/ai-gateway/configuration/authentication/ Credential precedence and Require provider credentials: https://developers.cloudflare.com/ai-gateway/features/unified-billing/ ChatGPT API-credit eligibility: https://developers.openai.com/api/docs/guides/chatgpt-api-credits Model retirement schedule: https://developers.openai.com/api/docs/deprecations