ai-ops-agent-zero-standing-creds
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-ops-agent-zero-standing-credswhat open incidents do we have?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI Ops Agent with Zero Standing AWS Credentials
An AI SRE agent (Amazon Bedrock + Claude) that investigates operational incidents by querying a DynamoDB table — without ever holding a long-lived AWS access key.
Instead of a static credential, the agent assumes a short-lived IAM role via STS, scoped to read-only access on exactly one table, with every call auditable in CloudTrail.
This project is inspired by a similar "no static credential" security pattern I came across, adapted here to AWS-native tooling: IAM roles + STS instead of a third-party identity provider.
The big idea
The "wrong way" ❌ | This project's way ✅ |
App holds a static AWS access key | App holds no key — assumes a role via STS |
Credential never expires | Session expires in 15 minutes, auto-renewed |
Often over-permissioned | Least privilege: read-only, one table, nothing else |
No record of what ran | Every call auditable in CloudTrail |
Two things you can watch happen live in the UI:
No static credential — the agent process never has an
AWS_ACCESS_KEY_IDfor itself; it callssts:AssumeRoleand gets a token that expires on its own.Least privilege enforced — clicking "Try write" attempts a
PutItemwith the agent's credentials and is denied by IAM before it ever reaches DynamoDB.
Related MCP server: ghost-dev-mcp
How it works (request flow)
You ask a question in the chat UI (app.py / Streamlit)
│
▼
agent_core.py ──► Amazon Bedrock (Claude) "run this query" (tool_use)
│ ◄──────────────────────────────────
▼
mcp_server.py (MCP server, one tool: query_incidents_readonly)
│
▼
aws_client.py ──► sts:AssumeRole ──► short-lived creds (15 min, auto-refreshed)
│ │
│ IAM policy: read-only, one table
│ write attempt → DENIED
▼ ▼
DynamoDB (Query/Scan only) ──► results ──► rendered in the chat UI
│
▼
CloudTrail logs the AssumeRole call and every DynamoDB readWhat's in the box
File | What it does |
| Streamlit chat UI + live security panel (session countdown, "Try write → DENIED"). |
| The agent loop: Bedrock Converse API + MCP client over stdio. |
| MCP server exposing the single tool |
| STS AssumeRole logic — the core of the "zero standing credentials" story. |
| One-time: creates the table and loads sample incident data (run with your own admin credentials). |
| The least-privilege policy: read-only, one table. |
| Who is allowed to assume the role. |
| Provisions the DynamoDB table + IAM role + policy as code. |
Prerequisites
Python 3.11+
An AWS account with:
Amazon Bedrock access to a Claude model (request access here if you haven't already)
Permission to create IAM roles and DynamoDB tables (for initial setup)
AWS credentials configured locally (
aws configure)
Setup
git clone https://github.com/JSR-codes/ai-ops-agent-zero-standing-creds.git
cd ai-ops-agent-zero-standing-creds
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt1. Provision the AWS infrastructure with Terraform
cd terraform
terraform init
terraform apply -var="assuming_principal_arn=arn:aws:iam::<your-account-id>:user/<your-iam-username>"Copy the readonly_role_arn output — you'll need it next.
2. Configure the app
cd ..
cp .env.example .env
# edit .env: paste in READONLY_ROLE_ARN from the terraform output3. Seed sample data
python seed.py(This runs with your own admin credentials, not the agent's read-only role — the agent's role isn't allowed to write, by design.)
4. Run the app
streamlit run app.pyTry it
Ask "what open incidents do we have?" and watch the agent query DynamoDB through the read-only role.
Watch the session countdown in the security panel — it's counting down a real STS session, not a fake timer.
Click "Try write (should be denied)" to see the IAM policy block a write attempt live.
Check CloudTrail in the AWS console afterward — you'll see the
AssumeRolecall and theQuery/Scancalls, all attributable to the short-lived session.
Security notes for anyone reusing this
This is a teaching demo, not production-hardened — review IAM policies and network setup before adapting it further.
.envand all Terraform state/var files are git-ignored — never commit real values.The whole point is that the agent runs with short-lived, least-privilege, audited credentials — keep it that way if you extend this.
Possible extensions
Add a second MCP tool with its own narrower role, to show per-tool credential scoping
Add an EventBridge rule that alerts if
AccessDeniedshows up in CloudTrail unexpectedlySwap DynamoDB for RDS and compare the IAM-auth flow to this table-scoped one
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
AWS cloud security scanners for AI agents — S3, IAM, EC2, EKS, RDS, CloudTrail, CloudWatch Logs
- FullmaktOAuthai.fullmakt
Credential broker for AI agents: scoped, revocable API access with policy enforcement and audit.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
- TAPOAuthtech.human
Credential isolation for AI agents: placeholder secrets, policy checks, optional human approval.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to AWS infrastructure through AWS IAM Identity Center for secure, natural language management of cloud resources across multiple accounts. It enables users to execute AWS CLI commands, monitor resources, and run remote shell commands on EC2 instances via Systems Manager.377 npm15ISC
- FlicenseNot gradedqualityDmaintenanceAn MCP server on AWS Lambda that gives AI assistants read-only access to SQS dead-letter queues and CloudWatch logs for fast incident triage.-
- AlicenseNot gradedqualityBmaintenanceEnables autonomous SRE incident investigation by allowing users to describe incidents in natural language. The agent follows a governed state machine to gather read-only evidence and produce grounded conclusions.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to diagnose and analyze AWS serverless infrastructure through Model Context Protocol, providing access to CloudWatch logs, Lambda functions, DynamoDB tables, IAM policies, and Bedrock-powered incident root-cause analysis.-