Inspiration: As generative AI transitions from static conversational chatbots to autonomous agents taking real actions in production, a critical security crisis has emerged. Today, prompt injections and delimiter bypasses represent the #1 vulnerability in the OWASP Top 10 for LLMs. In high-stakes industries like Fintech, Healthcare, and Enterprise IT, an unhardened system prompt can lead to catastrophic data leaks—such as customer credit card numbers, database master salts, and private authentication keys.

Traditionally, securing and red-teaming an AI application takes 2 to 3 weeks of manual engineering labor, tedious spreadsheet tracking, and endless trial-and-error prompt rewrites.

My primary motive in entering the Google All Things Agentic Global Hackathon was to dive deep into cutting-edge autonomous multi-agent architectures, explore the power of Google Gemini 3.7 Flash, and learn by actively building a real, production-ready solution. I wanted to push the boundaries of "The Taskmaster" track by proving that AI agents don't just execute instructions—they can autonomously diagnose, attack, self-heal, and deploy their own fortified models with zero human in the loop, creating a competitive, prize-worthy solution.

What it does: AutoGuard AI is an autonomous SecOps Taskmaster agent that executes the entire end-to-end AI security auditing and prompt-hardening lifecycle:

  1. Threat Modeling & Ingestion: Analyzes the target agent's system prompt, compliance rules (PCI-DSS, HIPAA, SOC-2), and confidential constants.
  2. Adversarial Red-Team Synthesis: Uses Google Gemini 3.7 Flash to autonomously generate 50+targeted adversarial attack payloads across 6 threat vectors (Delimiter Escapes, Encoded Injections, DAN Jailbreaks, PII Probes, System Extraction, Grounding Traps).
  3. Parallel Sandboxed Probing: Dispatches concurrent, non-blocking execution batches against the target agent.
  4. Vulnerability Critic: Evaluates model responses with regex scanners and LLM Judge metrics, identifying critical leaks (Baseline Safety Score: initial≈28.4%).
  5. Evolutionary Self-Healing Loop: Autonomously mutates the system prompt, injecting Model Armor (cryptographic delimiter containment, immutable directive hierarchies, anti-DAN shields) until the safety score reaches: ΔS=Sfinal−Sinitial≥+65.0%⟹Sfinal 98.0% (Grade A+)
  6. Cloud Delivery & Verification: Packages the fortified agent as a container microservice for Google Cloud Run, persists audit records in Google Cloud Firestore, and issues a machine-verifiable Security Audit Report & Passport.

How we built it: AutoGuard AI was built using a full-stack Google Cloud & FastAPI architecture:

  1. Google GenAI SDK (google-genai): Integrated directly into our PlannerAgent, RedTeamAgent, and PromptOptimizerAgent to leverage Gemini 3.7 Flash’s hybrid reasoning for adversarial payload generation and prompt mutations.
  2. Autonomous DAG State Machine: Implemented 6 distinct agent stages executing asynchronously via non-blocking worker pools (asyncio.gather).
  3. Real Git-Style Prompt Diff: Built a redlined git diff engine showing exact additions (+12) and deletions (-3) in the prompt text.
  4. Dual-Track Combat Arena: Created a live side-by-side simulator with typewriter token streaming (~16ms/char) and measured confidence meters (99.4% Vulnerability vs. 98.8% Mitigation).

Challenges I ran into:

  1. Preventing Prompt Optimization Hallucination: Early iterations of prompt mutations occasionally softened security directives to preserve conversational fluency. We solved this by creating a strict Immutable Security Directives Hierarchy that mathematically isolates user inputs inside ... envelopes.
  2. Real-Time Streaming in Serverless Environments: Handling persistent Server-Sent Events (SSE) across serverless execution contexts required designing a resilient client-side event bus that synchronizes DAG node states and laser animations with zero UI lag.
  3. Scoring Multi-Vector Vulnerabilities Accurately: Determining whether an attack succeeded required combining deterministic regex scanners (for PII and API keys) with semantic LLM Judge evaluations to eliminate false positives.

Accomplishments that I'm proud of:

  1. 100% Automated Test Suite Passing: All 9 unit and integration tests passing with complete test coverage (pytest tests/ -v).
  2. Measurable Engineering ROI: Transformed a 28.4% vulnerable baseline into a 98.6% Grade A+ hardened agent in under 30 seconds, saving approximately ∼24 to 36 hours of manual red-teaming.
  3. High-Fidelity SecOps UI/UX: Designed a distinct Google 4-color ambient console with active laser sweep animations, live typewriter token streams, and a machine-verifiable HTML Security Passport export.
  4. Dynamic Multi-Domain Support: Seamlessly switches across Fintech (PCI-DSS), Healthcare (HIPAA), and Corporate HR (SOC-2) blueprints with custom threat modeling What I learned:
  5. Advanced Agentic Orchestration: Mastered the architecture of autonomous DAG state machines where multiple specialized agents collaborate without human prompts between steps.
  6. Adversarial LLM Attack Mechanics: Learned how delimiter escapes, base64 obfuscations, and hypothetical pretext framing operate—and how to build provable countermeasures like cryptographic delimiter envelopes.
  7. Google GenAI SDK Capabilities: Gained deep hands-on expertise with Google Gemini 3.7 Flash and serverless microservice delivery on Google Cloud Run and Firestore.

What's next for AutoGaurd AI:

  1. Automated CI/CD GitHub Action: Expanding AutoGuard into a GitHub Action that automatically red-teams and blocks vulnerable system prompt pull requests before merging.
  2. Multi-Modal Red-Teaming: Adding adversarial image and audio injection probing using Gemini 3.7 Pro's native multimodal capabilities.
  3. Autonomous Firewall Sidecar: Deploying a live proxy sidecar on Google Cloud Run that dynamically sanitizes real-time user inputs before they reach production LLMs.

Built With

  • ai-agents
  • ai-safety
  • asyncio
  • autonomous-agents
  • chartjs
  • fastapi
  • gemini-3.7-flash
  • google-cloud
  • google-cloud-firestore
  • google-cloud-run
  • google-gemini
  • google-genai-sdk
  • llm-security
  • prompt-hardening
  • pytest
  • python
  • red-teaming
  • rest-api
  • tailwind-css
  • taskmaster
  • uvicorn
  • vercel
  • vertex-ai
Share this project:

Updates