모바일 또는 웹 앱에서 직접 API를 호출하면 (예: 생성형 AI 모델에 대한 액세스를 허용하는 API) 승인되지 않은 클라이언트가 API를 악용할 수 있습니다. 이러한 API를 보호하려면 Firebase App Check를 사용하여 모든 수신 API 호출이 실제 앱에서 이루어지는지 확인할 수 있습니다.
Firebase AI Logic는 Firebase App Check와 통합하고 모바일 및 웹 앱에서 호출하는 생성형 AI 모델 API를 보호할 수 있는 프록시 게이트웨이를 제공합니다. Firebase AI Logic SDK를 사용하는 경우 Gemini Developer API 및 Vertex AI Gemini API 모두에서 App Check와의 통합이 지원됩니다.
Gemini 및 Imagen 모델을 모두 보호할 수 있습니다.
App Check 작동 방식에 대한 간략한 요약
App Check를 사용하면 앱을 실행하는 기기는 다음 중 하나 또는 둘 모두를 확인하는 앱 또는 기기 증명 제공자를 사용합니다.
요청이 인증된 앱에서 발생함
요청이 변조되지 않은 인증된 기기에서 발생함
이 증명은 앱이 Firebase AI Logic SDK를 사용하여 수행하는 모든 요청에 연결됩니다. App Check 적용을 사용 설정하면 유효한 증명이 없는 클라이언트의 요청이 거부되며 승인하지 않은 앱이나 플랫폼에서 발생한 요청도 거부됩니다.
Firebase AI Logic SDK를 사용하려면 Firebase 프로젝트에서 Firebase AI Logic API (firebasevertexai.googleapis.com)를 사용 설정해야 합니다. 이는 Firebase AI Logic SDK에서 전송된 요청이 먼저 Firebase AI Logic 서버로 전송되기 때문입니다. 이 서버는 요청이 선택한 'Gemini API' 제공업체의 백엔드와 Gemini 및 Imagen 모델에 액세스하는 API로 진행되기 전에 Firebase App Check 확인이 이루어지는 프록시 게이트웨이 역할을 합니다.
[null,null,["최종 업데이트: 2025-08-19(UTC)"],[],[],null,["\u003cbr /\u003e\n\nWhen you call an API directly from a mobile or web app (for example, the APIs\nthat allow access to generative AI models), the API is vulnerable to abuse by\nunauthorized clients. To help protect these APIs, you can use\n[Firebase App Check](/docs/app-check) to verify that all incoming API calls\nare from your actual app.\n\nFirebase AI Logic provides a proxy gateway that lets you integrate with\nFirebase App Check and protect the generative AI model APIs called by your\nmobile and web apps. **Integrating with App Check is supported for both the\nGemini Developer API and the Vertex AI Gemini API\n*when you use the Firebase AI Logic SDKs* .\nYou can protect both Gemini and Imagen models.**\n| We strongly recommend implementing Firebase App Check into your app as early as possible, even during development, so that every version of your app is protected from API abuse.\n\nHigh-level summary of how App Check works\n\nWith App Check, devices running your app use an app or device attestation\nprovider that verifies one or both of the following:\n\n- Requests originate from your authentic app\n- Requests originate from an authentic, untampered device\n\nThis attestation is attached to every request your app makes using a\nFirebase AI Logic SDK. When you enable App Check enforcement,\nrequests from clients without a valid attestation will be rejected, as will any\nrequest originating from an app or platform you haven't authorized.\n\nFind detailed information in the\n[Firebase App Check documentation](/docs/app-check).\n\nAvailable providers and implementation instructions\n\nApp Check has built-in support for using the following services as\nattestation providers. **Click a provider's link to view the App Check\ndocumentation for that provider, including descriptions and implementation\ninstructions.**\n\n- Apple platforms: [DeviceCheck](/docs/app-check/ios/devicecheck-provider) or [App Attest](/docs/app-check/ios/app-attest-provider)\n- Android: [Play Integrity](/docs/app-check/android/play-integrity-provider)\n- Web: [reCAPTCHA Enterprise](/docs/app-check/web/recaptcha-enterprise-provider)\n\n| **Note:** Flutter and Unity support all the providers listed above. View specific App Check implementation instructions in the [Flutter](/docs/app-check/flutter/default-providers) and [Unity](/docs/app-check/unity/default-providers) pages. Additionally, for Flutter, see below for [required special instantiation](#instantiation-flutter).\n\nIf these providers are insufficient for your needs, you can also implement your\nown service that uses either a third-party attestation provider or your own\nattestation techniques\n(for more details, see the [App Check documentation](/docs/app-check)).\n\nSpecial instantiation required for Flutter\n\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| *Click your Gemini API provider to view provider-specific content and code on this page.* Gemini Developer API Vertex AI Gemini API |\n\nWhen using App Check with Firebase AI Logic in Flutter apps, you need to\nexplicitly pass in App Check during instantiation, like so: \n\n final ai = await FirebaseAI.googleAI(appCheck: FirebaseAppCheck.instance)\n .generativeModel(model: '\u003cvar translate=\"no\"\u003eMODEL_NAME\u003c/var\u003e');\n\nAdditional information about App Check\n\n- Learn about [quotas and limits](/docs/app-check#quotas_limits) for\n App Check.\n\n- Make sure that you\n [enable enforcement of App Check](/docs/app-check/enable-enforcement)\n before you release your app to real users.\n\nUnderstand how Firebase AI Logic integrates with App Check\n\nTo use the Firebase AI Logic SDKs, the\n[Firebase AI Logic API (`firebasevertexai.googleapis.com`)](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_)\nmust be enabled in your Firebase project. This is because requests made by the\nFirebase AI Logic SDKs are first sent to the Firebase AI Logic\nserver, which acts as a proxy gateway where Firebase App Check verification\ntakes place *before* the request is allowed to proceed to your chosen\n\"Gemini API\" provider's backend and the APIs to access the Gemini\nand Imagen models."]]