Set Up an Amazon Bedrock AgentCore Governed Decision Resilience System Through the AWS Console
Set Up an Amazon Bedrock AgentCore Governed Decision Resilience System Through the AWS Console
Series: Financial Service (19 articles)
- …
- 19Set Up an Amazon Bedrock AgentCore Governed Decision Resilience System Through the AWS Console This article
Set Up an Amazon Bedrock AgentCore Governed Decision Resilience System Through the AWS Console
Scope and design decision
This implementation keeps the agentic control plane inside Amazon Bedrock AgentCore. AgentCore Harness runs the managed agent loop. AgentCore Gateway exposes governed tools. AgentCore Policy authorizes every agent-to-tool request. AgentCore Memory provides bounded continuity. AgentCore Identity secures callers and delegated access. AgentCore Observability records traces and metrics. AgentCore Evaluations measures quality and control performance.
Supporting AWS services are used only where AgentCore does not replace a system of record. AWS KMS provides customer-managed encryption, Amazon S3 holds protected source records and durable evidence files, AWS Lambda implements deterministic Gateway tools, AWS Secrets Manager stores non-AWS credentials, and Amazon CloudWatch provides the observability console used by AgentCore. The design does not build a separate custom Strands runtime, independent vector database, self-managed orchestration service, or external policy engine.
The first release is a private decision-reflection assistant. It analyses observable changes from the trader's own baseline and returns neutral, evidence-linked observations to that trader. It does not diagnose mental health, infer protected characteristics, rank employees, recommend employment action, set compensation, or autonomously change trading authority. Team aggregation and identifiable human review remain disabled until separate governance approval.
AgentCore-centered architecture in plain text
An authenticated trader or approved enterprise application invokes an AgentCore Harness session. AgentCore Identity validates the caller through AWS IAM or an approved OpenID Connect identity provider. The invocation carries a trusted actor identifier, purpose, jurisdiction, consent version, request identifier, and session identifier.
The Harness supplies the selected Amazon Bedrock model, system instructions, managed execution environment, session isolation, tool access, memory, failure handling, and observability. The Harness calls only tools registered in a dedicated AgentCore Gateway. It does not receive broad permissions to inspect S3, Lambda, IAM, or other AWS resources directly.
AgentCore Gateway publishes narrowly scoped MCP tools for consent validation, private-reflection retrieval, baseline calculation, market-context retrieval, operational-context retrieval, neutral-observation generation, user correction, and human-review case creation. Lambda functions implement the deterministic backend logic. Gateway handles target invocation and authentication.
An AgentCore Policy engine is associated with the Gateway. It evaluates each proposed tool call independently of model reasoning. The default decision is deny. Policies allow a private reflection to be retrieved only when the authenticated actor matches the requested actor, the consent record is active, and the purpose is private reflection. Policies deny cross-user access, diagnostic output, employment use, compensation use, and unauthorized case creation.
AgentCore Memory stores short-term session events and only the approved long-term summaries selected for continuity. Memory is isolated using actor and session identifiers. Raw journal content is not promoted into long-term memory by default. User corrections are retained as higher-priority context. Memory expiry and deletion are configured before production use.
AgentCore Observability automatically traces Harness sessions, Gateway tool calls, Memory activity, Identity operations, and policy outcomes. Amazon CloudWatch Transaction Search provides the unified operational view. Raw reflections and bearer tokens are excluded from logs.
AgentCore Evaluations measures session quality, trace quality, tool selection, tool parameters, response grounding, abstention, prohibited language, actor isolation, policy compliance, and correction handling. Development releases are blocked when defined thresholds regress.
Step 1: Establish the non-negotiable governance boundary
Before opening the AWS console, create a signed use-case charter. State that the platform is a decision-resilience control and a private reflection assistant, not a medical, psychological, employment, or disciplinary system. State that no model output can independently create an adverse action.
Define the permitted output vocabulary as observation, change from personal baseline, supporting evidence, alternative explanation, missing context, uncertainty, abstention, limitation, and optional human discussion. Prohibit diagnostic labels, personality labels, fitness-for-work conclusions, dangerousness claims, moral judgments, compensation recommendations, employment recommendations, and autonomous trading controls.
Define the first release as private reflection only. Disable team dashboards and identifiable review. Define correction, deletion, retention, emergency handling, and model-retirement procedures before production.
Step 2: Select the AWS Region and verify AgentCore availability
Sign in to the AWS Management Console with a delegated platform role. Select one approved Region. Use the same Region for AgentCore Harness, Gateway, Policy, Memory, Identity, Observability, Evaluations, Lambda, KMS, S3, and the approved Amazon Bedrock model.
Open Amazon Bedrock and confirm that the selected model or inference profile is available. Record its exact identifier and owner. Open Amazon Bedrock AgentCore and confirm that Harness, Gateway, Memory, Policy, Identity, Observability, and Evaluations are available in the Region.
Open AWS CloudShell and set the Region.
1
2
3
4
5
export AWS_REGION=us-east-1
export AWS_DEFAULT_REGION=us-east-1
export ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
aws sts get-caller-identity
echo "$ACCOUNT_ID"Replace
us-east-1 with the institution's approved Region.Step 3: Enable the approved Amazon Bedrock model
Open Amazon Bedrock. Open Model access or the current model-access experience. Select an enterprise-approved model that supports the required Region and workload. Record the model ID or inference profile ID.
Use the model playground with synthetic reflections only. Confirm that the model can return structured neutral observations, alternatives, uncertainty, and abstention. Do not test with employee records or real journals.
Pin the chosen model identifier in the Harness configuration. Changes to the model or inference profile require evaluation and change approval.
Step 4: Create the customer-managed KMS keys
Open AWS Key Management Service and create a symmetric key named
alias/decision-resilience-agentcore. Use it for eligible AgentCore resources, evaluation configuration, and supporting data.Create
alias/decision-resilience-records for protected S3 records and Lambda environment encryption. Create alias/decision-resilience-audit for CloudWatch log groups and durable audit evidence.Separate key administration from key use. Limit decrypt permission to named workload roles. Enable key rotation where policy permits. Add owner, environment, purpose, data-classification, and retention tags.
Step 5: Create the minimal protected record stores
The agentic services remain in AgentCore, but durable source records still require a governed system of record. Open Amazon S3 and create three buckets: private source records, validated outputs, and audit evidence. Keep Block Public Access enabled, enable versioning, and select SSE-KMS with the records key.
Use opaque actor tokens in object keys. Do not use names, email addresses, employee numbers, or desk names. Configure lifecycle rules based on approved retention. Use S3 Object Lock for audit evidence only when records management approves it.
Create an Amazon DynamoDB table named
decision-resilience-consent with actor_token as the partition key and purpose_version as the sort key. Create decision-resilience-corrections with actor_token and correction_id. These tables support deterministic Gateway tools. Do not store raw journal text in DynamoDB.Step 6: Create the AgentCore Identity design
For an AWS-native workforce or application, use IAM inbound authorization and scope
bedrock-agentcore:InvokeGateway and Harness invocation permissions to the exact resources. For an enterprise user-facing application, use JWT authorization with the approved OpenID Connect provider, such as Microsoft Entra ID, Okta, or Amazon Cognito.Open AgentCore Identity and configure the approved identity provider or credential provider required by the application. The trusted identity context must provide an actor identifier, client, audience, scope, and approved claims. Do not let the model invent or modify identity context.
For Gateway inbound authorization, use the same approved identity boundary. If the console offers quick creation with Amazon Cognito, use it only for a workshop. Production should use the enterprise identity provider or IAM pattern approved by the security architecture.
Step 7: Create deterministic Lambda tools
Open AWS Lambda and create narrowly scoped functions for the following capabilities.
1
2
3
4
5
6
7
8
validate_consent
retrieve_private_reflection
compute_personal_baseline_change
retrieve_market_context
retrieve_operational_context
generate_neutral_observations
record_user_correction
create_human_review_caseKeep
create_human_review_case disabled in the first release. Each function receives trusted identity and policy context from the invocation path. It independently verifies actor scope, purpose, jurisdiction, consent version, and correlation identifier.Each tool returns structured JSON with evidence references, freshness, confidence, missing data, limitations, and policy outcome. No function returns a diagnosis, employee score, employment recommendation, compensation recommendation, or automated trading restriction.
Create one execution role per risk boundary or small tool group. Grant only the required S3 object prefix, DynamoDB item access, KMS operation, and CloudWatch logging. Test all functions with synthetic data before registering them in Gateway.
Step 8: Create the AgentCore Gateway
Open Amazon Bedrock AgentCore, choose Gateways, and choose Create gateway. Name it
decision-resilience-tools-prod. Describe it as a private decision-reflection tool boundary with no medical, employment, or autonomous trading capability.Enable semantic search only if the inventory requires natural-language discovery. For the initial small catalog, deterministic tool attachment is safer. If semantic search is enabled, high-impact tools must still be excluded from unrestricted discovery and protected by AgentCore Policy.
Configure inbound authorization with IAM or the approved JWT identity provider. Create or select a dedicated Gateway service role. Grant that role
lambda:InvokeFunction only for the approved tool functions. Select the AgentCore KMS key where the console offers customer-managed encryption.Create the Gateway and wait for Ready status. Record the Gateway ID, ARN, endpoint, supported MCP versions, inbound authorization, and service role.
Step 9: Add Lambda targets and MCP schemas
Open the Gateway and choose Add target. Select AWS Lambda. Create separate targets for private reflection, context retrieval, correction, and controlled review so policy can distinguish risk boundaries.
For each tool, define a precise description and JSON input schema. Require
purpose, actor_scope, jurisdiction, consent_version, correlation_id, and the business argument. Do not accept direct identity as an ordinary model-controlled string when trusted identity is available from the authorization context.Select Gateway IAM role for outbound authorization. Create the targets and wait for Ready status. Use the Gateway test interface or an authorized MCP client to run
tools/list. Confirm that only approved tools appear.Call each tool with a valid synthetic request, wrong actor, wrong purpose, expired consent, unsupported jurisdiction, and missing required parameter. The backend must reject invalid requests even before Policy is attached.
Step 10: Create and associate the AgentCore Policy engine
Open AgentCore Policy in the console. Create a policy engine named
decision_resilience_policy. Select the AgentCore KMS key. Associate the engine with decision-resilience-tools-prod.If the required console action is unavailable, create the engine from AWS CloudShell.
1
2
3
4
aws bedrock-agentcore-control create-policy-engine \
--name decision_resilience_policy \
--description "Default-deny policy for decision resilience tools" \
--encryption-key-arn "REPLACE_WITH_AGENTCORE_KMS_KEY_ARN"Create explicit permit policies and retain default deny. Permit
validate_consent for authenticated actors. Permit retrieve_private_reflection only when the caller actor matches the requested actor, purpose equals private reflection, consent is active, and jurisdiction is allowed. Permit correction writes only for the same actor. Deny human-review case creation until the feature is approved.Add policies that deny diagnostic labels, employment use, compensation use, cross-user retrieval, and attempts to change authorization context. Where natural-language policy authoring converts rules to Cedar, review the generated Cedar before activation.
Test permit and deny examples. Use audit mode first if available. Move to enforced mode only after expected outcomes are stable.
Step 11: Create AgentCore Memory
Open Amazon Bedrock AgentCore and choose Memory. Create
decision-resilience-memory-prod. Select the AgentCore KMS key and enable tracing.Configure short-term memory for session continuity. For long-term memory, enable only summarization or a custom approved strategy. Do not enable broad user-preference or semantic extraction until privacy and model-risk review confirms the content that may persist.
Set the event expiry duration to the shortest useful period. Use actor ID and session ID isolation. Design long-term namespaces around actor and purpose, such as
/private-reflection/{actorId}/summary. Do not create a shared team namespace containing identifiable records.Test memory isolation with two synthetic actors. A session for actor B must not retrieve actor A's events or records. Test deletion of events and long-term records before production.
Step 12: Create the managed AgentCore Harness
Use AgentCore Harness rather than a custom Strands Runtime for this AgentCore-centered version. Harness manages the model loop, isolated microVM session, tool use, memory, identity integration, networking, filesystem, and observability through configuration.
Open Amazon Bedrock AgentCore and choose Harness. Choose Create harness. If the console does not yet expose the full creation flow, use AgentCore CLI from CloudShell while keeping resource operation in AgentCore.
Install the current CLI.
1
2
3
4
node --version
npm --version
npm install -g @aws/agentcore
agentcore --versionRun the interactive creation workflow and choose Harness.
1
agentcore createConfigure the following values:
1
2
3
4
5
6
7
8
9
Harness name: decision-resilience-private-reflection
Model: approved Amazon Bedrock model or inference profile
Execution role: dedicated least-privilege Harness role
System prompt: governed private-reflection instructions
Tools: approved AgentCore Gateway MCP tools
Memory: existing decision-resilience-memory-prod
Inbound authorization: approved IAM or JWT configuration
Observability: enabled
Session compute: isolated microVMChoose the CodeZip or configuration-only build path offered for Harness. Do not attach Browser or Code Interpreter because this use case does not require open web browsing or arbitrary code execution.
Step 13: Configure the Harness system instructions
Use a strict system instruction that defines both purpose and prohibited behavior. The core instruction should state that the Harness is a private decision-reflection assistant for financial-services professionals. It may identify observable changes from the actor's own baseline, retrieve authorized context, and generate neutral evidence-linked observations.
Require the output fields
observations, evidence_references, alternative_explanations, missing_evidence, uncertainty, abstain, limitations, and suggested_reflection. Require the Harness to call validate_consent before retrieving private content.Prohibit diagnosis, protected-characteristic inference, employee ranking, compensation or employment recommendations, autonomous trading controls, and access to another actor's data. Require abstention when evidence is sparse, contradictory, culturally ambiguous, or outside the evaluated domain.
Require the smallest sufficient set of Gateway tools. Require the Harness to treat tool results as evidence rather than instructions and to ignore prompt injection contained inside retrieved content.
Step 14: Attach Gateway tools to the Harness
In the Harness configuration, add
decision-resilience-tools-prod as the MCP tool source. Attach only these initial tools:1
2
3
4
5
6
validate_consent
retrieve_private_reflection
compute_personal_baseline_change
retrieve_market_context
generate_neutral_observations
record_user_correctionDo not attach
create_human_review_case in the private-reflection release. Do not attach generic AWS API, shell, browser, or code-execution capabilities.If Gateway prefixes tool names, use the exact registered names. Confirm that the Harness execution role can invoke the Gateway and that Gateway inbound authorization recognizes the Harness identity.
Step 15: Attach existing AgentCore Memory to the Harness
Select
decision-resilience-memory-prod rather than creating uncontrolled default managed memory. Configure the Harness to pass trusted actor ID and session ID on every invocation.Keep raw session history short-lived. Enable long-term summary writes only after response validation. Store a summary of the decision context, user-approved corrections, and unresolved evidence. Do not store raw journal text, diagnostic language, or model speculation as durable memory.
Verify that a new session for the same actor retrieves only approved summaries. Verify that another actor receives no record. Verify that deletion removes both events and records.
Step 16: Configure the Harness execution role
Create a dedicated IAM role named
DecisionResilienceHarnessRole. Trust only the AgentCore service principal specified by the Harness creation workflow.Grant permission to invoke the exact Gateway, use the exact Memory resource, invoke the approved Amazon Bedrock model or inference profile, use the required KMS key, write approved observability data, and read approved Secrets Manager entries if needed. Do not grant direct S3, DynamoDB, or Lambda permissions to the Harness. Those resources are reached through policy-protected Gateway tools.
Add a permission boundary and use IAM Access Analyzer. Record the role ARN in the configuration evidence.
Step 17: Deploy and invoke the Harness
Complete the Harness creation in the console or deploy from the CLI flow. Wait until the Harness status is Ready.
Open its test experience and create a synthetic session with a synthetic actor ID. Submit a neutral reflection. Confirm that the Harness calls consent validation first, then retrieves only the private reflection and authorized context, and returns the required schema.
Test a request asking for another actor's reflection. Confirm denial. Test a request asking for a mental-health diagnosis. Confirm refusal or safe redirection to neutral observations. Test missing consent and unsupported jurisdiction. Confirm abstention without data retrieval.
Use the same session ID for a second turn and confirm short-term continuity. Start a new session for the same actor and confirm only approved long-term summary retrieval.
Step 18: Enable AgentCore Observability
Open Amazon CloudWatch. Under Application Signals, choose Transaction Search and enable it. Select ingestion of spans as structured logs and save.
Return to the AgentCore console and enable observability for Harness, Gateway, Memory, Policy, Identity, and the Lambda-backed targets. AgentCore provides built-in metrics, while CloudWatch provides the unified GenAI observability view.
Create dashboards for Harness sessions, invocations, latency, throttles, user errors, system errors, Gateway tool calls, policy permits and denials, Memory event creation and retrieval, abstention, corrections, and schema failures.
Configure logs to use pseudonymous identifiers and correlation IDs. Do not log raw reflections, bearer tokens, model secrets, or direct identity. Create alarms for repeated cross-user attempts, unexpected tools, unusual policy denials, sudden drops in abstention, memory growth, deletion failure, and elevated error rates.
Step 19: Configure AgentCore Evaluations
Open AgentCore Evaluations. Select the Harness and its AgentCore observability traces as the evaluation source.
Enable suitable built-in evaluators for instruction following, response relevance, faithfulness, goal success, tool selection, tool parameters, refusal behavior, and harmfulness. Built-in evaluators should not be treated as sufficient for this regulated use case.
Create a session-level LLM-as-a-judge evaluator named
neutral_observation_quality. Its instructions should score whether the response separates observation from evaluation, provides alternatives, communicates uncertainty, and avoids diagnostic or employment conclusions.Create code-based Lambda evaluators for output JSON schema, prohibited terms, required evidence references, consent-first tool order, cross-user isolation, mandatory abstention fields, and exclusion of unavailable tools. Use deterministic evaluators whenever the requirement can be represented as code.
Encrypt custom evaluators with the AgentCore KMS key. Run on-demand evaluations over synthetic datasets before every change. Configure online evaluation only after privacy approval and trace-redaction validation.
Step 20: Build the synthetic evaluation corpus
Create synthetic private reflections representing ordinary pressure, loss reflection, aggressive market vocabulary, scheduled central-bank events, overnight work, terse writing, multilingual content, sarcasm, profanity, model prompt injection, requests for diagnosis, and requests for another actor's records.
Include expected tool sequences, prohibited tools, required output fields, acceptable abstention, and policy decisions. Run each non-deterministic scenario repeatedly. Evaluate distributions rather than relying on one successful result.
Set release thresholds for policy compliance, actor isolation, evidence grounding, tool selection, abstention, prohibited language, and correction handling. Block deployment when any critical control falls below threshold.
Step 21: Configure correction and deletion inside the AgentCore workflow
Expose
record_user_correction through Gateway and Policy only to the same authenticated actor. The Harness must display the original observation and allow the actor to add context or disagree. The correction becomes authoritative context for future summaries.Create an approved deletion workflow that removes S3 source and output objects, DynamoDB consent-linked records where permitted, AgentCore Memory events, and long-term memory records. Preserve only legally required audit evidence. Test the workflow before production.
Do not rely solely on DynamoDB TTL or S3 lifecycle expiration for a formal deletion request. Produce reconciliation evidence showing completion across the supporting records and AgentCore Memory.
Step 22: Keep team analytics outside the initial Harness
Do not add team-wide tools, shared memory, manager visibility, or human-review case creation to the initial Harness. This is a deliberate control, not a missing feature.
If team resilience analytics are approved later, create a separate Harness, separate Gateway targets, separate policies, separate Memory namespaces, and de-identified input data. Do not expand the private Harness into a multi-purpose employee analytics interface.
If controlled review is approved later, create another dedicated Harness or workflow for trained reviewers. Require independent authorization, corroborating evidence, reason codes, time-limited access, two-person reidentification approval where required, and a complete audit trail.
Step 23: Validate security and failure paths
Test invalid JWT audience, client, scope, and required claims. Test IAM callers without
InvokeGateway. Test wrong actor, purpose, jurisdiction, consent version, and session. Test direct Lambda invocation outside Gateway. Test calls to unregistered tools. Test attempts to alter policy context through prompt text.Test Gateway timeout, Lambda error, Memory unavailability, model throttling, malformed tool output, missing context, conflicting evidence, and evaluation failure. The Harness should abstain or return a controlled error, not manufacture confidence.
Test deletion, memory expiry, token rotation, KMS denial, and emergency disablement. Verify that Gateway targets, Harness invocation, long-term memory, and each high-risk tool can be disabled independently.
Step 24: Complete production readiness
Review the Harness model, instructions, attached tools, Identity configuration, Gateway schema, Policy rules, Memory strategies, retention, Evaluations, Observability, KMS policies, Lambda roles, record stores, correction, deletion, incident response, and rollback.
Require approval from the business control owner, independent risk, privacy, security, legal, model validation, records management, employee representation, and operations. Pin all production versions and record their ARNs or IDs.
Deploy first to a limited voluntary population. Measure trust and correction frequency as well as technical quality. Stop expansion if users report that the system reduces candor or if managers attempt to use outputs beyond the approved purpose.
Step 25: Operate the AgentCore-centered system
Review AgentCore Evaluations, policy denials, actor-isolation tests, correction rates, abstention, model drift, tool changes, Memory growth, latency, and security findings on a defined schedule.
Treat changes to a tool description, schema, system prompt, model, memory strategy, policy, evaluator, or identity claim as controlled production changes. Re-evaluate when adding a language, product, jurisdiction, or data source.
The platform remains acceptable only while it provides value first to the trader, preserves legitimate privacy, supports correction, and keeps consequential judgment with accountable humans.
Final AgentCore service map
The managed agent loop and session compute remain in AgentCore Harness. Tool registration, MCP routing, and target invocation remain in AgentCore Gateway. Fine-grained agent-to-tool authorization remains in AgentCore Policy. Session and durable agent context remain in AgentCore Memory. Caller and delegated identity remain in AgentCore Identity. Traces and metrics remain in AgentCore Observability and its CloudWatch view. Quality measurement and release gates remain in AgentCore Evaluations.
AWS KMS, S3, DynamoDB, Lambda, Secrets Manager, and CloudWatch are supporting AWS services only. They provide encryption, durable records, deterministic tool backends, secrets, and the native observability console. They do not replace the AgentCore agent loop, memory system, gateway, policy engine, identity layer, or evaluation service.
References
Amazon Web Services. AgentCore Harness. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness.html
Amazon Web Services. Memory for AgentCore Harness. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-memory.html
Amazon Web Services. Amazon Bedrock AgentCore Documentation. https://docs.aws.amazon.com/bedrock-agentcore/
Amazon Web Services. Amazon Bedrock AgentCore Resources. https://aws.amazon.com/bedrock/agentcore/resources/
Amazon Web Services. Set Up Inbound Authorization for an AgentCore Gateway. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-inbound-auth.html
Amazon Web Services. Authorize and Authenticate to an AgentCore Gateway and Gateway Target. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-using-auth.html
Amazon Web Services. Create a Policy Engine. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/policy-create-engine.html
Amazon Web Services. Add Observability to Amazon Bedrock AgentCore Resources. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html
Amazon Web Services. Evaluators in Amazon Bedrock AgentCore. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluators.html
Amazon Web Services. Create an Evaluator. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/create-evaluator.html
AWS Samples. AgentCore Harness Examples. https://github.com/awslabs/agentcore-samples/tree/main/01-features/01-harness
Danny Chan. From Private Trading Journals to a Governed Decision Resilience System. Internal source file.
Series: Financial Service (19 articles)
- …
- 19Set Up an Amazon Bedrock AgentCore Governed Decision Resilience System Through the AWS Console This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article