CyberAg Documentation

Architecture

CyberAg is a serverless, event-driven platform on AWS with a React console, Gemini evaluation pipeline, and tamper-evident audit storage.

High-level diagram


Customer Estate (agents, MCP, NHIs)
        │
        ├── sync ──► Connectors Lambda ──► DynamoDB
        │
        └── runtime ──► Guardrail Gateway ──► EventBridge
                              │
                              ▼
                    ┌─────────────────────┐
                    │   cyberag-events    │
                    └─────────┬───────────┘
          ┌───────────────────┼───────────────────┐
          ▼                   ▼                   ▼
     API Lambda          Eval Workers         Replay Engine
          │                   │                   │
          └───────────────────┴───────────────────┘
                              │
                    DynamoDB + S3 Audit Vault

Repository layout

PathRole
apps/consoleOperator dashboard (Vite + React)
apps/marketingPublic marketing site
apps/docsStatic documentation portal
packages/uiDesign system + Storybook
packages/typesShared Zod schemas
packages/sdkTyped HTTP client
services/apiREST API Lambda
services/evalSQS-driven Gemini workers
services/guardrail-gatewayLow-latency runtime guardrail
services/connectorsConnector sync workers
services/replayDecision replay engine
infra/AWS CDK stacks

Data model (DynamoDB cyberag-main)

Single-table design with composite key pk / sk:

Entitypksk
AgentAGENT#{id}META
IdentityIDENTITY#{id}META
ConnectorCONNECTOR#{id}META
PolicyPOLICY#{id}v{version}
ViolationVIOLATION#{id}{iso-ts}
Guardrail eventGUARDRAIL#{id}{iso-ts}
Red team runREDTEAM#{id}{iso-ts}
Audit entryAUDIT#{id}{iso-ts}
ReplayREPLAY#{decisionId}{iso-ts}
Kill switchKILLSWITCHSTATE
Discovery graphDISCOVERY#GRAPHMETA

EventBridge (cyberag-events)

DetailTypeProducerConsumer
EvalRequestedAPIEval workers
RedTeamRunRequestedAPIEval workers
AskRequestedAPIEval workers
HardeningRequestedAPIEval workers
ReplayRequestedAPIReplay engine
ConnectorSyncRequestedAPI / schedulerConnectors
GuardrailBlockedGuardrailAudit / console feed

Local development stack

LocalStack emulates AWS on port **4566**. CDK deploys the same stacks via infra/bin/cyberag-local.ts.


Console (:3002) ──HTTP──► API Gateway (LocalStack)
                              │
                         Lambda functions
                              │
                    DynamoDB + S3 + EventBridge + SQS

Bootstrap: npm run start:local or step-by-step in LOCAL_SETUP.md.

Production vs local

FeatureLocalProduction
Regionus-east-1 (LocalStack)eu-west-1 workload
AuthBypassedCognito MFA
S3 retention7 days365 days COMPLIANCE
EncryptionAWS-managedKMS CMK
EdgeN/ACloudFront (us-east-1)

Eval models

  • **Gemini 2.5 Pro** — red team, policy lint, RAG, prompt hardening
  • **Gemini 2.5 Flash** — runtime guardrail classification
  • Results are signed (signedHash) and written to the Audit Vault.