慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
航运AI之隐秘之能,众人鲜有论及——而Firebase方才修正之。
Vishal Keert · 2026-05-24 · via DEV Community

每造人工智能之应用者,必有一时焉,初试其技时也。

非其乐事也,非模型显奇技而自矜为智者之时也。乃他时也,子夜一时,对客代码而睹之,乃知其Gemini API密钥,昭然若揭,将束于JavaScript之文,俾凡有浏览器与十刻之暇者,皆可启而观之。

彼时,吾方筑Sambhav——一AI职业平台也,能实时语音转写,有Whisper为之;能析简历,有Gemini为之;能授个性化之导。其应用有Next.js 15之前端,与Flask之后台相接;有Supabase潜于其下,且有多般机件,皆需与LLM有所交涉。

吾最引以为傲之功能:实时模拟面试模式,用户可自然言谈,其言辞为系统转录,复由 Gemini 即时评点。此功能甚为精妙,运行亦佳。

其下之构,实为隐患。


实然之患

吾所陷之式,如是:凡需低时延之调,皆由客户端发之。如实时转写之反馈,若增服务器迂回,则体验滞涩,支离。然自客户端调用Gemini,则API密钥必存于客户端可及之处。

开发者于此常寻之解,皆各有弊。

汝可置钥于环境变量,冀汝之打包器不泄之——然其或泄,且泄之方式甚难稽核。汝可通万物于己之后端——此法可行,然今汝需维持两服务间之会话状态,而汝之Flask服务器唯转发请求、增延迟而已。汝可用短时效之令牌——然则汝需构建令牌生成与刷新之系统,此系统自成一项目。

所虑深远者,此皆不能解配额之困也。纵使隐汝API密钥,有志者犹能截获有效认证令牌,重放之。非为盗取密钥——只为耗尽汝之计费配额。若为私用项目或黑客松演示,此乃烦扰之偶发情形。若为真用户之生产系统,则实为重大威胁。

吾终采代理之法,盖其最可辩护也,然增面试反馈之迟滞,令会话管理大增其繁。Flask之 backend 必须同时持 Whisper 会话之态、Gemini 之境、及认证之层。当有失事——而演示中事必多失——则孰层之败,终不可辨。


Firebase AI 之理实变何在

Secure AI Architecture

Firebase AI 之理非新——然 Google 于 I/O 所出,使其异于六月之前,二者之合,恰解前述之弊

一者乃 惟模态也。此架构直白:汝之Gemini提示——系统指令、模型配置、工具定义——存于Firebase之服务器,非在汝之客户端代码。客户端引模板ID。仅此而已。当请求至,Firebase执行服务器端模板。若有人截取客户端请求,欲注入定制系统提示,框架则无视之。无路径自客户端代码至提示之操纵。

若如Sambhav之面试模式,此则意味着评估标准——定义Gemini如何评分候选人回答之提示——当存于其所属之服务器,非与前端捆绑。客户端仅送交记录,得结构化之回应。

其次为App Check回放防护,以一次性令牌为凭。。自本月起,Firebase AI Logic之App Check令牌严限单用。一用即殁。若攻者窃得有效令牌于途,不可重放以作Gemini之续呼。前所言之配额耗尽攻击——纵使API密钥隐秘至极亦技术上可行者——今于基础架构层面已告封闭。

迟滞之权衡,实存且当察之:每请求数新符,增一网络往返。于实时转写之功能,每数秒即唤一Geminic,此耗累积甚巨。启用此于迟滞敏感之途,当先剖析之。


混合推理之部

Hybrid Inference Architecture

又有第三之公告,吾以为未为众人所重,盖其言似为性能优化,实则乃架构之决也.

Firebase今已支持跨iOS、Android(配Gemma 4)、——将速至GA——及Web之Chrome以混合推理。模型于设备所能则运行于本地,不可则退回云端之Gemini。

此非止于"速且廉"之故,实在于坚韧。Sambhav乃为极赛之境而设,故需于会场WiFi中运行。会场WiFi实为敌对。面试模式时,或中途顿滞,盖因Gemini通话超时,致体验毁于演示之际。

混合推理者,谓管路轻质之部——如转写之洁、应答之整、简易之判——可于地运行,不假网状之况。繁重之思则委云。网绝而应用犹存。

凡施此技者,所遇实问:于器上之Gemma 4,不得其全质。其能之阙,确凿,须设计其术,使地之径,得生雅降之境,非致崩坏。此乃设之难,非仅调之故。


此意之实

Firebase AI Logic GA非头条之讯,亦无成风之势。然凡开发者,或已推出,或欲推出客户端应用之AI功能,而遇API密钥存于何处、如何护其配额之困者,此I/O之讯,实为至要。

模板模式独用、App Check回放防护、混合推理三者合流,使我为Sambhav所拼凑之安全韧性架构——代理服务器、会话状态管理、手动令牌处理——今成Firebase SDK一等特性。汝无需自建管路,但须配置之。

吾当慎察其入产之要:模板独用之态与重演防护,各解问题之异端,亦具迟滞之殊相。勿使二者皆默认而启于四方。先审迟滞所系之径,察其往返之费所落,而后决取舍之宜。

昔需后端工程之安全架构,今寄于 Firebase 配置三途。此乃实践可行之变,意深且重。