Enterprise-Grade AI Agent Observability & Security Platform
Swagger UI with live API testing
AI shopping assistant with Gemini
Enterprise support automation
View source code and contribute
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.
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.
Before processing, every query passes through prompt injection detection. AgentGuard blocks malicious attempts including jailbreaks, role manipulation, data exfiltration, and other security threats.
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.
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.
gcloud CLI installed and configuredkubectl installedgit clone https://github.com/MouadDB/AgentGuard.git
cd AgentGuard
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"
# 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
cd agent
gcloud builds submit --tag gcr.io/YOUR-PROJECT-ID/agentguard
# 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
# 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}'
In Cloudflare (or your DNS provider):
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"
}'
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 - E-commerce shopping assistantit_helpdesk - IT support and troubleshooting{
"trace_id": "uuid",
"response": "Agent's response text",
"agent_path": ["main", "knowledge"],
"total_tokens": 150,
"total_cost": 0.000075,
"latency_ms": 850
}
# List sessions
GET /api/agents/sessions
# Get specific session
GET /api/agents/sessions/{session_id}
# Clear session memory
DELETE /api/agents/sessions/{session_id}
Customize agents in agent/config/:
agent_config.json - E-commerce agent settingsit_helpdesk_config.json - IT helpdesk agent settings{
"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"
}
GEMINI_API_KEY - Google Gemini API keyDD_API_KEY - Datadog API keyDD_APP_KEY - Datadog Application keyENVIRONMENT - production/developmentAgentGuard automatically sends:
agent.tokens.total - Total tokens consumedagent.cost.total - Total API costsagent.latency - Response time distributionsecurity.threats.detected - Security incidentsView your Datadog dashboard at: app.datadoghq.com