<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Henry on Medium]]></title>
        <description><![CDATA[Stories by Daniel Henry on Medium]]></description>
        <link>https://medium.com/@daniel.henry546?source=rss-cff522ea47d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tnFF8Bmli8No0FCk</url>
            <title>Stories by Daniel Henry on Medium</title>
            <link>https://medium.com/@daniel.henry546?source=rss-cff522ea47d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:41:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daniel.henry546/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Testing AI Agents using the Harness Playground]]></title>
            <link>https://medium.com/@daniel.henry546/testing-ai-agents-using-the-harness-playground-3c71b22e049c?source=rss-cff522ea47d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c71b22e049c</guid>
            <category><![CDATA[harness-playground]]></category>
            <category><![CDATA[ai-agent-testing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-bedrock-agentcore]]></category>
            <category><![CDATA[amazon-bedrock-agentcore]]></category>
            <dc:creator><![CDATA[Daniel Henry]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 13:07:09 GMT</pubDate>
            <atom:updated>2026-11-16T13:07:09.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>What you need to follow on with this article</h3><ul><li>Familiarity with AWS Console</li><li>Basic level understanding of the concepts behind AI Agents</li><li>Understanding of how to navigate to through Amazon Bedrock AgentCore console</li></ul><h3>Introduction</h3><p>The AWS Bedrock AgentCore Harness Playground is a tool that enables users to test AI Agents with different models to compare outputs of Large Language Models (LLM).</p><p>To show how AWS Bedrock AgentCore Harness Playground works we will be using a very simple AI Agent that we have created and testing three models. If you would like an understanding on how to create an AWS Bedrock AI agent please see following article <a href="https://medium.com/@daniel.henry546/getting-started-with-aws-agentcore-harness-f60e25e949e9">here</a>.</p><h3>Accessing the Harness Playground</h3><p>Once you have navigated through to the AWS Bedrock AgentCore console, the following screen will appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*erThu1_es2JuhwkjzqFTew.png" /></figure><p>Now click Harness playground and the following screen will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFBWK7xK2qIQ4Qi9inFmLA.png" /></figure><h3>Testing AI Agents using Harness playground</h3><p>Now that we have accessed the Harness playground, we will be testing the harness called harness_nrlbroncosscore as shown in the screen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4G_g6Q4f8PU3-H81-TF4tg.png" /></figure><p>Now click Test Harness and the following screen will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GG54ZcYeB5NlPwoy9fkylA.png" /></figure><p>We are now going to test the gpt 6 version of OpenAI’s Luna Model (<strong>gpt-6-luna</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUJfLixS2DhKa61dAq26Xw.png" /><figcaption><strong><em>NB: I have preconfigured the AgentCore Execution Role with relevant permissions in IAM and already configured an API key via AgentCore Identity for the Agent used in this article.</em></strong></figcaption></figure><p>Now we will enter the following prompt <strong>I would like some NRL scores</strong> as highlighted in the yellow prompt below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nei4yxJqH-YSGwJo0FT81A.png" /></figure><p>Click enter and after a while the following results will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lGz5vX2KSrfiMA_DPzWYw.png" /></figure><p>Now test using <strong>gpt-oss-120b</strong> and to do this please follow the following steps:</p><ol><li>Change Model / API source to Bedrock as shown in screenshot below</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*IwcXstEZ46rTvOgMVDxt3g.png" /></figure><p>2. Select Model and the following window will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*ErvT2sd5CQjkEwG_f5VB8g.png" /></figure><p>3. Select OpenAI and choose the gpt-oss-120b and click Apply as per screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*9wbpc2dt1X_DKCcj4Mj6uA.png" /></figure><p>The following window will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9q7M4xSmH5Nt-Gdii4RnQ.png" /></figure><p>Now we will enter the following prompt <strong>I would like some NRL scores</strong> as highlighted in the yellow prompt below and click enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxNp1CIO-Ug1tQsXcF4PIw.png" /></figure><p>After a while the following results will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ih7fBXxWSV-F5RBvhYMMbQ.png" /></figure><p>Based on the following results, the<strong> gpt-oss-120b </strong>model isn’t suitable for the purpose of what we would like to which is:</p><ul><li>Find the 10 most recent Brisbane Broncos scores for 2026 and display them on the screen in tabular format.</li></ul><h3>Review of key concepts covered</h3><p>In this article, the following key concepts have been covered:</p><ul><li>Accessing the AWS AgentCore Harness Playground.</li><li>Comparing the results of 2 models based on one very simple prompt.</li><li>Changing models to allow comparision of test results.</li></ul><h3>In Conclusion</h3><p>AWS Bedrock AgentCore Harness Playground is a useful tool that will allow testing of AI Agent behaviour and compare model results.</p><p>I hope this article has given you an understanding of how you might use AgentCore Harness Playground to test your AI Agents.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c71b22e049c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with AWS AgentCore Harness]]></title>
            <link>https://medium.com/@daniel.henry546/getting-started-with-aws-agentcore-harness-f60e25e949e9?source=rss-cff522ea47d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f60e25e949e9</guid>
            <category><![CDATA[amazon-bedrock-agentcore]]></category>
            <category><![CDATA[build-ai-agents]]></category>
            <category><![CDATA[aws-bedrock-agentcore]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Daniel Henry]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 12:25:32 GMT</pubDate>
            <atom:updated>2026-09-27T13:05:24.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>What you need to follow on with this article</h3><ul><li>Familiarity with AWS Console</li><li>Understanding of how to create an AWS Lambda</li><li>Basic level understanding of AWS EventBridge</li><li>Basic level understanding of the concepts behind AI Agents</li><li>Access and knowledge on configuring Composio MCP Server. More information available <a href="https://composio.dev/for-you">here</a></li></ul><h3>Introduction</h3><p>AWS AgentCore Harness is a great way to begin building and testing AI agents on AWS. You can start by setting up your AWS account and making sure you have the right permissions and tools available. AWS AgentCore Harness helps you connect your AI agent with the tools and services it needs to perform tasks.</p><p>To get started with AWS AgentCore Harness we will be building an AI Agent that will generate a random recipe based on two random ingredients and send it to an email. We will then invoke the AI Agent Harness using AWS EventBridge and AWS Lambda</p><h3>Creating your AI Agent</h3><p>AWS AgentCore Harness offers a fully managed way to create and run AI agents without managing infrastructure or writing orchestration code. Harness handles the agent loop automatically, giving every session an isolated runtime environment with its own filesystem and shell</p><p>To create the Harness, we will start by creating the AI Agent to generate our recipe using two randomly generated ingredients. To create this AI Agent, start by accessing the AWS Bedrock AgentCore in the console as per the image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*k6221CDMxJc7DpXNF3n5rg.png" /></figure><p>Now click Amazon Bedrock AgentCore and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ItSsRqqS5_l--HNpuHVeQg.png" /></figure><p>Now to setup our AI Agent via a Harness, to do this click <strong>Harness</strong> which can be found under the <strong>Build</strong> section. Click Harness and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJ2QVl6RcC-I6deMyYeovw.png" /></figure><p>To create the Harness, click <strong>Quickly create Harness </strong>and you will be provided with two options:</p><ul><li>Quickly create harness</li><li>Advanced create harness</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iN0GqwYGj_rARHLTsK6_4A.png" /></figure><p>Click quickly create harness and the following will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*04cMrYZO-h4sXaKSjPaW6w.png" /></figure><p>Change the default harness name to <strong>harness_recipegenerator </strong>and click create and the following will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aOUT-n1jz-WRGFp65pZ0mQ.png" /><figcaption>Please note using any Claude model we will require you to fill out a use case form</figcaption></figure><p>Go back into the Harness home screen as per below window</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*av6W1epJUwrGVAw_kCPnWQ.png" /></figure><p>Now select <strong>harness_recipegenerator</strong> and the following screen will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GQCkq2wFFINWbMcFhGoBA.png" /><figcaption>Key elements have been blacked out</figcaption></figure><p>Now click edit and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DZ5dv2e6h64K2ts56uqSw.png" /></figure><p>Now select Model and system prompt and the following will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xh4QL2Z7xBKWD_iccJymeg.png" /></figure><p>Now select the yellow highlight in image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMJHfML4YocszEZW5fe1FQ.png" /></figure><p>Once the image highlighted in yellow is clicked, the following will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*Fb5_uD9EsNcMX9ZzcDLRCQ.png" /></figure><p>Now select OpenAI, <strong>gpt-oss-120b</strong> as per window below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Or_JUsJ42BEMBGItZd2fxg.png" /></figure><p>Click <strong>Apply </strong>and the following window will appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4SZAJacmdN_DwvP2vJ2wQ.png" /></figure><p>Copy the following prompt below into system prompt</p><p><em>You are helpful recipe generator</em></p><p><em>You will select three random ingredients, and you will generate a recipe using the ingredients that the user has provided.</em></p><p><em>This recipe will provide the following:</em></p><p><em>-Total Cooking Time</em></p><p><em>-Additional Ingredients Required</em></p><p><em>-Instructions on how to cook recipe</em></p><p><em>Upon finding the recipe you will email the recipe to &lt;&lt;enter your own email address&gt;&gt;</em></p><p>The window should look like the following in the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJf9LzFEGtOWU-R6zadtWw.png" /><figcaption>Please note before copying prompt you will need to replace &lt;&lt;enter your own email address&gt;&gt; with your own email address.</figcaption></figure><p>Now click <strong>Save Harness</strong> as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bP0xDYkaWzQHq7WjMy8VoQ.png" /></figure><p>Click <strong>Save Harness</strong> and the following window as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-UO6HFdViLRtjDJk9VBsxg.png" /></figure><p>Congratulations you have now created an AWS AgentCore Harness and now we will proceed to add a tool for our Agent to send an email via Gmail.</p><h3>Configuring your tools for AWS AgentCore Harness to use.</h3><p>As we want to send the recipe to an email address a tool needs to be configured for the AWS AgentCore Harness to use. For this tool, the Composio MCP Server which has already been configured to use the Gmail plugin for the purposes of this example.</p><p>To configure a Tool, go back to our Harness (<strong>harness_recipegenerator</strong>) and edit the Harness. When the Harness is edited the following window will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8e13FbU7qAoSllGkFOwlA.png" /></figure><p>Now select <strong>Tools</strong> and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOpb1rSqfMTE3oFaaLWNeA.png" /></figure><p>To send an email, we will select Remote MCP Server as per the below screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXEdUgzt2HpAetM03oDhMg.png" /></figure><p>Now enter the endpoint URL to the Composio MCP server and the consumer API key from Composio as per the below screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*O2xvoKoubxvioo8SIoMXFg.png" /><figcaption>The API key is deliberately not shown in the image above</figcaption></figure><p>To get the Composio MCP consumer API key follow the following steps:</p><ol><li>Go to <a href="https://dashboard.composio.dev/">https://dashboard.composio.dev/</a> (you must have an account with Composio to do this)</li><li>Go to Settings — Sessions &amp; API key and copy the API key shown</li></ol><p>Now that we have entered our MCP server details we will save our Harness.</p><p>Congratulations you have now added a Tool to your agent. The next step is to setup an IAM access policy that enables an AWS Lambda to invoke the AI agent configured in the earlier example.</p><h3>Creating an IAM access policy that enables the Lambda to invoke the AgentCore Harness.</h3><p>Before we setup the Lambda, an IAM policy that enables us to invoke our Agent Harness needs to be created. To do this go to IAM within the AWS console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzl_XtzjqqNBS_hoWGpMiw.png" /></figure><p>To setup the policy, navigate to Policies and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWYjaC1JxdIuv3fAUiN7lw.png" /></figure><p>Now click Create Policy and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jJu0kHqY1l2nIGEkyEP-g.png" /></figure><p>Now click JSON and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MqMMJoNPJBkrlWZ7FQSHmQ.png" /></figure><p>Now add the following JSON to the policy editor which is shown below</p><pre>{<br> &quot;Version&quot;: &quot;2012–10–17&quot;,<br> &quot;Statement&quot;: [<br> {<br> &quot;Effect&quot;: &quot;Allow&quot;,<br> &quot;Action&quot;: [<br> &quot;bedrock-agentcore:InvokeHarness&quot;,<br> &quot;bedrock-agentcore:InvokeAgentRuntime&quot;<br> ],<br> &quot;Resource&quot;: [<br> &quot;&lt;Your Harness ARN&gt;&quot;,<br> &quot;&lt;Your Harness Runtime ARN&gt;&quot;<br> ]<br> }<br> ]<br>}</pre><p>Before copying the JSON, replace &lt;Your Harness ARN&gt; and &lt;Your Harness Runtime ARN&gt; with the Harness ARN and Harness Runtime ARN of the <strong>harness_recipegenerator </strong>created earlier<strong>. </strong>The policy editor window will look like the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtLHCneWBRDY0EMZmIiTiw.png" /></figure><p>Now click Next and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YuKJZuM1z6LievlizTRgDg.png" /></figure><p>Name the Policy <strong>RecipeGeneratorInvokeAgent</strong> and the description will be <strong>this policy will enable our Lambda to invoke our AgentCore Harness</strong>, the window will look as per the below screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCJW9y12gBmVGeD9IzsHFg.png" /></figure><p>Now click Create Policy and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eAKlhjMGj8k2bje2LyCv9Q.png" /></figure><p>Now we will setup the Lambda to invoke the AI agent setup earlier.</p><h3>Setting up our AWS Lambda to invoke our AI agent.</h3><p>To setup an AWS Lambda, navigate to Lambda on the console and the following window will be similar to the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSTgfeSGu5IBO8URSgqXgg.png" /></figure><p>Now click create a function and the following screen will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rgh_GRUrw7gA38hEm4rGng.png" /></figure><p>Now call our Function name <strong>AWSRecipeGeneratorLambda</strong> and select <strong>Python 3.14</strong> as our runtime as shown in the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ru8o9fxaYe25DbYitGoZgg.png" /></figure><p>Now click Create Function and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebirxZtrdka1QszbMjhEag.png" /></figure><p>Now copy and paste the Python Code below into the <strong>lambda_function.py</strong></p><pre>import os<br>import json<br>import uuid<br>import boto3<br>from botocore.exceptions import ClientError<br><br># Initialize the Bedrock AgentCore client globally for connection reuse<br># The client service name is &#39;bedrock-agentcore&#39;<br>agentcore_client = boto3.client(&#39;bedrock-agentcore&#39;)<br><br>def lambda_handler(event, context):<br>    &quot;&quot;&quot;<br>    Invokes an Amazon Bedrock AgentCore Harness using parameters <br>    extracted dynamically from an incoming event trigger.<br>    &quot;&quot;&quot;<br>    # 1. Fetch Harness ARN from environment variables<br>    harness_arn = os.environ.get(&#39;HARNESS_ARN&#39;)<br>    if not harness_arn:<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: json.dumps({&#39;error&#39;: &#39;HARNESS_ARN environment variable is missing.&#39;})<br>        }<br>        <br>    # 2. Parse dynamic inputs from the incoming event trigger<br>    # Falls back to defaults if properties are missing<br>    user_prompt = event.get(&#39;prompt&#39;, &#39;Hello, please get me a recipe&#39;)<br>    <br>    # Session ID keeps history/state tracked for multi-turn conversations<br>    session_id = event.get(&#39;sessionId&#39;, str(uuid.uuid4()))<br>    user_id = event.get(&#39;userId&#39;, &#39;default-lambda-user&#39;)<br>    actor_id = event.get(&#39;actorId&#39;, &#39;user-actor&#39;)<br>       <br>    # 3. Structure payload for the InvokeHarness data plane API<br>    # Uses Converse-like structure for message formatting<br>    try:<br>        response = agentcore_client.invoke_harness(<br>            harnessArn=harness_arn,<br>            runtimeSessionId=session_id,<br>            messages=[<br>                {<br>                    &#39;role&#39;: &#39;user&#39;,<br>                    &#39;content&#39;: [<br>                        {<br>                            &#39;text&#39;: user_prompt<br>                        }<br>                    ]<br>                }<br>            ],<br>            actorId=actor_id<br>        )<br>        <br>        # 4. Parse the response payload from the AgentCore harness loop<br>        # The agent core runs the model, executes tools, and returns the final response<br>        return {<br>            &#39;statusCode&#39;: 200,<br>            &#39;body&#39;: json.dumps({<br>                &#39;sessionId&#39;: session_id,<br>                &#39;response&#39;: response.get(&#39;output&#39;, {}),<br>                &#39;raw&#39;: str(response)  # Contains token counts or trace data if enabled<br>            }, default=str)<br>        }<br><br>    except ClientError as e:<br>        print(f&quot;AWS ClientError occurred: {e.response[&#39;Error&#39;][&#39;Message&#39;]}&quot;)<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: json.dumps({&#39;error&#39;: e.response[&#39;Error&#39;][&#39;Message&#39;]})<br>        }<br>    except Exception as e:<br>        print(f&quot;Unexpected error: {str(e)}&quot;)<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: json.dumps({&#39;error&#39;: str(e)})<br>        }</pre><p>Once the code has been copied, the <strong>lambda_function.py </strong>will look similar to the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ScKmo73Njkc0iFU4aVuvpQ.png" /></figure><p>Before the code is deployed, an environment variable needs to be setup, this environment variable will be called <strong>HARNESS_ARN</strong>. To do this click the configuration tab and the following window will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pefg2W9bBeyPsU6r95AhVQ.png" /></figure><p>Now click Environment variables and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zndLFS1lJNaLFZRTf9nC5Q.png" /></figure><p>Now to add Environment variables click Edit and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyGBRkhzG3GNCzmrB-JsHQ.png" /></figure><p>Click Add environment variables and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8B2aJAV2tCFP0pwdMoz-w.png" /></figure><p>Now add the value HARNESS_ARN of the Harness ARN, this value is the Harness ARN of the <strong>harness_recipegenerator</strong> setup earlier. Once the Harness ARN has been added, click save.</p><p>Now deploy the code by Click Code and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOE8ApU_q7Stpgxd2XCsaA.png" /></figure><p>Now click Deploy.</p><p>Now the Lambda code has been deployed the code needs to be tested and to do this click the <strong>Test</strong> tab and the following window will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEAKQjEEG5e96bf9TqcVuw.png" /></figure><p>To create the test event, setup the test event as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hd0JiCkYrcGcNiig7gAhdw.png" /></figure><p>Before the test event is saved, replace &lt;your harness runtime id&gt; with the Harness runtime Id of the <strong>harness_recipegenerator </strong>Agent Harness that was setup earlier.</p><p>Now let’s test the Lambda.</p><p>The Lambda has successfully executed but the email hasn’t been received, lets dig deeper into the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ih12ROrEEeSnFsHQpFkKvA.png" /></figure><p>The Lambda didn’t successfully execute because the IAM policy hasn’t been added to the Lambda permissions. To add the IAM policy created earlier, go to Configuration and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfLb0gsMnNrQa80suUE2yw.png" /></figure><p>Select <strong>Permissions</strong> and the following window will appear as per the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSGGoswfTarBxWNBgpEjaw.png" /></figure><p>To add the IAM policy <strong>RecipeGeneratorInvokeAgent </strong>click the<strong> </strong>AWSRecipeGeneratorLambda-role as per above screenshot. The following window will appear as a new tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaDAQtKqeg9jnX8nx0prZQ.png" /></figure><p>Now click Add Permissions and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*P7tB6140BcPsA3DnFSarWg.png" /></figure><p>Click Attach policies and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWpnJYz5CMoKEs4E5o3Z5w.png" /></figure><p>Search for <strong>RecipeGeneratorInvokeAgent </strong>and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQBNTPpqV8oeGiLOgL5bSA.png" /></figure><p>Select the policy and then click Add permissions. The policy has now been added to the Lambda role as per below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Ckx-zTAQxTaFHpz_iKGq-Q.png" /></figure><p>Now lets retest the Lambda. The Lambda test has been successful as per below screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyXUosNTd1-KnHjVhEbkUg.png" /></figure><p>Now an Amazon EventBridge Scheduler will be setup to send the Random Ingredient Recipe every 24 hours.</p><h3>Setting up an Amazon EventBridge scheduler to send our random recipe via our AI agent every 24 hours.</h3><p>Now to setup the schedule, navigate to Amazon EventBridge within the AWS console and the following will appear as per the screenshot below (this may appear differently if EventBridge schedules have been setup).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IUBZxIt_Eu0u0KYXhHGyw.png" /></figure><p>Now navigate to Schedules and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sa1nVQJIRhk97xBopvirHA.png" /></figure><p>Now click Create schedule and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2T406MWVdOMiNurWlzCrgQ.png" /></figure><p>Now for the Recipe generation every 24 hours, the following schedule as per the below screenshot will be setup</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*J4Tlb9TVZCJ_D1dCyjxnGw.png" /></figure><p>Now scroll down and click Next and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-OW7ZK0LoRpIIzDwA9HyA.png" /></figure><p>Before clicking next replace &lt;your Harness runtime id&gt; with the Harness Runtime Id of the Recipe Generator Agent created earlier. Click next and following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbagMPzNNQDo_CMwQqpsPQ.png" /></figure><p>Scroll down and click next and then review and create the schedule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9r7D7XRKJXug3TKf6TWkug.png" /></figure><p>Click Create Schedule and following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQGOWd24f2YeB3iQviXOzQ.png" /></figure><p>Now go back into the schedules and the following will appear as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdJETum5nbzfuHMsV7WxQA.png" /></figure><p>The first schedule will have sent an email once its configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*L0idzPL2uwI-fFN9x-P_Lw.png" /></figure><h3>Review of key concepts covered</h3><p>In this article, the following key concepts have been covered:</p><ul><li>Creating your AI Agent via AWS AgentCore Harness and changing model used by AI agent.</li><li>Configuring your tools for AWS AgentCore Harness to use.</li><li>Creating an IAM access policy that enables the Lambda to invoke the AgentCore Harness.</li><li>Setting up our AWS Lambda to invoke our AI agent.</li><li>Setting up an Amazon EventBridge scheduler to invoke an AWS Lambda that in turns invokes the AgentCore Harness</li></ul><h3>In Conclusion</h3><p>AWS AgentCore Harness is a great way to begin building and testing AI agents on AWS and helps you connect your AI agent with the tools and services it needs to perform tasks.</p><p>I hope this example has given you a starting point to start exploring the capabilities of AWS AgentCore Harness.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f60e25e949e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>