WEBVTT

00:00.160 --> 00:00.560
Okay.

00:00.600 --> 00:01.440
The moment of truth.

00:01.440 --> 00:07.160
It's time to actually run a careful sales manager, a new sales manager.

00:07.440 --> 00:09.000
And this is an agent.

00:09.040 --> 00:10.320
It's named the same as before.

00:10.360 --> 00:11.280
Sales manager.

00:11.320 --> 00:12.280
The instructions.

00:12.320 --> 00:13.040
Same as before.

00:13.080 --> 00:14.760
Sales manager's instructions.

00:14.800 --> 00:17.160
Same tools and same handoffs as before.

00:17.200 --> 00:18.280
And the same model.

00:18.320 --> 00:19.920
The difference is right here.

00:19.920 --> 00:23.440
The difference is that we are passing in an input guardrail.

00:23.600 --> 00:26.840
Input guardrails is guardrail against name.

00:26.840 --> 00:32.160
And of course you can also have output guardrails that will affect the final output.

00:32.560 --> 00:38.800
And what we're doing is we're going to make this message send a cold sales email address to dear CEO

00:38.800 --> 00:41.680
from Alice and then kick this off.

00:41.880 --> 00:46.400
And no surprise, what we're doing here is we're passing in someone's name.

00:46.400 --> 00:53.360
And so we are expecting that the trip wire is going to get triggered, because our guardrail is going

00:53.360 --> 00:55.400
to notice that there's someone's name in here.

00:55.440 --> 00:59.120
Now, you might be forgiven for thinking, okay, well, what exactly is the point in this?

00:59.120 --> 01:04.680
I can see with my own eyes that we're passing in someone's name here, and you could just call an LLM

01:04.680 --> 01:05.760
at this point or something.

01:05.800 --> 01:06.560
You know what?

01:06.560 --> 01:07.720
What are you doing exactly?

01:07.720 --> 01:14.640
The point is that, look, we've hard coded here the message that we're sending in to generate these

01:14.640 --> 01:15.600
sales emails.

01:15.600 --> 01:18.680
But the idea is that you'll be building this into a product.

01:18.720 --> 01:24.000
You'd have a product which would have a prompt, and your users, this kind of input wouldn't just be

01:24.000 --> 01:26.000
hard coded in a in a notebook.

01:26.040 --> 01:33.360
It would be typed in by your users, your sales team, a prompt to to kick off their sales automation.

01:33.360 --> 01:39.440
And so the purpose of this kind of tripwire is to make sure that no one types in your CEO's actual name,

01:39.600 --> 01:44.200
or perhaps there'll be other PII personal identifiable information like phone numbers that you'd want

01:44.200 --> 01:48.120
to make sure did not get put in your cold sales emails.

01:48.120 --> 01:49.720
That's the intention here.

01:49.720 --> 01:55.080
So whilst this is a little bit artificial that we've got it right here, the point is that this protection

01:55.080 --> 02:00.640
would be, would apply to any input prompts that are coming in to your Agentic framework.

02:00.640 --> 02:02.240
That's the purpose of the guardrail.

02:02.440 --> 02:05.200
So with that explained we will now kick this off.

02:05.200 --> 02:08.920
We're going to run the careful sales manager and off it goes.

02:08.960 --> 02:11.040
And bam there's been an exception.

02:11.080 --> 02:11.760
You might think.

02:11.800 --> 02:13.360
Bug in my code, but no.

02:13.600 --> 02:17.080
The exception is what happens when a guardrail is triggered.

02:17.120 --> 02:20.160
And what you'll see here is guardrail input.

02:20.400 --> 02:21.680
Guardrail triggered.

02:21.720 --> 02:22.800
Tripwire.

02:23.000 --> 02:25.240
So something went wrong.

02:25.520 --> 02:30.240
And to look in more detail on what went wrong I mean, something went right because something went wrong.

02:30.280 --> 02:41.760
We go in here, we open up the protected SDR and we should see guardrail against name, name check.

02:42.240 --> 02:45.760
And we should see that that this guardrail got triggered.

02:45.760 --> 02:48.920
The output is name and message is true.

02:49.080 --> 02:50.640
Name is Alice.

02:50.800 --> 02:58.200
So indeed the guardrail here was triggered and that's why the process was stopped with an exception.

02:58.800 --> 03:05.320
So that is successful triggering of a tripwire and hopefully makes some sense.

03:05.880 --> 03:10.040
And of course, to make sure you're convinced this is working, I need to show you an example with the

03:10.040 --> 03:15.810
tripwire not being triggered so we can just call exactly the same careful sales manager, but this time

03:15.810 --> 03:21.850
the message is going to be send out a cold sales email address to the CEO from the Head of Business

03:21.850 --> 03:22.650
development.

03:22.690 --> 03:24.530
No more mention of Alice.

03:24.770 --> 03:26.530
And if I kick this off?

03:26.690 --> 03:27.610
Off it goes.

03:27.610 --> 03:28.290
It's running.

03:28.290 --> 03:34.090
You can see right away that there isn't an angry guardrail that's being trip wired.

03:34.370 --> 03:36.890
And so that is running successfully.

03:36.890 --> 03:39.490
And in fact, I just kicked this off a moment ago as well.

03:39.530 --> 03:41.970
And so I already have my prior email.

03:41.970 --> 03:42.930
And here it is.

03:43.130 --> 03:47.370
It did indeed come back with a perfectly decent email.

03:47.370 --> 03:49.850
And you'll be pleased to see that it's signed off.

03:49.890 --> 03:51.890
The head of Business Development.

03:52.130 --> 04:00.290
I'm interested to see it also has a copyright 2023, which is a slight sign of the results of of knowledge

04:00.290 --> 04:01.210
cut offs there.

04:01.250 --> 04:05.210
You could always try and add that as a as a tripwire, as a guardrail if you wished.

04:05.650 --> 04:09.370
So that is showing you guardrails working.

04:09.530 --> 04:13.130
And now some exercises for you to take this to the next level.

04:13.330 --> 04:14.730
Try some different models.

04:14.730 --> 04:18.930
We've tried Gemini and Deep Seek and Grok llama 3.3 through grok.

04:19.130 --> 04:25.890
This has just finished successfully, and you can try more of those two and see the different, different

04:25.890 --> 04:27.450
kinds of models that you can use there.

04:27.450 --> 04:31.850
The variety add some more input guardrails and output guardrails.

04:32.210 --> 04:38.730
And then finally we had our first exploration of of structured outputs there with the agents SDK.

04:38.890 --> 04:40.010
Try adding some more.

04:40.130 --> 04:47.170
When we generate emails we could actually be populating a one of these pydantic objects a schema instead

04:47.170 --> 04:50.410
of just returning text of the email.

04:50.410 --> 04:56.450
So try adding that to that is obviously a more robust, more bulletproof way of doing it.

04:56.770 --> 05:01.570
And then experiment with this and get to a point when you're happy with your SDR.

05:01.610 --> 05:04.010
You could also put a user interface around it if you wanted.

05:04.050 --> 05:07.450
And that is an interesting business development tool.

05:08.050 --> 05:08.490
All right.

05:08.490 --> 05:15.330
That concludes our session on tools agents, guardrails structured outputs and the like.

05:15.610 --> 05:22.650
Next time we're moving on to our next big project, which I'm so excited about building our own deep

05:22.650 --> 05:23.490
research.

05:23.770 --> 05:24.770
See you next time.
