Google Gemini AI API (gemini-1.5-flash model) used as the AI analysis engine for ScamCheck (scam pattern detection) and TrustSeal (website trust verdict). All Gemini API calls run server-side inside Firebase Cloud Functions — the API key is never exposed to the client. Documented operational patterns: free tier enforces per-minute rate limits that produce 429 responses requiring structured UX handling; structured JSON output reliability depends on embedding the exact output schema in the prompt rather than relying on model defaults.
Operational records — 24 total
Modular, dependency-free engine that turns a single scam input into a full bilingual content bundle: article, SEO metadata, GEO summary, social copy for five platforms, Shorts/Reels script, FAQ + Article JSON-LD schema, auto internal links, and a per-channel publishing queue. Provider-agnostic AI over REST, Firebase-compatible store adapter, caching, rate limits, and audit logging.
Scalable pipeline that ingests public scam reports and turns them into deduplicated, classified, severity-scored intelligence: rule+AI classification across 12 scam types, PII redaction, spam/abuse pre-filtering, Gemini moderation, embedding-based semantic deduplication and clustering, vector search, trending dashboard, regional heatmap, admin moderation queue, and a public alert feed. Includes Firestore collections, indexing strategy, prompt structure, and moderation flow.
How AI Execution Lab uses Vertex AI Gemini 2.5 (Flash + Pro) exclusively: dependency-free service-account auth, model-tier routing with automatic fallback, graceful rate-limit handling, token usage + cost tracking, Vertex quota monitoring, batched multilingual embeddings, and a deterministic mock fallback. Includes the exact env vars, IAM roles, and a go-live checklist.
Operational cost governance doctrine for TrustSeal and ScamCheck. Documents where costs originate, concrete free-tier economics, the 7 cost invariants that prevent runaway resource consumption, scaling thresholds with upgrade triggers, abuse containment strategy, and silent cost escalation vectors. All figures derived from real architecture — Gemini 1.5-flash free tier, Firebase Spark plan, Razorpay transaction fees.
Recovery invariants, incident classification, blast radius model, and recovery posture for the A Square Solutions ecosystem. Extracted from real production incidents across TrustSeal, ScamCheck, AI Execution Lab, and WordPress. Answers the question: when production behavior diverges from expected state, how do we restore safe operation predictably and without making the incident worse?
The 20 operational invariants governing the A Square Solutions ecosystem, extracted from real production failures and operational history. Each invariant is a condition that must remain true for the system to behave safely and predictably — an explicit reliability contract derived from TrustSeal, ScamCheck, AI Execution Lab, and WordPress production experience.
Security invariants, credential governance, trust boundary model, and access discipline for the A Square Solutions ecosystem. Documents the three-tier access architecture across TrustSeal and ScamCheck, all credentials and where they are allowed, the security implications of historical operational failures, silent security drift scenarios, and lightweight security observability patterns. Grounded entirely in real production architecture.
Detection invariants, signal taxonomy, and monitoring doctrine for the A Square Solutions ecosystem. Extracted from real production failure history across TrustSeal, ScamCheck, AI Execution Lab, and WordPress. Documents how 15 historical failures were detected, what signals were missing, and what detection rules prevent the same classes from being discovered by user reports instead of operators.
Step-by-step detection procedures for every production system in the A Square Solutions ecosystem. Covers TrustSeal, ScamCheck, AI Execution Lab, and WordPress. For each system: what healthy looks like, what each failure mode looks like, and what to check first when something is wrong.
Lightweight, system-specific recovery procedures for every documented failure class across the A Square Solutions ecosystem. For each failure: the minimum recovery action, the correct recovery sequence, how to confirm the system is restored, and what residual risk remains. Companion to the Incident Detection Playbook.
Operational pattern for handling structured output from AI APIs (Gemini, GPT, Claude) in production. Covers the failure surface when AI output is used as data: JSON parse failures, schema drift, missing fields, type mismatches, markdown code fence wrapping, and the architectural patterns that make AI-driven data pipelines robust against model output variation.
Production pattern for per-user quota tracking, monthly reset logic, atomic increment, pre-AI-call enforcement, and abuse prevention using Firestore. Implemented in TrustSeal (10 free checks/month, premium tier) and ScamCheck (unlimited free after sign-up). Covers the data model, the enforcement code, the reset mechanism, and the cost protection logic that prevents free-tier Gemini quota from being exhausted by a single user.
Operational reference for running Gemini AI in production via Firebase Cloud Functions. Covers: structured output enforcement, JSON parse failure handling, 429 rate limit UX design, server-side key isolation, cold start latency mitigation, Node runtime requirements, and the three-part prompt architecture that produces reliable structured output across calls.
Complete operational provenance for ScamCheck (scamcheck.asquaresolution.com) from concept through production. Build phases, infrastructure changes, Gemini rate limit incident, auth configuration, CSS architecture decisions, and deployment milestones — consolidated as a queryable operational record.
Complete operational provenance for TrustSeal (trustseal.asquaresolution.com) from concept through production. Build phases, infrastructure changes, auth incidents, payment integration, deployment milestones, and failure resolutions — consolidated as a queryable operational record.
Architecture and build record for TrustSeal (trustseal.asquaresolution.com) — an AI-powered Trust Intelligence Platform for domain and business verification. React/Vite/Firebase/Gemini/Razorpay on GitHub Pages.
Architecture and build record for ScamCheck (scamcheck.asquaresolution.com) — an AI-powered scam detection tool. React/Vite/Firebase/Gemini on GitHub Pages with plain CSS.
A new Gemini API key environment variable was added to .env.local but not to Vercel production. Feature worked locally and in dev but silently returned undefined in production. Root cause: variable scoped to Development only.
TrustSeal (trustseal.asquaresolution.com) — AI-powered website trust verification tool. React/Vite/GitHub Pages frontend, Firebase Auth + Firestore backend, Firebase Functions v2 for Gemini AI analysis and Razorpay webhook handling. Subscription-based monetization via Razorpay (INR). Node 22 runtime required.
ScamCheck (scamcheck.asquaresolution.com) — AI-powered scam detection tool. React/Vite/GitHub Pages frontend, Firebase Auth + Firestore backend, Firebase Functions v2 for Gemini AI scam analysis. Plain CSS (no Tailwind — justified at this UI scope). Free-tier AI tool with no payment layer. Node 22 runtime required.
Testing whether embedding an exact JSON schema + explicit format constraint in the prompt reduces malformed output frequency in Gemini 1.5-flash. Three prompt iterations tested during ScamCheck and TrustSeal build. Schema-in-prompt approach reduced parse failures from ~6% to <1% of calls.
Gemini 1.5-flash intermittently wraps JSON output in markdown code fences or includes explanation text before/after the JSON object. JSON.parse() throws SyntaxError, Cloud Function crashes, client receives no response and shows infinite spinner. Fix: pre-parse cleaning + structured error return.
ScamCheck's Gemini scam detection Cloud Function hit the free tier rate limit (429 Too Many Requests) during rapid testing. The client had no handling for the 429 case and showed an indefinite spinning loader. Root cause: the Cloud Function did not return a structured error response for 429, and the client had no branch for anything other than success. Fix: return { rateLimited: true } from the Cloud Function on 429, detect it client-side, and render a specific message.