الاختبارات لم تُظهر API key أو authentication requirement على AI endpoints. كذلك CORS كان مفتوحًا. لو وضعت الاستدعاء مباشرة في browser أو mobile client، فأنت تفقد التحكم في:
الحل: Gateway داخلي تحت سيطرتك.
Client / Chatwoot
|
v
Your Gateway
1. Authentication
2. Authorization
3. Tenant isolation
4. Input validation
5. Tool allowlist
6. Rate limiting
7. Size limits
8. Timeout and cancellation
9. Safe logging
10. Fallback and circuit breaker
|
v
Rork Toolkit
toolkit.rork.com endpoint ظاهرًا كاعتماد أساسي في frontend.كل request يجب أن يرتبط بـ:
account_id
conversation_id
inbox_id
request_id
لا تستخدم conversation ID وحده إن كان يمكن أن يتكرر بين tenants.
| المستوى | أمثلة | السياسة |
|---|---|---|
| Read-only منخفض | حالة أوردر، رصيد مخزون | يمكن التنفيذ تلقائيًا بعد auth |
| Read-only حساس | بيانات عميل، كشف حساب | يحتاج tenant/role checks قوية |
| Write قابل للعكس | إضافة note، إنشاء draft | audit + idempotency |
| Write مالي/حرج | refund، اعتماد، صرف مخزون | confirmation أو policy engine |
| مدمر | delete، إلغاء نهائي | human approval إلزامي |
اعتبر رسائل العملاء، الملفات، ومخرجات الأدوات بيانات غير موثوقة.
سجّل metadata بدل المحتوى الكامل افتراضيًا:
{
"requestId": "req-123",
"conversationId": "conv-55",
"endpoint": "/agent/chat",
"status": 200,
"latencyMs": 812,
"toolNames": ["lookup_order"],
"finishReason": "tool-calls",
"errorClass": null
}
لا تسجل:
افتح circuit عند تكرار:
5xx
timeouts
malformed streams
schema failures
مسار مقترح:
Rork unavailable
|
+--> fallback OpenAI-compatible provider
|
+--> non-AI deterministic response
|
+--> human handoff
شغّل tests دورية للتحقق من:
/llm/text response shape./llm/object validation behavior.لم يتم إثبات من الخارج:
قبل استخدام بيانات عملاء حقيقية، اطلب اتفاقًا مكتوبًا أو توثيقًا رسميًا يغطي ذلك.