
I Built a Shadow AI Agent Hunter on AWS Agent Registry
A weekend build story: turning AWS Agent Registry into a hub for hunting down unregistered AgentCore runtimes, with a real approval gate.
AWS Agent Registry went GA in August 2026. It's a private catalog and governance layer for AI agents, MCP servers, and tools — semantic search, auto-discovery, approval workflows, and CloudTrail audit trails, all in one place.
My first thought reading the announcement wasn't "let me register one demo agent." It was: the interesting part of Agent Registry isn't the catalog itself, it's the governance machinery around it. So instead of building yet another single-agent demo, I turned Agent Registry into the subject of a meta-agent: something that watches the registry for what's missing from it.
That became Shadow Agent Hunter — it scans an AWS account for AgentCore runtimes, finds the ones nobody registered, flags likely duplicates with semantic search, and turns registering them into a real approval workflow. No Slack bot. The dashboard itself is the approval gate.
What it actually does
-
list_agent_runtimespulls every AgentCore runtime in the account
- Match against existing registry record names to find the unregistered ones
- For each unregistered runtime,
search_discoverable_registry_recordschecks whether something similar is already approved
- CloudTrail's
CreateAgentRuntimeevents reveal who deployed it
- Everything lands on a dashboard as "pending review"
- A human clicks Approve, Dismiss as duplicate, or Ignore
Clicking Approve isn't cosmetic. It calls
create_registry_record , submit_registry_record_for_approval , and update_registry_record_status against the real Agent Registry API. The button is the governance action.
The build
Infra is CDK: a DynamoDB table for scan results, an IAM role for Vercel (OIDC federation, no static keys), and three demo AgentCore runtimes. The Next.js app on Vercel does the scanning and renders the dashboard.
One of the demo runtimes,
weather-forecast-bot , is deliberately similar to a seeded weather-agent record — that's the duplicate-detection demo. The other two, invoice-parser-bot and onboarding-helper-bot , are unrelated on purpose.Agent Registry itself has no CDK construct yet (checked in September 2026 — no
AWS::AgentRegistry::Registry CloudFormation type exists). Makes sense for a service that just went GA. I handled the registry and its seed records with a small boto3 script instead:import boto3
control = boto3.client("agent-registry-control", region_name="us-east-1")resp = control.create_registry( name="shadow-agent-hunter-registry", description="Approved agents/tools for this account.",)The AgentCore runtimes themselves were the easy part —
aws_bedrockagentcore.Runtime is a stable CDK L2 construct, and AgentRuntimeArtifact.fromCodeAsset() deploys a Python zip with no Docker involved.
Things that didn't work the first time
The CLI didn't know
agent-registry-control existed. My Homebrew-installed AWS CLI predated the new namespace. Needed boto3 ≥ 1.42.87 and CLI v2 ≥ 2.34.28, so I built a fresh venv:python3 -m venv .venv.venv/bin/pip install --upgrade pip boto3 "botocore[crt]"The
botocore[crt] part matters — without it, the aws login credential provider throws a missing-dependency error at runtime.create_registry_record doesn't return a record ID. Only recordArn and status . You pull the ID out of the ARN yourself:record_id = resp["recordArn"].split("/record/")[1]provenance looked like exactly what I needed, and wasn't callable. There's a provenance field meant to link a record back to "detected from this AgentCore runtime" — perfect for tracking what's already registered, I thought. The API disagreed:ValidationException: provenance cannot be set by the callerIt's populated only by the service's own auto-detection/sync path, not by a plain
create_registry_record call. I switched to matching on record name instead, which turned out to be simpler anyway — names are unique within a registry.Wrong IAM namespace for AgentCore. I assumed the runtime-listing permission was
bedrock-agentcore-control:ListAgentRuntimes , matching the SDK package name. It's actually bedrock-agentcore:ListAgentRuntimes — a different namespace than the client library suggests.Vercel's OIDC provider is per-team, not per-project. My CDK stack tried to create a new
iam.OpenIdConnectProvider , and the deploy failed — another project under the same Vercel team had already registered that issuer, and an AWS account only allows one OIDC provider per issuer URL. Fixed it by importing the existing provider with fromOpenIdConnectProviderArn() instead of creating a new one.Seeing it work
Running a scan surfaces
weather_forecast_bot with a "similar approved record found" warning pointing at weather-agent . Clicking Dismiss as duplicate updates DynamoDB only — nothing gets written to the registry.Approving the unrelated
invoice_parser_bot , on the other hand, actually calls the real Agent Registry API end to end. aws agent-registry-control list-registry-records shows a new APPROVED record afterward.
With only two seed records in the registry, the semantic search doesn't return a numeric score — just a relevance-ordered list — so it surfaced
weather-agent as a "possible match" for the completely unrelated invoice runtime too. Not really a bug: with so few records to rank against, it can't discriminate much. If anything, it's a good demonstration of why a human sits in this loop instead of an autopilot.What's next
The dashboard ships in nine languages, right-to-left included for Arabic. Code's headed to GitHub soon.
Update: The source is now public on GitHub — yama3133/shadow-agent-hunter . CDK infra, the demo AgentCore runtimes, and the Next.js dashboard, plus a bilingual (Japanese/English) README with the architecture and flow diagrams from this post.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article