AWS Builder Center
Weekend Creative Agent Challenge: The Sentinel's Chronicle

Weekend Creative Agent Challenge: The Sentinel's Chronicle

An always-on AWS agent that turns real Amazon GuardDuty security findings into narrative chronicles using Amazon Bedrock Nova Lite — event-driven, memory-aware, and built with multi-layer redaction so no sensitive AWS account data ever reaches the AI or the public site.

AWS Community Builder | DevOps & Cloud Engineer
Security teams are drowning in alerts. Amazon GuardDuty findings arrive as cold, technical JSON — accurate, but easy to skim past and easy to ignore. The Sentinel's Chronicle is an always-on AWS agent that turns those same findings into short narrative chronicles: a calm watch-note for a low-severity finding, a genuinely urgent dark tale for a critical one — readable by technical and non-technical stakeholders alike, with zero manual triggering.

Vision & what it does

Most creative agents this challenge produced wake up on a timer and generate content whether or not anything actually happened. The Sentinel works differently: it wakes up only when something real occurs. When Amazon GuardDuty detects a genuine security signal — reconnaissance, unauthorized access, anomalous behavior — that event flows through Amazon EventBridge directly into the agent. Nothing runs on a schedule; nothing runs without cause.
Each chronicle is written to match the finding's real severity, using an evolving "style memory" stored in Amazon DynamoDB so the Sentinel's narrative voice refines itself over time rather than repeating the same patterns findings after finding. The result reads less like a log line and more like an entry in a watch-keeper's journal — useful context a security team can actually retain, not just another alert to dismiss.

How I built it

Core workflow: GuardDuty finding → EventBridge → Lambda → Bedrock Nova Lite → DynamoDB → API Gateway → CloudFront-served S3 site.
Key decision — event-driven over scheduled. An EventBridge rule subscribes directly to GuardDuty finding events rather than polling on a cron schedule. This keeps the agent genuinely reactive, avoids wasted invocations when nothing is happening, and keeps cost close to zero on AWS Free Tier since Lambda only runs when there's real signal to process.
Key decision — security-first by design, not as an afterthought. Since this agent's entire subject matter is security findings, I treated data protection as a first-class requirement rather than a final pass:
  • Multi-layer output redaction. Every AI-generated chronicle and every API response is scrubbed for AWS account IDs, IPv4/IPv6 addresses, ARNs, EC2 instance IDs, S3 bucket names, security group IDs, VPC/subnet IDs, API Gateway and CloudFront IDs, UUIDs, email addresses, and IAM user/role names — so no real infrastructure identifier ever reaches a public page.
  • Private S3 + CloudFront Origin Access Identity (OAI). The frontend bucket has Block Public Access fully enabled; the only path in is through CloudFront, which holds exclusive read access via OAI.
  • Least-privilege IAM. The Lambda execution role is scoped to exactly  dynamodb:GetItem  /  PutItem  /  Scan ,  bedrock:InvokeModel  /  Converse , and the minimum CloudWatch Logs actions — nothing broader.
  • Strict prompt boundaries. The Bedrock prompt explicitly instructs the model not to invent facts, IP addresses, or attacker motives, and to follow severity-scaled tone rules (quiet warning for severity 0–3, escalating to an urgent dark chronicle at 7–10).
Challenges encountered:
  1. Nova model region compatibility. In  ap-southeast-1 , Nova Lite wasn't reachable via the Converse API the way I expected. Fixed by deploying the Bedrock-calling Lambda in  us-east-1 , where Nova Lite has full Converse API support.
  1. S3 bucket ACL errors. Modern S3 buckets don't support ACLs by default, which broke my first access-control approach. Solved by dropping ACLs entirely in favor of bucket policies plus a CloudFront OAI for controlled read access.
  1. Account ID leakage in AI output. Even with a sanitized prompt, Bedrock occasionally generated text containing 12-digit numbers that resembled real AWS account IDs. Fixed with the multi-pass post-generation redaction layer described above — never trust a single filtering pass when the model can still hallucinate plausible-looking identifiers.
  1. CORS errors between frontend and API Gateway. The static frontend couldn't call the API until CORS headers were explicitly configured on both the API Gateway routes and the Lambda responses.


AWS services used / architecture overview

Service
Role
Amazon GuardDuty
Real threat-detection source — the agent's actual trigger
Amazon EventBridge
Routes GuardDuty findings to Lambda, event-driven, no polling
AWS Lambda
Core agent logic: parsing, memory lookup, redaction, orchestration
Amazon Bedrock (Nova Lite)
Generates each chronicle's narrative from structured, sanitized input
Amazon DynamoDB
Stores chronicles and the evolving style-memory state
Amazon API Gateway
Exposes /health and /chronicles endpoints with strict CORS
Amazon S3
Hosts the private static site, accessible only via CloudFront
Amazon CloudFront
HTTPS delivery + Origin Access Identity, keeping the S3 bucket non-public
Amazon GuardDuty
│ finding detected
▼
Amazon EventBridge
│
▼
AWS Lambda ──► DynamoDB (style memory + chronicle history)
│
▼
Amazon Bedrock (Nova Lite) ──► redaction layer ──► DynamoDB (store)
│
▼
Amazon API Gateway (/chronicles, /health)
│
▼
Amazon CloudFront (HTTPS, OAI) ──► private Amazon S3 (static site)
Deployed as infrastructure-as-code with AWS SAM — Lambda, DynamoDB, API Gateway, and the EventBridge rule are all defined in a single  template.yaml , deployed with  sam deploy .

What I learned

  • Event-driven beats scheduled for agents with a real signal source. A cron-triggered agent generates content on a timer whether or not anything meaningful happened. Wiring directly to GuardDuty's EventBridge events means the Sentinel only speaks when there's something worth saying — more efficient, cheaper, and more relevant.
  • Prompt engineering is a security control, not just a style lever. Explicit boundaries ("do not invent facts, IPs, or attacker motives") plus severity-scaled tone rules made the difference between generic AI text and output that stayed grounded and appropriately toned to the real finding.
  • Redaction has to be layered, not single-pass. Sanitizing the prompt going in wasn't enough — the model could still produce plausible-looking sensitive-format text on its own, so post-generation scanning was necessary too.
  • SAM makes multi-service serverless agents genuinely manageable. Lambda, DynamoDB, API Gateway, and EventBridge all defined and deployed from one template, one command.
  • Security defaults (private S3 + CloudFront OAI, least-privilege IAM) cost almost nothing to set up correctly from the start, and are far more annoying to retrofit later.

Link to app or repo

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article