Contributing
Repository Structure
A map of the AgentShield repository. Where each service, library, contract, migration, and deployment file lives.
control-plane — NestJS management API
dashboard — Next.js operations console
intelligence-engine — Python content analysis
docs — this documentation site (Next.js + Fumadocs)
gateway — Go gateway, event relay, chaos harness
policy-engine — deterministic evaluator (Go library)
identity — v1 request signature (Go library)
examples/sample-agent
benchmarks
tests — repository contracts and Python integration tests
scripts — test.ps1, lint.ps1
docker-compose.yml, Makefile, go.work, package.json
Sources of truth
| Concern | Source of truth | Rule |
|---|---|---|
| Database schema | infrastructure/docker/postgres/migrations/ | Schema changes are new SQL files. No framework creates tables from classes |
| API contracts | docs/api/*.openapi.yaml | Change OpenAPI and implementation together; unfinished routes stay unregistered |
| Authorization rules | docs/adr/0004-authorization-decisions.md and runtime/policy-engine | Precedence and default deny are normative |
| Signing input | docs/adr/0003-agent-identity.md and runtime/identity | SDKs reproduce it and pass the shared vector |
| Design decisions | docs/adr/ | Moving a boundary, rule, or store needs an ADR |
Module boundaries
runtime/policy-engineandruntime/identityare libraries with no storage or network clients.- Services share contracts, not code: there is no shared database module or ORM model.
- The gateway's
internal/authzdepends on interfaces; PostgreSQL and Redis implementations are wired incmd/gateway. - Integrations depend only on the Python SDK and their framework.
The documentation site
apps/docs is a standalone Next.js application using Fumadocs. It is intentionally not an npm workspace of the root, so its dependencies cannot affect the services. It keeps a synced copy of docs/api/*.openapi.yaml in apps/docs/openapi/, refreshed by npm run sync:openapi (run automatically before dev and build), and renders the API reference from it.
Was this page helpful?