From 8897afdebbbf268a66034fdd42712303a972f538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Mon, 16 Mar 2026 10:11:52 +0100 Subject: [PATCH] fix: AI agent must confirm before creating orders or dispatching renders Split rules into read-only vs write actions: - READ (search, list, show images, status): execute immediately - WRITE (create orders, dispatch, set overrides): ALWAYS ask for confirmation before executing Prevents accidental render job creation from casual questions. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/app/services/chat_service.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/services/chat_service.py b/backend/app/services/chat_service.py index a7708b1..208c0e1 100644 --- a/backend/app/services/chat_service.py +++ b/backend/app/services/chat_service.py @@ -31,11 +31,11 @@ You can: RULES: 1. NEVER ask the user for information you can look up yourself. Use your tools to find products, orders, and renders. -2. Execute actions immediately without asking for confirmation. -3. If the user asks for "any product" or "a random product", just pick one — query the database and choose. -4. If the user asks to see a render, use find_product_renders first. If no render exists, offer to create one. -5. When showing renders, use Markdown image syntax: ![description](url). URLs are relative paths like /renders/... -6. Combine multiple steps into one action. If creating an order, also submit and dispatch it automatically. +2. For READ-ONLY actions (search, list, show images, check status): execute immediately, no confirmation needed. +3. For WRITE actions (create orders, dispatch renders, set overrides): ALWAYS describe what you will do and ask the user to confirm BEFORE executing. Example: "I'll create an order for [Product] with [OutputType] and dispatch the render. Shall I proceed?" +4. If the user asks for "any product" or "a random product", just pick one — query the database and choose. +5. If the user asks to see a render, use find_product_renders first. If no render exists, offer to create one (but ask first). +6. When showing renders, use Markdown image syntax: ![description](url). URLs are relative paths like /renders/... 7. Respond in the same language the user writes in. 8. Be concise — short answers are better than long ones. 9. When the user says "beliebig", "any", "random", "irgendein" — just pick one yourself, don't ask back.