◈ AWS AGENTCORE BLUEPRINTS
PART IV · GOVERNANCE AND TRANSACTIONS · CHAPTER 24 / 36
TOCCONSULTING.FR
AMAZON BEDROCK / SERVICE DETAIL S10 POLICY

AGENTCORE POLICYPRACTICAL

CHAPTER 24 / 36
TOPIC block a refund over $1000, at the gateway
REV 2026.07
IN PLAIN WORDS

You will put a checkpoint in front of a refund tool so the agent can only refund under $1000. You add a gateway, a Lambda tool, and a policy engine in ENFORCE mode, then write the rule in Cedar or plain English. Terms: policy engine = the box that holds and checks rules; ENFORCE = actually block, not just observe; Cedar = AWS's rules language; permit/forbid = allow/deny.

[ 1 ] BUILD THE GUARDED TOOL
$ npm install -g @aws/agentcore $ agentcore create --name PolicyDemo --defaults && cd PolicyDemo $ agentcore add gateway --name PolicyGateway --authorizer-type NONE --runtimes PolicyDemo $ agentcore add gateway-target --name RefundTarget --type lambda-function-arn \ --lambda-arn <YOUR_LAMBDA_ARN> --tool-schema-file refund_tools.json --gateway PolicyGateway $ agentcore add policy-engine --name RefundPolicyEngine \ --attach-to-gateways PolicyGateway --attach-mode ENFORCE # ENFORCE = actually block
[ 2 ] WRITE THE RULE, TWO WAYS
PLAIN ENGLISH generated into Cedar
$ agentcore add policy --name RefundLimit \ --engine RefundPolicyEngine \ --generate "Only allow refunds under 1000 dollars" \ --gateway PolicyGateway
# --generate needs the gateway deployed first (it resolves the ARN for you)
CEDAR refund_policy.cedar
permit(principal,
  action == AgentCore::Action::"RefundTarget___process_refund",
  resource == AgentCore::Gateway::"<gateway-arn>")
when {
  context.input.amount < 1000
};
$ agentcore add policy --name RefundLimit --engine RefundPolicyEngine --source refund_policy.cedar
[ 3 ] DEPLOY AND TEST
$ agentcore deploy && agentcore status # status shows the gateway URL # $500 is under the limit -> ALLOWED $ curl -X POST <GATEWAY_URL> -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"RefundTarget___process_refund","arguments":{"amount":500}}}' # $2000 is over the limit -> DENIED by the policy engine
ENFORCE mode: every call is checked, default is deny unless a rule permits, and any forbid wins. Decisions are logged to CloudWatch. Cleanup: agentcore remove gateway --name PolicyGateway, then agentcore remove policy-engine --name RefundPolicyEngine, then agentcore deploy.
SRC: AWS AgentCore Developer Guide (Policy getting started, create policy engine, create policies)
DRAWN 2026.06, REV 2026.07.26
◄ PREVIOUS · CH 23
AgentCore Policy, Plain Language
NEXT · CH 25 ►
AgentCore Registry, Plain Language
AWS AGENTCORE BLUEPRINTS · CONTENTS
Back to tocconsulting.fr Cover & Table of Contents
PART I · FOUNDATIONS
01AgentCore Overview, Plain LanguageCONCEPT02AgentCore, Key Terms in Plain LanguageCONCEPT03AgentCore, Common Mistakes ExplainedCONCEPT04Inside an AgentCore Agent, BlueprintCONCEPT05Harness, Practical 1, Strands PathPRACTICAL06Harness, Practical 2, Managed HarnessPRACTICAL
PART II · CORE SERVICES
07AgentCore Runtime, Plain LanguageCONCEPT08AgentCore Runtime, PracticalPRACTICAL09AgentCore Memory, Plain LanguageCONCEPT10AgentCore Memory, PracticalPRACTICAL11AgentCore Gateway, Plain LanguageCONCEPT12AgentCore Gateway, PracticalPRACTICAL13AgentCore Identity, Plain LanguageCONCEPT14AgentCore Identity, PracticalPRACTICAL
PART III · TOOLS AND OPERATIONS
15AgentCore Code Interpreter, Plain LanguageCONCEPT16AgentCore Code Interpreter, PracticalPRACTICAL17AgentCore Browser, Plain LanguageCONCEPT18AgentCore Browser, PracticalPRACTICAL19AgentCore Observability, Plain LanguageCONCEPT20AgentCore Observability, PracticalPRACTICAL21AgentCore Evaluations, Plain LanguageCONCEPT22AgentCore Evaluations, PracticalPRACTICAL
PART IV · GOVERNANCE AND TRANSACTIONS
23AgentCore Policy, Plain LanguageCONCEPT24AgentCore Policy, PracticalPRACTICAL25AgentCore Registry, Plain LanguageCONCEPT26AgentCore Registry, PracticalPRACTICAL27AgentCore Payments, Plain LanguageCONCEPT28AgentCore Payments, PracticalPRACTICAL
PART V · MULTI-AGENT AND ARCHITECTURE
29A2A and Multi-Agent, Plain LanguageCONCEPT30A2A and Multi-Agent, PracticalPRACTICAL31Architecture Patterns, Plain LanguageCONCEPT32Multi-Tenant Agents, Plain LanguageCONCEPT33Agent Security and Threat Model, Plain LanguageCONCEPT34Governance at Org Scale, Plain LanguageCONCEPT35Governance at Org Scale, PracticalPRACTICAL36Multi-Region and Distribution, Plain LanguageCONCEPT