Inspiration

My inspiration for Project Aegis came from a critical observation of the enterprise world's approach to Generative AI. I saw that while the potential for innovation was massive, enterprises in regulated industries like finance and healthcare were paralyzed by risk. Their governance tools were static checklists and reactive filters, completely outmatched by the dynamic nature of AI models and the ever-evolving landscape of regulations like GDPR and the EU AI Act. This created a bottleneck, turning AI into a potential liability rather than a scalable asset. I was inspired to build a solution that transforms governance from a blocker into an enabler. I didn't want to build another simple gatekeeper; I wanted to create an active defense system—an intelligent co-pilot that would make it safe for enterprises to innovate at full speed.

What it does

Project Aegis is a multi-agent AI co-pilot, built on Amazon Bedrock, that serves as an intelligent and active governance layer for enterprise AI. When a developer submits a prompt, Aegis intercepts it and initiates a collaborative workflow between specialized AI agents.

First, a Prompt Guard Agent scans the request, instantly redacting sensitive Personally Identifiable Information (PII) like names or addresses. The sanitized prompt is then passed to the Policy Enforcer Agent, the system's intelligent core. This agent uses Retrieval-Augmented Generation (RAG) to query a knowledge base containing the full text of regulations like GDPR. It checks the user's intent against these policies to determine if the request is compliant.

If the request is non-compliant, it's blocked. If it's compliant (or has been made compliant through redaction), the system generates a response. Throughout this process, an Audit Logger Agent records every single action—the initial prompt, the redaction, the policy check, and the final output—into an immutable ledger on Amazon Quantum Ledger Database (QLDB), creating a cryptographically verifiable audit trail for regulators.

Crucially, Aegis is designed to be educational, not punitive. If a prompt is ever blocked or modified, an Advisory Agent provides a clear, user-friendly explanation, citing the specific regulation that was enforced and suggesting a compliant alternative. This real-time feedback loop coaches developers on responsible AI usage. All of this is made transparent to the user through a modern web dashboard featuring a real-time "Agent Trace" visualizer, which shows exactly how each agent contributes to the final, safe output.

How I built it

I built Aegis on a serverless architecture using a suite of powerful AWS services to ensure scalability and focus on the core logic.

The backbone of the system is a collection of AWS Lambda functions, with each function representing a specialized agent. I started by creating the Supervisor Agent, the central orchestrator that manages the entire workflow. I then developed the other agents: the PromptGuard Agent implemented with simple regex for fast PII redaction and the PolicyEnforcer Agent which uses the AWS SDK to call the Bedrock API.

The "brain" of the Policy Enforcer is an Amazon Bedrock Knowledge Base. To create this, I first provisioned an S3 bucket and uploaded a text file containing key articles from the GDPR. I then configured a new Knowledge Base in the Bedrock console, pointing it to my S3 bucket. Bedrock handled the complex pipeline of chunking the document, generating embeddings with Amazon Titan Text Embeddings, and creating a queryable vector store in Amazon OpenSearch Serverless automatically. This allowed the PolicyEnforcer to check prompts against regulations using a single RetrieveAndGenerate API call.

To ensure a tamper-proof system of record, I provisioned an Amazon QLDB ledger and built a dedicated Audit Logger Agent using the QLDB driver to write immutable, cryptographically-chained records of every transaction.

For the user interface, I chose React 19. I built the core UI for prompt submission and designed the components for the "Agent Trace" visualizer.

Finally, I exposed the Supervisor Agent's Lambda function to the frontend application using an Amazon API Gateway HTTP API, which acts as the secure and scalable front door for the entire system.

Challenges I ran into

One of the first major challenges was orchestrating the multi-agent workflow. Ensuring that the Supervisor agent could sequentially invoke other Lambda functions, pass the evolving state of the prompt between them, and gracefully handle decisions (like blocking a request) required careful use of asynchronous code and a clear data contract between the agents.

Another significant hurdle was designing a system that was transparent and not a "black box." My vision for the "Agent Trace" visualizer meant I couldn't just return a final answer. I had to architect the backend to return a detailed JSON object that included a step-by-step summary of each agent's input, decision, and output. Then, on the frontend, I had to build a dynamic UI that could parse this data and render the visual trace, which was a considerable design and engineering challenge.

Finally, I had to be strategic about balancing performance and cost. It would have been easy to use a powerful model like Claude 3.5 Sonnet for every task, but that would introduce unnecessary latency and expense. The challenge was to create a multi-model architecture where I deliberately chose a faster, more cost-effective model like Titan Text Lite for high-volume, low-complexity tasks like PII filtering, while reserving the more powerful model for the complex reasoning required by the Supervisor and Policy Enforcer agents.

Accomplishments that I’m proud of

I’m incredibly proud of successfully moving beyond the concept of static, reactive governance. Aegis represents a paradigm shift to "governance-as-code," where the rules are dynamic, intelligent, and enforced by AI itself. Creating a system that can ingest a dense regulatory document and use it to make real-time compliance decisions is a massive accomplishment.

The integration with Amazon QLDB is another point of pride. I didn't just build a logging system; I built a cryptographically verifiable, immutable audit trail. This feature alone elevates Aegis from a helpful tool to an enterprise-grade system of record that can stand up to the scrutiny of regulators and auditors, providing the mathematical proof of compliance that businesses need.

Finally, I'm proud of the user experience, particularly the vision for the "Agent Trace" visualizer. By providing radical transparency into the governance process, I'm demystifying AI safety and turning a potential point of friction into an intuitive and engaging interaction for developers.

What I learned

This project was a deep dive into building production-ready AI systems, and I learned several key lessons. First and foremost, I learned the immense power of using purpose-built, managed AWS services. Using Bedrock Knowledge Bases abstracted away the incredible complexity of building a RAG pipeline, and using QLDB gave me a tamper-proof ledger out of the box. Relying on these services allowed me to focus on the unique logic of my application rather than on reinventing the wheel.

I also learned the critical importance of a multi-model strategy. In the world of GenAI, one size does not fit all. Deliberately selecting different models for different tasks based on their capability, speed, and cost is essential for building an optimized and efficient system.

Most importantly, I learned that for enterprise AI, the process is just as important as the outcome. Simply blocking a risky prompt isn't enough. You have to explain why it was blocked and provide an auditable record of that decision. This reinforced my conviction that features like the Advisory Agent and the immutable QLDB ledger are not just nice-to-haves; they are fundamental requirements for building trust and driving responsible AI adoption.

What's next for Aegis

The MVP I've built is just the beginning. The roadmap for Aegis is ambitious and focused on pushing the boundaries of AI governance.

My immediate next step is to implement a seven-agent system. This includes building the Pre-emptive Risk Assessor, an innovative agent that uses a predictive model on Amazon SageMaker to score prompts for nuanced risks that simple filters would miss. I will also build the Output Auditor to scan for bias and fairness in the final response.

Next, I will develop the companion React Native mobile app for compliance officers to monitor high-risk events on the go.

A top priority is enhancing the Policy Enforcer Agent with multi-modal capabilities. I plan to leverage the vision features of models like Claude 3.5 Sonnet to allow Aegis to analyze not just text, but also diagrams, flowcharts, and tables within regulatory documents and user-uploaded architecture plans.

Finally, I'll add a layer for Role-Based Access Control (RBAC) by integrating a user directory in DynamoDB, allowing Aegis to apply different policies based on a user's specific role and permissions within the organization. My goal is to make Aegis the definitive, indispensable platform for safe and scalable enterprise innovation with AI.

Built With

  • agents-for-amazon-bedrock
  • amazon-api-gateway
  • amazon-bedrock
  • amazon-dynamodb
  • amazon-opensearch-serverless
  • amazon-quantum-ledger-database-(qldb)
  • amazon-titan-text-embeddings-g1
  • amazon-titan-text-lite
  • amazon-web-services
  • anthropic's-claude-3.5-sonnet
  • aws-lambda
  • bedrock-guardrails
  • bedrock-retrieveandgenerate-api
  • git
  • javascript-(es6)
  • knowledge-bases-for-amazon-bedrock
  • node.js
  • python
  • react
Share this project:

Updates