Enterprise-Grade AI Agent Observability & Security Platform

All systems operational
๐Ÿ“š

Interactive API Docs

Swagger UI with live API testing

๐Ÿ›’

E-Commerce Demo

AI shopping assistant with Gemini

๐Ÿข

IT Helpdesk Demo

Enterprise support automation

๐Ÿ“ฆ

GitHub Repository

View source code and contribute

๐Ÿค– How AgentGuard Works

AgentGuard is a multi-agent orchestration platform that routes user queries through specialized AI agents while enforcing security guardrails and tracking performance with full observability.

1๏ธโƒฃ Query Reception & Routing

When a query arrives via /api/agents/query, the Main Agent analyzes the intent and routes it to the appropriate specialist agent (E-commerce Assistant, IT Helpdesk, etc.) based on configured routing rules.

2๏ธโƒฃ Security Scanning

Before processing, every query passes through prompt injection detection. AgentGuard blocks malicious attempts including jailbreaks, role manipulation, data exfiltration, and other security threats.

3๏ธโƒฃ Agent Processing

The specialized Knowledge Agent uses Google Gemini 2.0 with domain-specific context, conversation memory, and pre-configured guardrails defining allowed actions and data boundaries.

4๏ธโƒฃ Observability & Tracing

Every interaction is traced end-to-end with Datadog APM. Track tokens, costs, latency, security incidents, and custom metrics in real-time dashboards with automated alerting.

๐Ÿš€ Deployment Guide

Prerequisites

Step 1: Clone Repository

git clone https://github.com/MouadDB/AgentGuard.git
cd AgentGuard

Step 2: Configure Secrets

Encode your API keys:

# Encode your keys
echo -n "your-gemini-api-key" | base64
echo -n "your-datadog-api-key" | base64
echo -n "your-datadog-app-key" | base64

Edit k8s/secrets.yaml with the base64-encoded values:

data:
  GEMINI_API_KEY: "your-base64-encoded-key"
  DD_API_KEY: "your-base64-encoded-key"
  DD_APP_KEY: "your-base64-encoded-key"

Step 3: Create GKE Cluster

# Create static IP
gcloud compute addresses create agentguard-ip --global

# Create cluster (1 node for cost optimization)
gcloud container clusters create agentguard-cluster \
  --zone europe-west1-b \
  --num-nodes 1 \
  --machine-type e2-medium \
  --enable-autorepair \
  --enable-autoupgrade

Step 4: Build & Push Docker Image

cd agent
gcloud builds submit --tag gcr.io/YOUR-PROJECT-ID/agentguard

Step 5: Deploy to Kubernetes

# Create namespace
kubectl create namespace agentguard

# Apply configurations
kubectl apply -f k8s/configmap.yaml -n agentguard
kubectl apply -f k8s/secrets.yaml -n agentguard
kubectl apply -f k8s/deployment.yaml -n agentguard

Step 6: Get External IP

# Wait for ingress to provision (5-10 minutes)
kubectl get ingress -n agentguard

# Get the external IP address
kubectl get ingress agentguard-ingress -n agentguard \
  -o jsonpath='{.status.loadBalancer.ingress[0].ip}'

Step 7: Configure DNS

In Cloudflare (or your DNS provider):

๐Ÿ“– API Usage Guide

Basic Query Request

curl -X POST https://your-domain.com/api/agents/query \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "query": "What products do you have?",
    "agent_type": "agent"
  }'

With Conversation Memory

curl -X POST https://your-domain.com/api/agents/query \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "query": "Tell me more about the first one",
    "session_id": "session_123",
    "agent_type": "agent"
  }'

Agent Types

Response Format

{
  "trace_id": "uuid",
  "response": "Agent's response text",
  "agent_path": ["main", "knowledge"],
  "total_tokens": 150,
  "total_cost": 0.000075,
  "latency_ms": 850
}

Session Management

# List sessions
GET /api/agents/sessions

# Get specific session
GET /api/agents/sessions/{session_id}

# Clear session memory
DELETE /api/agents/sessions/{session_id}

โš™๏ธ Configuration

Agent Configuration

Customize agents in agent/config/:

Example Agent Config

{
  "agent_name": "E-commerce Assistant",
  "description": "Shopping assistant",
  "system_prompt": "You are a helpful...",
  "knowledge_base": {
    "products": {
      "keywords": ["product", "buy"],
      "response": "We have..."
    }
  },
  "allowed_actions": ["search", "recommend"],
  "security_level": "high"
}

Environment Variables

๐Ÿ“Š Monitoring & Observability

Datadog Integration

AgentGuard automatically sends:

Key Metrics

Access Dashboards

View your Datadog dashboard at: app.datadoghq.com

๐Ÿ’ฐ Cost Optimization

Current Setup (~$50/month)

Further Optimizations