AWS SES

AWSSESTool enables an Agent to send emails using Amazon Simple Email Service (SES).

Prerequisites

The following example requires the boto3 library and valid AWS credentials. You can install boto3 via pip:

1uv pip install boto3

You must also configure your AWS credentials so that the SDK can authenticate to SES. The easiest way is via the AWS CLI:

1aws configure
2# OR set environment variables manually
3export AWS_ACCESS_KEY_ID=****
4export AWS_SECRET_ACCESS_KEY=****
5export AWS_DEFAULT_REGION=us-east-1
Note

Make sure to add the domain or email address you want to send FROM (and, if still in sandbox mode, the TO address) to the verified emails in the SES Console.

Example

The following agent researches the latest AI news and then emails a summary via AWS SES:

1from kern.agent import Agent
2from kern.models.openai import OpenAIResponses
3from kern.tools.aws_ses import AWSSESTool
4from kern.tools.hackernews import HackerNewsTools
5
6# Configure email settings
7sender_email = "verified-sender@example.com" # Your verified SES email
8sender_name = "Sender Name"
9region_name = "us-east-1"
10
11agent = Agent(
12 name="Research Newsletter Agent",
13 model=OpenAIResponses(id="gpt-5.2"),
14 tools=[
15 AWSSESTool(
16 sender_email=sender_email,
17 sender_name=sender_name,
18 region_name=region_name
19 ),
20 HackerNewsTools(),
21 ],
22 markdown=True,
23 instructions=[
24 "When given a prompt:",
25 "1. Extract the recipient's complete email address (e.g. user@domain.com)",
26 "2. Research the latest AI developments using HackerNews",
27 "3. Compose a concise, engaging email summarising 3 – 4 key developments",
28 "4. Send the email using AWS SES via the send_email tool",
29 ],
30)
31
32agent.print_response(
33 "Research recent AI developments in healthcare and email the summary to johndoe@example.com"
34)

Toolkit Params

ParameterTypeDefaultDescription
sender_emailstrNoneVerified SES sender address.
sender_namestrNoneDisplay name that appears to recipients.
region_namestr"us-east-1"AWS region where SES is provisioned.
enable_send_emailboolTrueEnable the send_email functionality.
allboolFalseEnable all functionality.

Toolkit Functions

FunctionDescription
send_emailSend a plain-text email. Accepts the arguments: subject, body, receiver_email.

Developer Resources