AWS Builder Center
Weekend Agent Challenge: Free Dev Sentinel

Weekend Agent Challenge: Free Dev Sentinel

Monitoring the developer service ecosystem is a critical FinOps task. When a cloud provider deprecates a free tier, reduces API limits, or shifts its pricing structure, production integrations can break, and operating costs can quietly escalate. Free Dev Sentinel is an autonomous, serverless monitoring agent running on AWS Free Tier

AWS Community Builder | Adversarial Engineer | Future

1. Vision & What the Agent Does

The core problem Free Dev Sentinel solves is the lack of proactive visibility into changes in free developer tiers. While developers rely heavily on free tiers for databases, APIs, authentication, and hosting, these offerings are frequently modified or retired without direct email notices.
Before arriving at this architecture, we evaluated and discarded several other agent concepts:
  1. Aegis-Learn: A cognitive debt auditor for AI-generated code. We discarded it because the cognitive classification engine was complex and unvalidated, and adding a code-auditing step introduced friction into developer velocity.
  1. LLM Shared Context Cache Proxy: A proxy to share prompt caches for developer teams. We discarded this because LLM prompt caching relies on exact prefix matching rather than repository structures, making it technically invalid, and commercial services like LiteLLM already solve this.
  1. Security Exploit Radar: A CVE exploit monitor. We opted instead for the FinOps monitoring agent as it provides a higher frequency of real-world changes and aligns more directly with cost optimization.
Free Dev Sentinel works as follows:
  • Trigger: Every 6 hours, an Amazon EventBridge Scheduler rule invokes the agent.
  • Data Collection: The agent queries the GitHub Compare API to retrieve the accumulated diff of all commits since the last checked state. It monitors three independent sources:  ripienaar/free-for-dev ,  awesome-selfhosted/awesome-selfhosted , and  awesome-foss/awesome-sysadmin .
  • AI Analysis: It sends the diff to a cascading chain of AI models to analyze the changes for pricing adjustments, tier deprecations, or new resources.
  • Reporting: It formats the analysis into a structured Discord embed. The color of the embed is dynamically assigned based on severity: Red for deprecations/tier reductions, Yellow for general updates, Green for new tools, and Grey for unparsed/fallback diffs.
  • Meta-Monitoring: Upon completing a run, the agent pings healthchecks.io. If the Lambda function crashes or times out silently, the ping is missed, and a "dead man's switch" notification is sent to the administrator.




2. How You Built It

The agent was built in Python 3.12 using the AWS Serverless Application Model (SAM). The engineering focus was placed on structural resilience, error handling, and avoiding silent failures before writing any code.

Solving Key Design Challenges Before Coding

Four critical structural issues were identified and resolved during the design phase:
  1. SQS Architecture Separation: We split our SQS resources. Instead of using a single queue for both the Lambda Dead Letter Queue (DLQ) and notification retries, we created  SentinelLambdaDLQ  and  SentinelRetryQueue . The  SentinelLambdaDLQ  is attached directly to the Lambda function's asynchronous invocation configuration to catch runtime timeouts or uncaught crashes. The  SentinelRetryQueue  is managed at the application level; if a Discord webhook request fails, the code catches the exception, enqueues the message manually, and returns a successful  200 OK  from the Lambda function.
  1. Structured AI Response Parsing: Relying on LLMs to return free-text responses with emojis (🔴/🟡/🟢) is highly fragile, especially when using multiple fallback models. We instructed the system prompt to return a strict JSON payload:  {"severity": "NEW_RESOURCE|UPDATE|DEPRECATION", "summary": "..."} . We then implemented  parse_ai_response()  with three fallback parsing strategies:
  • Strategy 1: Direct parsing via  json.loads() .
  • Strategy 2: Code fence extraction ( r'```(?:json)?\s*\n?(.*?)\n?\s*```' ) for models that wrap JSON.
  • Strategy 3: Regex extraction of the first  {...}  block containing the  "severity"  key. If all three strategies fail, the parser degrades gracefully, returning  UNKNOWN  severity and the raw text.
  1. Branch Name Verification: To prevent silent HTTP 404 errors on the GitHub Compare API, we verified the default branch names of the target repositories before writing  sources.json . We confirmed that all three monitored repositories run on  master  rather than  main .
  1. Bedrock IAM Permissions: We verified that the  bedrock:InvokeModel  action is sufficient to cover the Amazon Bedrock Converse API, ensuring no permission errors would block the third-tier fallback model.

Real-World Deployment and Terminal Bugs

During local building and deployment, we encountered and resolved several system-level issues:
  • SAM Build Runtime Mismatch: Running  sam build  on the host machine failed because the local Ubuntu environment lacked Python 3.12. We resolved this by building inside a text container using  sam build --use-container .
  • Docker Daemon Permissions: The container build initially failed with a socket connection error. We resolved this by starting the Docker service and adding the user to the docker group:```bash sudo systemctl start docker sudo usermod -aG docker $USER newgrp docker```````````````

  • Secrets Manager Case Sensitivity: The Secrets Manager JSON was originally populated with uppercase keys ( GITHUB_TOKEN ), whereas the Python code indexed them in lowercase ( secrets["github_token"] ). This would have caused a runtime  KeyError . We aligned the keys to lowercase in Secrets Manager before the first run.
  • GitHub 401 Unauthorized: The first manual invocation of the Lambda function threw a  401 Client Error  from the GitHub API: [ERROR] Failed to get HEAD SHA for ripienaar/free-for-dev/master: 401 Client Error: Unauthorized for url: https://api.github.com/repos/ripienaar/free-for-dev/branches/master We diagnosed this by checking the token locally using  curl  and comparing it against the Secrets Manager secret. The secret still contained the default placeholder values because the disk file had been updated after the initial secret creation. We resolved this by pushing the updated secret values using the AWS CLI.

First Run and Successful Storage

The first execution stored the current HEAD SHA of the repositories in DynamoDB to establish a baseline. The log confirmed that no notifications were sent on the initial run, which was the intended design to avoid spamming the history of the repositories:
=== Sentinel complete in 2.8s | {"processed": 3, "changes_found": 0, "alerts_sent": 0, "errors": 0} ===

Real-World Fallback Event Verbatim Log

To verify the fallback chain in production, we manually modified the DynamoDB table state for  ripienaar/free-for-dev  to a previous commit SHA. The subsequent invocation triggered a multi-level fallback cascade due to rate limits and API formatting issues. Below is the verbatim CloudWatch log of the execution:

Deconstruction of the 19.8-Second Run:
  1. Tier 1 (OpenRouter Auto-Router  openrouter/free ): The API successfully routed to  openai/gpt-oss-20b:free , which returned a response. However, the model's output formatting lacked the expected properties, causing a  TypeError  ( 'NoneType' object is not subscriptable ) when the code attempted to access the chat choice structure.
  1. Tier 2 (OpenRouter Llama 3.3 70B  meta-llama/llama-3.3-70b-instruct:free ): The fallback request was initiated immediately but failed with an HTTP  429 Too Many Requests  status, indicating provider-level rate-limiting on the free tier endpoint.
  1. Tier 3 (Amazon Bedrock  amazon.nova-micro-v1:0 ): The agent fell back to Bedrock Nova Micro. The Converse API call succeeded, analyzed the diff, returned the JSON structure classifying the change as  NEW_RESOURCE , and successfully pushed the embed to Discord.
This run validated that the agent can survive two concurrent AI layer failures and recover to deliver a structured report.



3. AWS Services Used / Architecture Overview

The following Mermaid diagram maps the data flow and service integrations:


AWS Resources Deployed

  • AWS Lambda (Python 3.12): Bundles code dependencies (the  requests  library) and executes the core processing logic.
  • Amazon EventBridge Scheduler: Triggers the Lambda function asynchronously every 6 hours ( rate(6 hours) ).
  • Amazon DynamoDB: A single table ( sentinel-state-prod ) using  PAY_PER_REQUEST  billing with  source_id  as the partition key.
  • AWS Secrets Manager: A single secret ( sentinel-secrets-prod ) storing the API credentials in a JSON payload.
  • Amazon Bedrock: Accesses the  amazon.nova-micro-v1:0  model via the Converse API as the third-tier AI provider.
  • Amazon SQS (Two Queues):
  •  sentinel-lambda-dlq-prod : Attaches to the Lambda function's Dead Letter Queue configuration to capture asynchronous execution crashes.
  •  sentinel-retry-queue-prod : Holds notification payloads that failed to send to Discord due to API timeouts or rate limits.

External Integrations

  • GitHub API: Queries  /repos/{owner}/{repo}/compare/{base}...{head}  to retrieve commits and file patches.
  • OpenRouter API: Accesses the free tier router  openrouter/free  and fallback models using an API key.
  • Discord Webhook: Delivers structured embeds to the target channel.
  • healthchecks.io: Acts as a dead man's switch. A successful Lambda execution makes a  GET  request to the ping URL. If a execution fails silently, healthchecks.io triggers an email alert.




4. What You Learned

Developing Free Dev Sentinel highlighted several lessons in building robust, serverless agents:
  • Asynchronous Scheduler Dead Letter Queues: We learned that EventBridge Scheduler triggers Lambda functions asynchronously by default. Because of this, standard Lambda Dead Letter Queue configurations ( DeadLetterConfig ) are effective for catching execution-level crashes. If the Scheduler supported synchronous calls, a crash would simply return an error response to the scheduler, leaving the DLQ empty.
  • Bedrock Model ARN Scope: We learned that Bedrock foundation models do not include an AWS account ID in their ARNs (e.g.  arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-micro-v1:0 ). Including an account ID in the resource section of the IAM policy will cause an  AccessDenied  error during API calls.
  • API Response Checking Order: We learned to check HTTP status codes before parsing response bodies. When an API returns a non-200 status (such as a 401 for an unauthorized key), the response body is often plain text rather than JSON. Attempting to parse the body as JSON first results in a generic  JSONDecodeError , obscuring the root authentication cause.
  • Defensive LLM Response Parsing: Free models are prone to output formatting variations. Building a parsing engine that uses multiple regex extraction strategies ensures the agent is resilient to raw text or markdown code fences returned by fallback models.



5. Links to App or Repo

You can access the repository containing the complete AWS SAM template, Python codebase, and configuration files here:


Note: If you are setting up this project, let the 6-hour EventBridge schedule run naturally. Remember to take a screenshot of the Discord embed alert and the EventBridge Scheduler console showing the active schedule, as these screenshots are required as proof of execution before publishing.
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