Deployment
Docker Compose
AgentSec ships with Docker Compose files for both local development and production.
Local Development
No TLS, no nginx, proxy exposed directly on port 3100:
cp agentsec.example.yaml agentsec.yaml
cp local.env.example .env
# Edit .env with real values (see Environment Variables)
docker-compose -f docker-compose.yaml -f docker-compose.local.yaml up --buildAudit logs are written to ./data/audit.jsonl (local directory, not a Docker volume).
Production
Includes nginx for TLS termination on port 443:
docker-compose up --buildServices:
| Service | Port | Purpose |
|---|---|---|
proxy | 3100 (internal) | AgentSec proxy |
nginx | 443 (public) | TLS termination, reverse proxy to proxy:3100 |
Audit logs are stored in a named Docker volume (audit-data) at /data/audit.jsonl.
TLS Setup
-
Place your certificate and key in
deploy/certs/:deploy/certs/cert.pemdeploy/certs/key.pem
-
Configure
deploy/nginx.confwith your domain and cert paths -
Start with
docker-compose up --build
Generating Secrets
# Encryption key (HMAC-SHA256 for agent auth)
openssl rand -hex 32
# Agent API keys (one per agent)
openssl rand -hex 32All keys are 64 hex characters (32 bytes). Store them in .env or pass via docker-compose --env-file.
Health Check
The proxy exposes GET /health (no auth required). Docker Compose is configured to check it every 30 seconds with 3 retries:
curl http://localhost:3100/healthBuilding from Source
cargo build --release
# Binary at target/release/agentsec-proxy
# CLI at target/release/agentsecSet environment variables directly (see Environment Variables) and run:
./target/release/agentsec-proxyProduction Checklist
- TLS enabled (never expose the proxy without encryption)
- Strong encryption key (
openssl rand -hex 32, not the example value) - Unique API key per agent (not shared between agents)
- Telegram bot token not shared with other services
- Audit log on persistent storage (Docker volume or mounted directory)
-
auto_approvepolicies reviewed (start restrictive, loosen as needed) - Rate limits configured for high-volume agents
-
allowed_approversset for sensitive credentials