Deployment Architecture
How AgentShield is packaged and deployed. Hardened containers, Docker Compose profiles, Kubernetes overlays, network policy, and signed releases.
AgentShield ships as five container images and two deployment descriptions: Docker Compose for workstations and CI, and Kustomize manifests for Kubernetes.
Images
| Image | Built from | Base | Health check |
|---|---|---|---|
gateway | runtime/gateway/Dockerfile (target gateway) | distroless/static-debian12:nonroot | gateway healthcheck |
event-relay | runtime/gateway/Dockerfile (target event-relay) | distroless/static-debian12:nonroot | event-relay healthcheck |
control-plane | apps/control-plane/Dockerfile | node:22-alpine, user node | Container HEALTHCHECK |
dashboard | apps/dashboard/Dockerfile | node:22-alpine, user node | Container HEALTHCHECK |
intelligence | apps/intelligence-engine/Dockerfile | python:3.12-slim, UID 10001 | Container HEALTHCHECK |
Every image is multi-stage, uses digest-pinned bases, and runs as a non-root user. Go images are about 22 MB.
Docker Compose
| Command | Starts |
|---|---|
docker compose up -d | Data services only, for running applications from source |
docker compose --profile app up -d --build | Data services and all five applications |
… --profile app --profile observability up -d --build | Also Prometheus and Grafana |
Every published port binds to 127.0.0.1. Application containers run with read_only: true, no-new-privileges, and cap_drop: ALL. See Docker Compose.
Kubernetes
Network policy, as defined in the base:
| Service | May accept | May open |
|---|---|---|
| Gateway | Agents on 8081 | PostgreSQL, Redis, the analyzer, public HTTPS (private and link-local ranges excluded) |
| Intelligence | The gateway only | Nothing |
| Control plane | The dashboard only | PostgreSQL, object storage, SMTP |
| Dashboard | Users on 3000 (the ingress controller in production) | The control plane |
| Event relay | Metrics scrapes only | PostgreSQL, NATS, object storage |
Every other path is denied. Metrics ports additionally accept pods labelled agentshield.io/metrics-scraper: "true".
The base enforces:
- Pod Security. The
agentshieldnamespace enforces therestrictedPod Security Standard: non-root, seccompRuntimeDefault, no privilege escalation, all capabilities dropped, read-only root filesystem, and no service account token. - Default-deny networking in both directions, then per-service allowances. The analyzer accepts only the gateway and opens no connections. In the production overlay it runs as a sidecar in the gateway pod, on loopback, so it is unreachable from outside the pod. The gateway's outbound HTTPS excludes private, loopback, carrier-grade NAT, and link-local ranges, repeating the
http.requestadapter's SSRF checks at the network layer. - The app role everywhere. Every service connects as
agentshield_app, even in the dev overlay. Only the bootstrap Job uses the schema owner.
| Overlay | Purpose |
|---|---|
base/ | Services, configuration, network policies |
overlays/dev/ | Whole stack on a local cluster with in-cluster data stores |
overlays/production/ | Published images, two replicas, disruption budgets, ingress, analyzer as a loopback sidecar of the gateway |
NetworkPolicy takes effect only with a network plugin that enforces it. See Kubernetes.
Signed releases
.github/workflows/release.yml runs only on a v*.*.* tag or by hand. It builds each image for amd64 and arm64, attaches an SBOM and maximal build provenance, pushes to ghcr.io/<owner>/agentshield-<service>, and signs the digest with cosign keyless signing bound to the repository's release workflow through GitHub OIDC. No signing key exists to leak, and every third-party action is pinned to a commit.
Continuous integration
CI builds every image, starts the Compose stack, waits for readiness, verifies non-root users and read-only filesystems, bootstraps an owner and signs in, checks that Prometheus scrapes every service, and deploys the dev overlay to a kind cluster, where it verifies that the analyzer refuses everything except the gateway.
Implementation references
Was this page helpful?