Governing AI agent tool quotas with AWS Agent Registry and Amazon Bedrock AgentCore Gateway
Prashanth Sivarajan, Amazon Web Services
Summary
AWS Agent Registry is a centralized catalog within Amazon Bedrock AgentCore that lets organizations register, discover, and govern AI agents, MCP servers, and the tools they expose. It stores rich metadata - including custom fields - on each registry record, supports lifecycle statuses (draft, approved, deprecated), and emits events as records change, giving platform teams a single control plane for the growing fleet of AI agents and tools in their environment.
As organizations scale to dozens or hundreds of AI agents, ungoverned tool access creates operational and financial risk. Without per-tool quotas, a single misconfigured agent can saturate a downstream API or drive unexpected costs, and there is no centralized place to define, approve, or audit those limits.
This pattern uses Agent Registry as a policy-as-metadata layer. You define quota policies (calls per hour, cost tier, burst limits) as custom metadata on tool records, use EventBridge-driven approval workflows to gate tool discoverability, and deploy a Gateway REQUEST interceptor that reads quota metadata and enforces limits with DynamoDB sliding-window counters. This gives platform teams a single, auditable control point that prevents runaway costs and protects shared infrastructure - without modifying agent code.
Prerequisites and limitations
Prerequisites
Preview notice: AWS Agent Registry is in Preview (launched April 2026). APIs, event schemas, and service limits described in this pattern may change before general availability. Do not use Preview services for production workloads that require stable API contracts. Verify all API names and behaviors against the current documentation
An active AWS account with permissions to create and manage Amazon Bedrock AgentCore resources (Gateway, Agent Registry)
An existing Agent Registry with at least one MCP server record registered
Familiarity with the Model Context Protocol (MCP) and agent-to-tool invocation patterns
AWS CDK or AWS CloudFormation experience for deploying infrastructure
Basic understanding of Amazon DynamoDB, AWS Lambda, and Amazon EventBridge
An Amazon Bedrock AgentCore Gateway configured with at least one MCP target
Limitations
Preview service: AWS Agent Registry is in Preview (April 2026). The limitations below reflect Preview behavior and may change at GA.
Interceptor latency. The REQUEST interceptor adds a minor latency to every tool call (registry query + DynamoDB read/write). Mitigate with in-memory caching (60-second TTL) and provisioned concurrency.
API names subject to change. This pattern references API operations (
SearchRegistryRecords,GetRegistryRecord,UpdateRegistryRecordStatus) and EventBridge detail types based on Preview documentation. Verify these names against the current API referencebefore implementing, as they may change before GA The pattern considers a single-region scope (no cross-region quota enforcement)
Custom metadata size. Registry record ‘inlineContent’ field is limited to 409,600 characters. Sufficient for quota policies but relevant if combining metadata with large schemas.
Architecture
The architecture uses AWS Agent Registry as the single source of truth for tool quota policies. Custom metadata schemas on registry records declare rate limits, cost tiers, and burst allowances. A Gateway REQUEST interceptor reads these policies at invocation time and enforces them with DynamoDB-backed sliding-window counters. EventBridge notifications trigger approval workflows that validate quota policies before tools become discoverable.
Runtime quota enforcement

User - Access the AI Agent via the business application
AI Agent - Invokes tools through the AgentCore Gateway.
Amazon Bedrock AgentCore Gateway - Routes tool calls through a REQUEST interceptor Lambda before reaching the MCP target.
Amazon Bedrock AgentCore Identity - Used to manage the inbound and outbound authentication.
REQUEST Interceptor Lambda - Queries the Agent Registry via the SearchRegistryRecords API for the target tool's quota metadata, reads and increments a DynamoDB counter, and either allows or denies the request based on quota limits.
AWS Agent Registry - Central catalog storing tool records with custom quota metadata (calls_per_hour, cost_tier, burst_limit). Exposes the SearchRegistryRecords API for programmatic lookup by the interceptor.
Amazon DynamoDB - Stores sliding-window usage counters keyed by agent ID + tool name + time window.
Governance and approval workflow

Publisher - Submits tool records with quota metadata to the Agent Registry via the control-plane API.
AWS Agent Registry - Receives the record, stores it in PENDING_APPROVAL status, and emits a status change event to EventBridge.
Amazon EventBridge - Receives record-submission events from Agent Registry and triggers a validation Lambda that validates quota metadata completeness before approving records.
Quota Validation Lambda - Evaluates submitted records for required quota fields, rejects incomplete submissions, and approves well-formed records via the UpdateRegistryRecordStatus API.
AWS Agent Registry - Updates the record status to APPROVED (discoverable by agents) or REJECTED (with feedback to the publisher).
AWS CloudTrail - Logs all registry control-plane operations, providing an audit trail of quota policy changes across the tool lifecycle.
Cost considerations
DynamoDB: On-demand pricing is recommended for unpredictable agent traffic. Please refer Amazon DynamoDB Pricing
for detailed calculation. Lambda: Use provisioned concurrency or Lambda SnapStart (Java) to minimize cold starts if latency is critical.
Agent Registry: No additional charge for custom metadata. SearchRegistryRecords API calls are included in AgentCore pricing.
Tools
AWS Service | Role in the pattern |
|---|---|
Amazon Bedrock AgentCore Gateway | Routes agent tool calls; hosts REQUEST interceptor |
AWS Agent Registry | Central catalog for tool records; stores quota policies as custom metadata |
AWS Lambda | Implements the REQUEST interceptor that enforces quotas; implements the quota validation workflow triggered by EventBridge |
Amazon DynamoDB | Stores sliding-window usage counters for rate limiting |
Amazon EventBridge | Delivers record-submission events to trigger the validation Lambda |
AWS CloudTrail | Provides audit trail of all registry changes |
Amazon CloudWatch | Publishes quota metrics (invocations, denials) and triggers alarms |
AWS CDK | Infrastructure as code for deploying the solution |
Best practices
Quota metadata design
Use a consistent JSON schema for quota metadata across all tool records. Define a schema template that includes
calls_per_hour,cost_tier(low, medium, high, premium),burst_limit, andcooldown_seconds.Version your schema. Include a
schema_versionfield in quota metadata so the interceptor can handle backward-compatible changes.Separate quotas by consumer tier. Store multiple quota tiers (e.g.,
standard,premium) in the same record metadata, allowing the interceptor to select the appropriate limits based on the calling agent's identity.
Rate-limiting strategy
Use DynamoDB TTL for automatic cleanup. Set TTL on counter items equal to the window duration so expired counters are removed without manual intervention.
Implement sliding windows, not fixed windows. A sliding-window counter (current window count + weighted previous window count) avoids the burst-at-boundary problem inherent in fixed-window counters.
Return retry-after headers. When denying a request, include a
retry_after_secondsvalue in the interceptor response so agents can implement exponential backoff.
Governance workflow
Never auto-approve records without quota metadata. Configure EventBridge rules that route submissions to the validation workflow; only records passing all quota checks are approved.
Use DEPRECATED status for sunset. When retiring a tool, deprecate the record rather than deleting it, preserving the audit trail and existing usage data.
Validate on record synchronization. When records synchronize with external MCP servers, trigger re-validation to ensure quota metadata remains intact after updates.
Security and observability
Fail-open default. The interceptor allows requests when the Agent Registry is unreachable, prioritizing agent availability over strict enforcement. For tools that modify production data or incur high costs, switch to fail-closed by denying requests when quota metadata cannot be retrieved.
Scope interceptor permissions. Grant the interceptor Lambda only
SearchRegistryRecordson the registry resource, plusdynamodb:GetItem/dynamodb:UpdateItemon the DynamoDB counter table. The interceptor uses thebedrock-agentcoreruntime client (not the control-plane MCP endpoint). (Verify these IAM action names against current documentation - Preview APIs may change.)Log quota denials to CloudWatch Metrics. Publish custom metrics (tool name, agent ID, denial reason) for operational dashboards.
Enable CloudTrail for compliance. All UpdateRegistryRecordStatus calls (approvals, deprecations) are automatically logged, meeting audit requirements.
Epics
| Task | Description | Skills required |
|---|---|---|
Design the quota metadata JSON schema |
| Cloud architect |
Register MCP server tools with quota metadata |
| Cloud architect |
| Task | Description | Skills required |
|---|---|---|
Create the EventBridge rule for record submissions |
| Cloud architect |
Implement the quota validation logic |
| Cloud architect |
Test the end-to-end approval flow |
| Cloud architect |
| Task | Description | Skills required |
|---|---|---|
Create the DynamoDB counter table |
| Cloud architect |
Implement the REQUEST interceptor Lambda |
See the full implementation in the code repository | Cloud architect |
Attach the interceptor to the Gateway |
| Cloud architect |
Implement sliding-window rate limiting |
| Cloud architect |
| Task | Description | Skills required |
|---|---|---|
Publish custom CloudWatch metrics |
| Cloud architect |
Set up CloudTrail audit for quota policy changes (Recommendation - Not implemented in code repo) |
| Cloud architect |
Configure alerting for quota exhaustion (Recommendation - Not implemented in code repo) |
| Cloud architect |
| Task | Description | Skills required |
|---|---|---|
Implement quota metadata versioning (Recommendation - Not implemented in code repo) |
| Cloud architect |
Handle record deprecation gracefully |
| Cloud architect |
Support quota overrides per agent |
| Cloud architect |
Troubleshooting
| Issue | Solution |
|---|---|
Tool calls are not being rate-limited | Ensure the tool names registered in the Agent Registry match the names agents use at invocation time, including any MCP server prefixes. |
Records remain in PENDING_APPROVAL indefinitely | Verify the EventBridge rule's source and detail-type fields align with the event schema emitted by Agent Registry. Check EventBridge rule invocation metrics in CloudWatch. |
Agents are denied immediately with no prior usage | Confirm DynamoDB TTL is enabled and working. Clear leftover counter items from previous test runs if needed. |
Quota changes are not taking effect | Wait at least 65 seconds (registry propagation + cache TTL) after updating metadata, then retry. |
Interceptor adds noticeable latency to tool calls | Enable provisioned concurrency on the interceptor Lambda and confirm that in-memory caching is reducing registry API calls. |
Related resources
Code repository
- CDK project, Lambda source, and deployment instructions for this pattern. Secure AI agents with Policy and Lambda interceptors in Amazon Bedrock AgentCore Gateway
The future of managing agents at scale: AWS Agent Registry now in preview
Additional information
All epics and stories above are fully implemented in the code repository
Quota metadata schema reference
The quota metadata JSON schema defines the structure for tool rate limits stored as custom metadata on Agent Registry records. It is introduced in Epic 1 (Story 1.1) and enforced at runtime by the interceptor (Epic 3, Story 3.2) and the validation workflow (Epic 2, Story 2.2).
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "ToolQuotaMetadata", "type": "object", "required": ["schema_version", "quotas", "cost_tier"], "properties": { "schema_version": { "type": "string", "pattern": "^\\d+\\.\\d+$" }, "quotas": { "type": "object", "patternProperties": { "^(standard|premium|enterprise)$": { "type": "object", "required": ["calls_per_hour"], "properties": { "calls_per_hour": { "type": "integer", "minimum": 1 }, "burst_limit": { "type": "integer", "minimum": 1 }, "cooldown_seconds": { "type": "integer", "minimum": 0 } } } } }, "cost_tier": { "type": "string", "enum": ["low", "medium", "high", "premium"] }, "tool_quotas": { "type": "object", "description": "Per-tool overrides within an MCP server record", "additionalProperties": { "type": "object", "properties": { "calls_per_hour": { "type": "integer" }, "cost_tier": { "type": "string" } } } } } }
FAQs
What happens if the Agent Registry is unreachable? The interceptor fails open - requests are allowed when the registry cannot be queried. This avoids blocking agents during transient outages. To implement fail-closed behavior, modify the interceptor to deny requests when the registry returns an error, accepting the tradeoff of agent disruption during outages.
How long do quota policy changes take to propagate? Agent Registry metadata is eventually consistent (a few seconds), and the interceptor caches quota data for 60 seconds. In the worst case, changes take up to ~65 seconds to take effect.
Can different agents have different quotas for the same tool? Yes. The override table (Epic 5, Story 5.3) stores per-agent quota overrides. Priority order: agent-specific override > tool-level quota > default quota tier. Insert a record into the QuotaOverrides DynamoDB table with agent_id, tool_name, and the fields to override (e.g., calls_per_hour, burst_limit).
Is the rate limiter exactly accurate under high concurrency? DynamoDB counter updates use atomic ADD operations, but the read-then-decide-then-write flow is not transactional. Under high concurrency, a small number of requests may slip through before the counter reflects the true count. For strict enforcement, use DynamoDB conditional writes with a version attribute.
Attachments
To access additional content that is associated with this document, download and unzip the following file: attachment.zip