Inspiration

AI-generated content is rapidly being adopted across industries. But with that comes serious risks, misinformation, algorithmic bias, and legal violations. Inspired by real-world failures of ethical oversight (biased hiring algorithms, unsafe chatbot responses, and GDPR violations), we wanted to create an autonomous system that can act as a pre-screening firewall for AI prompts or generated text. The idea evolved into a multi-agent governance model where different agents play specific roles (Ethics, Compliance, Bias, Critique, and Final Decision), just like human review boards or committees.

What it does

EthicalGuard is an AI firewall for responsible content generation. It uses a multi-agent system built on Google’s Agent Development Kit (ADK) to rigorously analyze and classify any AI prompt or generated output. Here's what it does:

  • Ethical Evaluation: Detects prompts or content that could cause societal harm, misinformation, or unethical behavior.
  • Compliance Review: Ensures outputs adhere to legal, policy, and regulatory standards (e.g., GDPR, HIPAA).
  • Bias Detection: Flags discriminatory, prejudiced, or unfair language that could marginalize individuals or groups.
  • Critique & Validation: Cross-reviews findings using a dedicated LLM critique agent for depth and accuracy.
  • Final Arbiter: Aggregates all agent feedback and issues a verdict: [SAFE], [RISK], or [BLOCK].

All agents operate in a hybrid architecture combining parallel and sequential execution for speed, contextual awareness, and performance. The result is an explainable, modular, and production-ready solution for AI content safety.

How we built it

  • Tech Stack:

  • Agent Design:

    • EthicsAgent – flags moral harm, misuse, safety risks.
    • ComplianceAgent – checks legal, privacy, and regulatory risks.
    • BiasDetectionAgent – detects discrimination and social bias.
    • LLMCritiqueAgent – critiques reports for gaps or overreach.
    • FinalArbiterAgent – synthesizes all inputs and classifies output as [SAFE], [RISK], or [BLOCK].
  • Architecture Highlights:

    • Mix of parallel and sequential execution using SequentialAgent and ParallelAgent
    • Central root_agent orchestrates the pipeline.
    • Session context (AgentContext) used to store inter-agent state.

Challenges we ran into

  • Aligning agents to avoid conflicting outputs - e.g., EthicsAgent might flag a prompt that ComplianceAgent finds clean.
  • Ensuring low latency while running agents both sequentially and in parallel.
  • Building testable, observable agents that could integrate into adk eval and FastAPI endpoints.
  • Setting up a modular architecture that could be deployed to Google Cloud Run with minimal friction.

Accomplishments that we're proud of

  • Built a complete multi-agent ethical AI governance pipeline from scratch in under a week.
  • Created a real-time, decision-grade content safety system using ADK and Gemini models.
  • Designed clear agent-to-agent reasoning with intermediate state sharing (AgentContext).
  • Integrated parallel and sequential orchestration to optimize both speed and accuracy.
  • Successfully deployed the project on Google Cloud Run, making it API-accessible and scalable.
  • Used context tracking and rationale outputs to ensure each decision is explainable and auditable.
  • Went beyond simple prompt filtering providing nuanced, structured evaluation that reflects real-world AI ethics board reviews.

What we learned

Building EthicalGuard was more than just assembling agents - it was an exploration into the heart of ethical AI.

  • The complexity of judgment: We learned that detecting harmful, biased, or unethical content isn’t binary. It requires nuance, context-awareness, and interdisciplinary reasoning - all of which we had to encode into autonomous agents.
  • Multi-agent orchestration is powerful and tricky: Designing agents that operate independently but collaborate meaningfully took thoughtful architecture. We balanced speed (parallel agents) with dependency (sequential flows) to get both efficiency and coherence.
  • Agent memory and shared context matter: Allowing agents to learn from each other’s outputs using AgentContext improved decision quality. Without this, agents behaved like silos.
  • Ethics isn’t universal: We were forced to confront tough questions - what counts as “bias”? What legal frameworks matter in different geographies? Building flexibility into the system was a key insight.
  • ADK is an amazing foundation: Google's Agent Development Kit made modular agent design seamless. Understanding how to build, evaluate, and deploy with ADK was a game-changer.

What's next for EthicalGuard: Multi-Agent Ethical AI Risk Evaluator

We’re just getting started. Here's where we're heading next:

  • Auto-fine-tuning agents based on evaluation results Each agent will learn and adapt over time based on feedback loops and evalset performance.
  • Dynamic risk scoring instead of fixed labels Move from categorical outputs ([SAFE], [RISK], [BLOCK]) to probabilistic scoring, enabling deeper integration into moderation pipelines.
  • International legal compliance profiles Add localization: GDPR in the EU, CCPA in the US, PIPEDA in Canada — all as agent modules.
  • Pluggable agents for custom org policies Enable organizations to plug in their own policy review agents to extend EthicalGuard for enterprise use.
  • Seamless integration via API + webhook triggers Make EthicalGuard fully embeddable into AI pipelines like content generation platforms, chatbots, or LLM-based tools.

Built With

Share this project:

Updates

Submission history