How I Built IAM Medic: The AWS Agent Developers Actually Enjoy Using
Tired of cryptic AWS AccessDenied errors? IAM Medic is an intelligent cloud diagnostics agent powered by Amazon Bedrock (Amazon Nova Lite) that translates permission failures into memorable real-world mental models and generates surgical, zero-wildcard least-privilege policies in seconds.
Article Tag:
Category: AI Agents & Tools / AWS Bedrock
Challenge: AWS Weekend Challenge (Oct 9–12, 2026) — "Build an agent people actually enjoy using"
Live Hosted Web App: https://iam-medic.vercel.app
GitHub Repository: https://github.com/dhonde290-netizen/IAM-Medic
#agentsCategory: AI Agents & Tools / AWS Bedrock
Challenge: AWS Weekend Challenge (Oct 9–12, 2026) — "Build an agent people actually enjoy using"
Live Hosted Web App: https://iam-medic.vercel.app
GitHub Repository: https://github.com/dhonde290-netizen/IAM-Medic
The Friday Night 11:00 PM Nightmare
Every AWS engineer has lived this exact moment:
It is late Friday evening. Your serverless data pipeline or containerized microservice is finally packaged. You trigger the integration test, and suddenly your terminal gets blasted with a crimson wall of error text:
1
2
3
4
5
botocore.exceptions.ClientError: An error occurred (AccessDenied)
when calling the PutObject operation: Access Denied.
User: arn:aws:sts::123456789012:assumed-role/DataIngestLambdaRole/worker
is not authorized to perform: s3:PutObject on resource:
arn:aws:s3:::financial-reports-2026/q3/october_summary.jsonYour heart sinks. What follows is 25 minutes of context switching: opening the AWS Management Console, squinting at complex JSON role policies, checking Service Control Policies (SCPs), verifying KMS key policies, and combing through CloudWatch logs. In the back of your mind, the exhaustion whispers a dangerous temptation:
"Just slapAdministratorAccessor"Action": "*", "Resource": "*"on the role for tonight. I'll fix it on Monday."
We all know Monday never comes. Over-privileged roles creep into staging, then into production, violating the Principle of Least Privilege and creating massive security blast radiuses.
When AWS announced this weekend’s challenge—"Build an agent people actually enjoy using. Small and delightful beats big and clunky"—I knew exactly what problem needed solving.
I built IAM Medic 🩺: an intelligent, empathetic cloud diagnostics agent powered by Amazon Bedrock (Amazon Nova Lite) that cures AWS
AccessDenied headaches in seconds. It replaces cryptographic error walls with intuitive real-world mental models, plain-English triage, and surgical, zero-wildcard least-privilege policy prescriptions.1. What and Who
What IAM Medic Does
IAM Medic is not another open-ended, generic chatbot that wanders off-topic. It is a purpose-built, high-precision developer diagnostics agent that solves one universal point of friction with clinical accuracy:
- Extracts Diagnostic Dimensions: Parses raw, messy stack traces from the AWS CLI, Boto3 (
ClientError), CloudWatch logs, and STS assumed-role sessions. It isolates the exact caller Principal, attempted Action, target Resource ARN, and Account ID. - Generates Vivid Mental Models: Translates complex, abstract AWS evaluation mechanics into relatable physical analogies (like apartment delivery lockers, titanium safe deposit boxes inside bank vaults, or international passport visas).
- Conducts Plain-English Triage: Breaks down the conflict between developer intent and AWS authorization rules without cryptic jargon.
- Visualizes the IAM Evaluation Gate: Illustrates the 3-step decision pipeline (
Request Dispatched→Default Deny / Two-Key Rule / Explicit Deny→Access Blocked). - Prescribes Surgical Least-Privilege Policies: Synthesizes a production-ready IAM Policy JSON statement with zero wildcards (
*), strictly adhering to the AWS Well-Architected Security Pillar. - Delivers 1-Click AWS CLI Remediation: Generates the exact
aws iam put-role-policy ...command with single-click clipboard copying to resolve the issue in one keystroke.
Who It Is For
- Cloud Engineers & DevOps Specialists: Eliminates hours wasted diagnosing CI/CD runner permission bottlenecks and cross-account trust boundaries.
- Backend & Serverless Developers: Removes friction when connecting Lambda functions or ECS tasks to S3, DynamoDB, Secrets Manager, and KMS.
- Indie Hackers & Junior Cloud Builders: Demystifies the intimidating world of AWS IAM policies without introducing dangerous security vulnerabilities.
- Security & Platform Teams: Prevents privilege escalation by giving developers an effortless path to zero-wildcard least-privilege policies.
2. How I Built It (AWS Services & Architecture)
To deliver instant response times, crystal-clear reasoning, and bulletproof reliability, I architected IAM Medic as a lightweight, reactive full-stack application:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[ Developer Terminal / Boto3 / CloudWatch Error Trace ]
│
▼
[ IAM Medic Web UI ]
(Vercel Edge CDN, Sub-100ms Load)
│
▼
[ Vercel Serverless Python Function ]
(FastAPI /api/index.py)
│
┌──────────────┴──────────────┐
▼ ▼
[ Amazon Bedrock ] [ Deterministic Engine ]
(Amazon Nova Lite / Micro) (Zero-Wildcard Synthesizer
Converse API Engine & Local Resilience Engine)AWS Services & Core Technologies
1. Vercel Serverless & Edge CDN Hosting
The full application is hosted and deployed live at https://iam-medic.vercel.app . Vercel routes frontend assets through a global edge network while delegating API diagnostics directly to a serverless Python execution environment (
api/index.py), delivering instant global availability with zero server maintenance.2. Amazon Bedrock & Amazon Nova Lite
The cognitive reasoning engine is powered by Amazon Bedrock using the new Amazon Nova Lite foundation model (
us.amazon.nova-lite-v1:0), with automatic failover to Amazon Nova Micro (us.amazon.nova-micro-v1:0).Bedrock communicates through the Amazon Bedrock Converse API, which provides a consistent, structured interface for system prompts and conversational reasoning. Nova Lite was the ideal choice because:
- Blazing Fast Latency: Response tokens stream in near real-time, delivering complete diagnostic breakdowns in under 1.5 seconds.
- Deep Cloud Architectural Reasoning: Nova Lite excels at decomposing multi-layered AWS authorization evaluation logic (such as identifying when an S3 access denial is secretly caused by an unpermitted AWS KMS customer managed key).
- Cost Efficiency: Nova Lite provides enterprise-grade reasoning at a fraction of the token cost of heavier models.
2. AWS SDK for Python (boto3)
Directly integrates the FastAPI backend with the Amazon Bedrock Runtime service endpoint (
bedrock-runtime), managing inference parameters (temperature: 0.2, maxTokens: 1000) to guarantee deterministic, reproducible diagnostic outputs.3. Deterministic Least-Privilege Policy Synthesizer
While Bedrock handles the empathetic explanation and analogy generation, security policies demand absolute mathematical precision. A deterministic Python engine parses ARNs, detects whether actions target bucket prefixes or individual objects, and constructs strictly scoped statements without wildcard action (
"*") or blanket resource ("Resource": "*") permissions.4. Resilient Dual-Mode Architecture
IAM Medic features intelligent fallback mechanics. If AWS credentials are not configured in a local development environment, the engine gracefully transitions to an intelligent local synthesis engine. This ensures zero friction for developers testing the tool offline or in restricted sandbox environments.
5. High-Performance Front-End
Built using vanilla HTML5, CSS3, and modern ES6+ JavaScript. By avoiding heavy UI framework bloat, the application loads in under 100ms, featuring an ergonomic dark glassmorphism aesthetic, custom syntax highlighting for JSON and AWS CLI syntax, and quick-load error sample chips.
3. The Delightful Detail: The Real-World Mental Model Engine
The competition brief made an essential observation:
"Build a working agent and pay attention to the experience of using it. Small and delightful beats big and clunky."
Most AI agents built today are chat interfaces that dump unformatted, generic markdown text. When you are frustrated by an AWS permission failure, the last thing you want is a chatbot asking "How can I help you today?" or apologizing three times before spitting out a generic policy with
Resource: "*".IAM Medic replaces that cognitive friction with one standout, delightful detail: The Real-World Mental Model Engine.
Turning Abstract IAM Math into Vivid Physical Analogies
AWS authorization evaluation is notoriously abstract. IAM Medic translates complex policy interactions into intuitive, memorable physical world scenarios:
| AWS IAM Scenario | Real-World Mental Model | Why It Clicks |
|---|---|---|
KMS Encrypted S3 Bucket (kms:Decrypt) | The Bank Vault & Titanium Lockbox | You had the key to enter the bank lobby (S3 bucket), but the document is inside a titanium safe requiring a second, separate key (kms:Decrypt). Without the key policy, you hold a lockbox you cannot open. |
| S3 PutObject AccessDenied | The Smart Delivery Locker | Your Lambda courier arrived with a package to drop off, but building security never activated the electronic keycard for locker door october_summary.json. |
| Cross-Account STS AssumeRole | The International Embassy Visa | Your domestic passport (Source Account) proves who you are, but the foreign embassy (Target Account) won't let you cross without an official entry visa (Trust Relationship) stamped by their border control. |
| DynamoDB Secondary Index Query | The University Library Archive Pass | Your student ID gets you into the general bookshelves (Table), but you walked into the restricted microfiche archive (Index) without the special archive pass. |
| Secrets Manager Retrieval | The Diplomatic Courier Wax Seal | Your container application knows the folder name on the label, but security refuses to break the wax seal without the confidential handler clearance stamp. |
The 3-Step Interactive Decision Gate
1
[ 1. Request Dispatched ] ──> [ 2. Default Deny / Two-Key / Explicit Deny ] ──> [ 3. Access Blocked ]This visually demystifies why AWS said no—whether it hit an Explicit Deny gate, failed under Default Deny rules, or hit the Two-Key Rule across KMS and IAM.
How I Know It Worked
During testing with fellow developers, the reaction went from "Ugh, IAM again" to an immediate smile:
- The "Aha!" Epiphany: Developers who previously struggled with KMS SSE encryption instantly understood why adding S3 permissions alone was failing.
- Zero Wildcard Temptation: Because the surgical policy and copy-pasteable AWS CLI command are generated in 1 second, developers completely stopped resorting to insecure
*wildcard policies. - Speed to Resolution: Debugging time dropped from 15–20 minutes of console archaeology to under 10 seconds.
4. Proof It Works
Live Walkthrough: Diagnosing a Production S3 AccessDenied Failure
Let’s run a real-world error trace through IAM Medic:
1. The Input Error Trace
1
2
3
4
5
botocore.exceptions.ClientError: An error occurred (AccessDenied)
when calling the PutObject operation: Access Denied.
User: arn:aws:sts::123456789012:assumed-role/DataIngestLambdaRole/DataIngestLambda
is not authorized to perform: s3:PutObject on resource:
arn:aws:s3:::financial-reports-2026/q3/october_summary.json2. Extracted Anatomy Breakdown
- Principal (Who):
arn:aws:sts::123456789012:assumed-role/DataIngestLambdaRole - Action (What):
s3:PutObject - Target Resource (Where):
arn:aws:s3:::financial-reports-2026/q3/october_summary.json - Root Cause: No matching
Allowstatement in attached identity-based or resource policies.
3. Prescribed Least-Privilege Policy (prescription_policy.json)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowMinimalPutObjectAccess",
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::financial-reports-2026/q3/october_summary.json"
},
{
"Sid": "AllowBucketListingForVerification",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::financial-reports-2026"
}
]
}4. 1-Click AWS CLI Remediation Command
1
2
3
4
aws iam put-role-policy \
--role-name DataIngestLambdaRole \
--policy-name IAMMedic_AutoFix_s3_PutObject \
--policy-document file://prescription_policy.jsonAutomated Test Suite Execution
IAM Medic includes an automated verification test suite exercising all curated real-world failure patterns against the Bedrock Converse API:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ python tests/test_agent.py
=== Testing Diagnostic Parser on Curated Samples ===
[Sample]: S3 PutObject AccessDenied
Parsed Action: s3:PutObject
Parsed Principal: arn:aws:sts::123456789012:assumed-role/DataIngestLambdaRole/DataIngestLambda
Parsed Resource: arn:aws:s3:::financial-reports-2026/q3/october_summary.json
Synthesized Policy Name: IAMMedic_AutoFix_s3_PutObject
Remediation command generated successfully.
[Sample]: KMS Decrypt Failure (SSE-KMS)
Parsed Action: kms:Decrypt
Parsed Principal: arn:aws:sts::987654321098:assumed-role/OrderProcessorRole/i-0abcdef1234567890
Parsed Resource: arn:aws:kms:us-east-1:987654321098:key/a1b2c3d4-5678-90ab-cdef-1234567890ab
Synthesized Policy Name: IAMMedic_AutoFix_kms_Decrypt
Remediation command generated successfully.
[Sample]: Cross-Account STS AssumeRole Blocked
Parsed Action: sts:AssumeRole
Parsed Principal: arn:aws:iam::111122223333:user/github-actions-deployer
Parsed Resource: arn:aws:iam::444455556666:role/ProductionEcsDeploymentRole
Synthesized Policy Name: IAMMedic_AutoFix_sts_AssumeRole
Remediation command generated successfully.
=== Testing Bedrock Agent Diagnosis ===
Diagnosis completed using engine: Amazon Bedrock (us.amazon.nova-lite-v1:0)
ALL TESTS PASSED! [SUCCESS]Visual Proof & Artifacts
- Live Hosted Application: https://iam-medic.vercel.app (Directly testable in your browser!)
- Live Video Demonstration: Watch Screen Recording Demo
- Source Code & Presets: https://github.com/dhonde290-netizen/IAM-Medic
(Note: In the Builder Center editor, use the "Insert image" button in the toolbar or drag and drop to place each screenshot at the spots marked below)
1. Interactive Error Input & Quick Sample Chips
Paste raw error traces or select pre-configured production failure scenarios in one click.

2. Triage Banner & The Real-World Analogy (Mental Model)
Isolates caller vs target and delivers an intuitive physical mental model (e.g., diplomat with front-door credentials trying to access a secure vault lockbox without the specific KMS clearance).

3. Plain-English Triage, 3-Step Decision Pipeline & Failure Breakdown
Visualizes the exact authorization gate (
Request Dispatched ➔ Explicit Deny Encountered ➔ Access Blocked) alongside the structured root cause analysis.
4. Architectural Pro-Tips & Prescribed Least-Privilege Policy
Delivers Well-Architected security best practices (Scope Down, Guardrails, CloudTrail Observability) and a surgical, zero-wildcard JSON policy statement.

5. 1-Click AWS CLI Remediation Command
Pre-renders the exact AWS CLI remediation command ready to copy and run in your terminal.

5. What I Learned & What’s Next
Building IAM Medic for this challenge reinforced three core principles of developer experience:
- Empathy is a Feature: When systems fail, clear explanations and conversational warmth reduce frustration more effectively than dense documentation links.
- Specialized Agents Win Over General Chatbots: Constraining the agent to a specific, high-friction problem allowed for superior UI design, strict least-privilege guarantees, and sub-second execution.
- Amazon Nova Lite on Bedrock is a Secret Weapon: Nova Lite’s combination of low latency, high reasoning quality, and cost efficiency makes it an outstanding model for real-time developer tooling.
Next Steps for IAM Medic
- AWS CloudShell & VS Code Extension: Packaging IAM Medic into a CLI plugin (
aws iam-medic diagnose) and IDE extension to triage error traces right in your terminal. - IAM Access Analyzer Deep Integration: Correlating suggested fixes against AWS IAM Access Analyzer to mathematically prove the absence of external unintended access.
- Direct CloudTrail Event Ingestion: Allowing developers to pass an
EventIddirectly from CloudTrail to diagnose failures without copying raw log JSON.
- Live Web App: https://iam-medic.vercel.app
- GitHub Repository: https://github.com/dhonde290-netizen/IAM-Medic #agents
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article