AIMux is a security-focused service mesh for AI agent networks. It provides centralized governance over agent-to-agent communication through identity-based access control, semantic routing, and audit logging.
The Challenge: How do you monitor and control what AI agents can access? Traditional API gateways lack agent intent understanding.
The Solution: AIMux enforces policy at the infrastructure level rather than relying on agents for self-governance.
Get AIMux running in under 2 minutes:
git clone https://github.com/techspeque/aimux.git
cd aimux
make runTest it out:
# Basic query
curl "http://localhost:8080?q=what+is+50+times+3"
# View dashboard
curl "http://localhost:8080/dashboard/"Run a full Agent Service Mesh simulation demonstrating semantic routing, ACL enforcement, and authentication:
make demobrew install techspeque/aimux/aimuxdocker run -p 8080:8080 ghcr.io/techspeque/aimux:latestPre-built binaries for Linux and macOS:
curl -LO https://github.com/techspeque/aimux/releases/latest/download/aimux-linux-amd64.tar.gz tar -xzf aimux-linux-amd64.tar.gz ./aimux --config aimux.yamlRequires Go 1.22+:
git clone https://github.com/techspeque/aimux.git
cd aimux
make buildAIMux uses a YAML configuration file to define server settings, semantic engine parameters, agents, and routes.
server:
port: 8080
logging:
level: info
timestamp: true
semantic_engine:
model_path: "./models/all-MiniLM-L6-v2.onnx"
min_score: 0.40
ambiguity_threshold: 0.05
agents:
- finance-bot
- admin-bot
- data-processor
routes:
- name: "finance"
upstream: "http://finance:8001"
intents:
- "analyze budget"
- "forecast revenue"
- "quarterly earnings"
allowed:
- finance-bot
- admin-bot
- name: "admin"
upstream: "http://admin:8004"
intents:
- "delete users"
- "reset database"
allowed:
- admin-bot
fallback:
upstream: "http://ollama:11434"server.port - HTTP server port (default: 8080)logging.level - Log level: debug, info, warn, errorsemantic_engine.min_score - Minimum similarity threshold (0-1)semantic_engine.ambiguity_threshold - Max score difference for ambiguity detectionagents - List of registered agent identitiesroutes - Semantic routes with intents and ACLsfallback.upstream - Default route when no semantic match foundAIMux extracts agent identity in priority order:
client_id, agent, sourceX-Source-Agent, X-Client-IDagent fieldExample:
# Via query param
curl "http://localhost:8080?client_id=finance-bot&q=analyze+revenue"
# Via header
curl -H "X-Source-Agent: finance-bot" \
-d '{"query": "analyze revenue"}' \
http://localhost:8080Specific agents only via allowed field:
routes:
- name: "admin"
upstream: "http://admin:8004"
allowed:
- admin-bot # Only admin-bot can accessAll registered agents using wildcard:
routes:
- name: "public-api"
upstream: "http://api:8000"
allowed:
- "*" # Any registered agentNo ACL field means all access including anonymous:
routes:
- name: "health"
upstream: "http://health:8080"
# No 'allowed' field = completely openAgent names must use snake_case or kebab-case:
✓ Valid
✗ Invalid
401 Unauthorized - Unregistered client identity403 Forbidden - Client not permitted for route or anonymous access to restricted route409 Conflict - Ambiguous route matching (multiple routes with similar scores)AIMux exposes several management and observability endpoints:
/healthzHealth check endpoint
/metricsPrometheus metrics endpoint
/routesList all configured routes
/agentsList all registered agents
/configView current configuration
/dashboard/Built-in web UI for monitoring
AIMux accepts standard OpenAI chat completion format:
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Source-Agent: finance-bot" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "user", "content": "analyze Q3 revenue"}
]
}'make buildmake testEnable detailed logging in your config:
logging:
level: debug
timestamp: trueAIMux is released under the MIT License. Free for personal and commercial use.