Unity LLM integration
Discovery
find_ai_related_scripts— label LLM / chat APIslist_ai_prompt_or_config_assets— JSON/MD with prompt-like keys under Assetsget_ai_stack_summarywithinclude_prompt_assets: true
Security & architecture
- Never commit API keys; use environment variables, Unity Cloud Code, or your backend proxy.
- Prefer server-mediated LLM calls for shipping titles (rate limits, moderation, cost).
- For editor-only tools, ScriptableObject prompts are OK if no secrets are embedded.
UX patterns
- Stream responses to UI (TMP) with cancellation tokens.
- Cache embeddings locally only when license/privacy allows.
- Cap token usage per session for live games.
Audit workflow
find_ai_related_scriptsfor hardcoded endpointssearch_projectwithscript_pattern: OpenAIorAnthropic- Review
list_ai_prompt_or_config_assetsfor PII in prompts