
My AI Agent Followed the Rule Because I Asked. Now It Has No Choice.
My agent's only-production rule was a sentence in its prompt. I moved it to a policy at the Gateway, and the same call for staging was refused.
21 posts

My agent's only-production rule was a sentence in its prompt. I moved it to a policy at the Gateway, and the same call for staging was refused.

I built one small AWS AgentCore agent twice, as a Harness and as my own Runtime code, with the same Gateway, Lambda and model. The answers matched and the timings were close. Here is what actually changed, one bug only my own code gave me, and when I would move from a Harness to Runtime.

I traced the same agent question twice. With Code Interpreter and memory on, it took 8.5 seconds. With only the Gateway tool left, it took 1.8.

In my personal AWS lab, an agent generated Python and correctly analyzed a synthetic deployment history. Its tests passed, but they did not check every expected start and end timestamp. I compared the output with independent calculations and inspected the assertions to see what the result actually proved.

My CloudOps agent remembered which environment I preferred. Then I changed that preference to an environment its deployment tool did not support. The result clarified a useful boundary: memory can preserve context, but current facts still need a current source.

My first CloudOps agent refused to say whether production was healthy because it had no operational data. I added a deterministic Lambda through Amazon Bedrock AgentCore Gateway, tested the complete tool path, fixed a protocol mistake, and learned why a grounded answer is only as reliable as its underlying source.

I deployed a managed AgentCore Harness and asked whether production was healthy. Its refusal was the correct result for this experiment: the agent had a model and a prompt, but no authoritative operational data. The deployment and trace made that boundary concrete.

I wanted a staging server that was more realistic than local Docker but smaller than a full AWS platform. I used Terraform and Docker Compose to build one on a $7 Lightsail plan, then measured deployment, application recovery, instance reboot recovery, cost, and cleanup.

My Terraform drift pipeline could detect an EC2 tag change and remove it automatically, but the evidence was scattered across temporary logs. I added a DynamoDB audit trail, a read only Lambda API, and a CloudFront dashboard so the system could remember and display every classified drift event.

I added a tag directly to an EC2 instance in AWS, then ran my Terraform drift detector. The change was classified as LOW, Lambda started a separate remediation build, and Terraform removed the tag automatically.

My Terraform drift detector could send an email, but it could not explain what changed or how serious it was. I changed the SNS message into structured JSON, delivered it to SQS for audit processing, and used Lambda to classify every resource change by severity.

Terraform could reproduce my infrastructure, but it could not warn me when someone changed AWS manually. I built a CodeBuild job that runs Terraform plan, handles the drift exit code correctly, reads shared configuration from SSM, and sends an SNS email when the real infrastructure no longer matches the code.

How to add Prometheus and Grafana to an ECS Fargate app, run load tests, and prove self-healing with a deliberate crash. Built on EC2 with Docker Compose.

How to expose an ECS Fargate app publicly using an Application Load Balancer, target groups, and Terraform. Includes subnet AZ requirements and security group locking.

Containerizing My Three Tier App with GitHub Actions

One flat file works until it doesn't, here is how to fix that

Stop storing your state locally, here is the right way to do it on AWS

From invisible to observable: IAM, CloudWatch Agent, and SSM wired together with Terraform

I wanted to stop consuming Terraform modules and start writing them. The best way I know how to learn something is to build something real, break it, fix it, and understand why it works. So I sat down and built a full three tier AWS architecture from scratch, no copy paste, no AI, just me, the Terraform docs, and a lot of errors. Here is what I ended up with and what I learned along the way.

A step-by-step walkthrough of building a serverless file upload pipeline using API Gateway, Lambda, S3, and SNS , wiring four AWS services together from scratch.

A hands on walkthrough of wiring S3 to Lambda and what I learned by intentionally breaking permissions to understand execution roles vs resource based policies.