If you don’t want to install Python locally, you can run AgentGuardian straight from a Docker image. The repo ships aDocumentation Index
Fetch the complete documentation index at: https://docs.agentguardian.io/llms.txt
Use this file to discover all available pages before exploring further.
Dockerfile and a
docker-compose.yml that build the image and serve the live dashboard
on port 7474.
What this example tests
- Same 10 ASI categories as a native install — the Docker image runs
the
agent-guardianconsole script unchanged. - The live dashboard at
http://localhost:7474(when you runserve), including per-scan transcript view and report download. - A clean isolation seam for CI: mount your contract / report directories and you don’t need Python on the runner.
Dockerfile,
docker-compose.yml.
Prerequisites
- Docker installed and running (
docker --version). - A clone of the AgentGuardian repo (the image is built from local
source — until v1.0.0 ships on PyPI, this is the recommended path;
see the commented PyPI-install variant at the top of the
Dockerfile). - For an authenticated scan: the relevant model API key available as an env var to pass into the container.
Run target
You don’t need a separate target service to demonstrate the Docker flow — point the container at the public AgentGuardian testbench (a deliberately-vulnerablefinbot banking agent hosted on Cloud Run):
uvicorn my_agent:app --port 8000) and use
host.docker.internal:8000 from inside the container.
Run AgentGuardian
One-shot scan from the image:./reports/scan.md on the host.
With an authenticated model:
docker-compose.yml runs agent-guardian serve --host 0.0.0.0 --port 7474, persists scan state to ./.agentguardian on the
host, and exposes the live dashboard on http://localhost:7474:
http://localhost:7474 to see live scans, completed reports, and
the per-scan transcript view. In another terminal you can drive scans
into the running container:
src/agent_guardian/cli.py:
--endpoint, --model, --mode, --output, --output-path (see
Scan a REST API agent for the flag-by-flag
breakdown).
Expected output
A one-shot scan prints the live progress panel and the report header to stdout, then writes the report file to the volume-mounted path:http://127.0.0.1:7474 URL is the in-container dashboard URL.
Inside the one-shot docker run, no server is running on that port —
use docker-compose if you want the dashboard reachable.)
The Markdown report at ./reports/scan.md opens with the standard
AgentGuardian header — same shape as a native scan:
Common errors
Cannot connect to the Docker daemon. Docker Desktop (or the daemon on Linux) is not running. Start it and re-run.docker buildfails onapt-get install. The image installs native libraries for WeasyPrint PDF rendering (libpango-1.0-0,libcairo2, etc.). A flaky Debian mirror is the usual culprit — retry, or build behind a proxy with--build-arg http_proxy=....- Report files don’t appear on the host. You forgot the
-v "$(pwd)/reports:/home/ag/reports"bind mount, or the path inside the container (--output-path) doesn’t match. The container runs as userag(uid 1000); make sure the host directory is writable by uid 1000. Connection refusedagainsthost.docker.internal:8000. On Linux,host.docker.internalneeds--add-host=host.docker.internal:host-gatewayon thedocker runcommand (Docker Desktop on macOS/Windows wires this automatically).No module named 'agent_guardian'. The image’s entry point isENTRYPOINT ["agent-guardian"]. Don’t passpython -m agent_guardian— pass scan subcommand args directly.
Next step
- For CI gating, the same
docker runpattern works in GitHub Actions — just call it from a workflow step. - For Python install instead of Docker, see Installation.
- To run the dashboard standalone (without docker-compose), use
agent-guardian serve --host 0.0.0.0 --port 7474as thedocker runcommand.