AWS Bedrock

Connect an agent deployed as an AWS Bedrock AgentCore harness to AI GO! as a native model, using the typed aws_bedrock connection. The integration signs requests with your AWS credentials, mints a runtime session on the first turn, and round-trips the session_id automatically, so multi-turn evaluations preserve state.

Prerequisites

  • An agent deployed as an AWS Bedrock AgentCore harness, its region, and the harness ARN.
  • AWS credentials (access key ID and secret access key, plus an optional session token) authorized to invoke the harness.

Configuration

Define the model with connection_type: aws_bedrock and reference the AWS credentials as secrets:

key: "aws-bedrock-agent"
display_name: "AWS Bedrock AgentCore"
description: "Agent deployed as an AWS Bedrock AgentCore harness, via the typed `aws_bedrock` connection config."
task: "chat_completion"
rate_limit: 15
config:
  connection_type: "aws_bedrock"
  region: $AWS_REGION
  harness_arn: $AWS_HARNESS_ARN
  access_key_id: "<< secrets.AWS_ACCESS_KEY_ID >>"
  secret_access_key: "<< secrets.AWS_SECRET_ACCESS_KEY >>"
secrets:
  AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
  AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

Config fields

Field Required Secret Description
connection_type yes no Must be aws_bedrock.
region yes no AWS region where the AgentCore harness is deployed.
harness_arn yes no ARN of the AgentCore harness to invoke.
access_key_id yes yes AWS access key ID.
secret_access_key yes yes AWS secret access key.
session_token no yes Optional AWS session token (for temporary credentials).

Credentials

The secrets block uploads values (from your .env or environment) to server-side secret storage, and << secrets.NAME >> references them from the config so no secret is stored in plaintext. Provide the values in your .env:

AWS_REGION=us-east-1
AWS_HARNESS_ARN=arn:aws:bedrock-agentcore:us-east-1:123456789012:harness/my-harness
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...

For temporary credentials, also add session_token to both the config and secrets blocks.

Add and test

lf add model -f aws_bedrock.yaml
lf test model aws-bedrock-agent

Use in an evaluation

Reference the model key from a task specification in your run config:

evaluation:
  task_specifications:
    - task_key: my-task
      model_key: "aws-bedrock-agent"

Conversation state

On the first turn the integration mints a runtime session id; the session_id is attached to the assistant message and reused on each subsequent turn, so the agent remembers earlier turns.