Skip to content
CBT Nuggets
DemoBook a Demo

Understand Artificial Intelligence Basics

This skill explores the integration of Artificial Intelligence (AI) in network automation, highlighting its benefits such as faster development and reduced barriers to entry. It discusses the use of AI tools like ChatGPT and GitHub Copilot for writing and debugging code, and emphasizes the importance of responsible AI usage, particularly concerning data privacy and intellectual property. The skill also addresses potential pitfalls like AI hallucinations and provides guidance on using AI securely and effectively in network automation environments.

Full skill from CCNP AUTOCOR. Preview the IT training 23,000+ organizations trust.

49m

Skill 25 of 26 in CCNP AUTOCOR

Artificial Intelligence in Network Automation

In this video we introduce the topic of Artificial Intelligence (AI). We discuss how AI can be used in the context of network automation to generate, debug and improve code. We highlight some of the main benefits of using this approach such as faster development and a reduced barrier of entry to network automation.

Knowledge Check

AI systems can only be used to write new code and cannot assist in debugging or improving existing code

Data Privacy and IP Ownership Considerations

As we now know, Artificial Intelligence has many benefits. However, that does not mean that it doesn't also present its own set of problems and complications. In this video, we discuss two of these challenges in detail. Namely - data privacy and intellectual property.

Knowledge Check

What is a potential risk of using public AI systems like ChatGPT for analyzing network configurations?

Hallucinations and Output Validation

Previously we highlighted the challenges of data privacy and intellectual property in the world of Artificial Intelligence. In this video, however, we take a closer look at a very unique characteristic of the technology - hallucinations! Why do they arise and how should we deal with them? Let's find out!

Knowledge Check

Match the AI concepts with their explanations.

This interactive assessment is available in the full learning experience.

Want to answer questions like this yourself?
with no purchase required. Already have an account?

Considerations for Using AI Responsibly

So far we've discussed some of the potential pitfalls of using AI incorrectly. In this video, however, we highlight some actions you can take to use AI in a more secure and responsible fashion. Check it out!

Knowledge Check

What is a recommended practice before deploying AI-generated network configurations to a production environment?

Validation

Let's now validate what we've learned in this skill!

Instructions:

Launch the lab below and open the Linux Mint virtual machine. Run the command "ollama list" to see the available models installed on the system. Next, run the "mistral" model and use it to generate a Netmiko script that will connect to the Cisco IOS device in the lab with the IP address of 10.0.0.1, username of "john" and password of "Cisco123". The script should run the command "show ip interface brief" and print the result. Finally, test the script against the device in lab.

Check out the video solution below!

Knowledge Check

How much experience do you have using AI for network automation?

This interactive assessment is available in the full learning experience.

Want to answer questions like this yourself?
with no purchase required. Already have an account?

View Transcript

Artificial Intelligence in Network Automation

0:00Hey friends, welcome back. We have another skill for you and in this one we're going to get to the fun stuff.

0:05The stuff that everyone's all hyped about. We're going to be talking about AI.

0:09We're going to talk about some of the benefits but importantly we don't just have to talk about

0:13the cool exciting stuff, we have to talk about how we can use AI in a responsible manner.

0:18So with that said, let's just kick things off and talk about how we can use AI to help us with our

0:23code development and our automation development writing scripts, that type of thing.

0:28So it won't be any surprise to you to know that we can use these AI systems to write code,

0:32to write Ansible playbooks, to write NetMeco scripts, that type of thing, because we have

0:36seen it already within this course. Now in our case we've seen things like using ChatGPT to

0:42write Python scripts, we've also used Clod, but quite honestly there is a whole ecosystem

0:47of these types of tools. We've got things like GitHub Copilot for example and quite honestly

0:52there are a lot more tools than this let me tell you. Now regardless of the tool that you select,

0:57ultimately they can all kind of do similar things. They can help us write codes, so that could be

1:03just a brand new creation of a script to change the OSPF configurations across your network.

1:09The ChatGPT, the Clod instance, whatever you're using, that can help you do that. But what it can

1:13also do, it can also debug that particular piece of code so if something is wrong and you're not

1:18quite sure how to solve it, the AI systems can help you out there. And in fact, to be honest

1:24with you, at least in my opinion, the debugging feature is one of the most useful features of AI.

1:29Gotta say, it really does save you a lot of time if you know how to use it correctly. So that could

1:34be debugging code that it originally wrote for you, which is kind of comical, or it can debug

1:40code that you have written yourself, whatever it may be, the point is we can fix these problems.

1:45And by the way, in a similar sense, we don't just have to fix particular problems, maybe it just

1:50might be that we can improve our code, for example. You know, it still might work in its current form,

1:55but it can be improved. Once again, having this AI and its ability to review what you're doing,

2:02kinda is super, super helpful. So there's so many wins here, okay? Alright, so we all know the old

2:07way in which networks were managed. What we would do is we would use like something like SSH to

2:13manually log in to a device, we can make configuration changes, log out, and then manually log

2:18into the next one, type in the configs for that, so on, so forth. And then came the era of automation,

2:24made things so much easier, whereby we could ultimately use these Python scripts, use things

2:29like Ansible to connect to all of our devices at the same time, and deploy these changes. That said

2:34though, we still had the bottleneck of actually writing these scripts, and this could take quite

2:39a bit of time, depending on the type of automation that you're doing. For example, if you are using

2:44Yang-based network automation, it's super powerful as we have already seen, but it can be a little

2:50bit difficult to work with. It can take a lot of time in order to get scripts working exactly

2:55as you expect. And quite honestly, it could transpire that writing code might take you days,

3:01weeks, and maybe even longer, depending on what it is you're doing. So this is where we come to

3:06one of the main benefits of using AI systems and network automation. Just like the way that network

3:12automation sped everything up, the use of AI ultimately speeds things up even further. It allows us

3:18to work at a quicker pace. For example, AI can tell you the type of libraries you should be using.

3:23Maybe the code that you're writing is going to have a lot of common boilerplate code that is

3:28not really inevitable, but it does take a lot of time to type out and, well, to get onto the page.

3:34Not the case when you're using AI. AI is so used to this type of stuff, it's trained on it, so it

3:39really is not much of a problem for AI to spit out this code at a rate of knots, okay? It really can

3:45speed things up. All right, so the speed factor, that's probably maybe the most obvious benefit of

3:50using AI. You can almost feel it in your bones, can't you? When everything is working in your favor,

3:55it almost feels effortless. Now that said, that doesn't mean it's the only benefit to be had with

4:00AI. For example, we also have the benefit of accessibility. Because here's the thing, when you

4:06happen to be introducing concepts of network automation into your team, it might not be the

4:11case that every engineer on your team has experience with Python and Ansible and Yang-based

4:17data modeling, for example. Ultimately, with AI, you kind of have this crutch. Maybe that's

4:23a negative connotation, but it's not meant to be. It gives you this support system. Like a good friend

4:28you can ask for advice to help you through a problem, this is what AI gives to everyone on the team.

4:33So maybe they don't have the most extensive Python experience, but they can still ultimately

4:39write a Python script, or at least evaluate a Python script, just by having a fairly decent

4:44understanding of the tool or task and using their natural language to communicate with an AI system.

4:50So at least in my opinion, I think that's really reducing the fear factor behind automation, whereby

4:56when network automation first came on the scene, there was a small subsection of network engineers

5:01who took that concept and just ran with it, whereas many other people just didn't really want

5:06to touch it. They were kind of terrified of it, to be honest with you. They did not want to use

5:11automation to make configuration changes, because if it broke the network, well, it kind of spelled

5:17disaster and they did not have the confidence to use these particular tools. Not so much anymore,

5:22in fact, the next benefit kind of leans into the previous one. When we have AI systems, it makes

5:28it a lot easier to learn a new technology or a new tool. I mean, I'm sure you've used it yourself

5:33when you're trying to understand a particular technology, the AI system can give you an answer

5:39about the very specific query that you have. Maybe the question you have in your mind is not

5:45thoroughly documented, but it doesn't make sense to you, because you can talk to the large language

5:50model, the AI system, give it all your context and then highlight what your problem is. Ultimately,

5:56that can help you solve that problem and will learn that tool, be comfortable with that tool,

6:00which again, like I say, leans in to the second benefit. It gives people that accessibility.

6:06Now, ha, it's not all roses here, like I said, when it comes to AI, there's a few pitfalls we have to

6:13be aware of and we're going to be looking at these pitfalls in more detail throughout this skill, but

6:18for the moment, let's just park that thought. Without going into too much detail, let me just

6:22say at a high level overview, you may have issues with things such as basic security when it comes

6:28to your AI automation. You also might have issues with data privacy, which is a very serious topic.

6:34In a similar sense, if you are using AI systems to develop your own proprietary software, you may

6:41actually have an issue with the intellectual property ownership of that particular tool.

6:45And again, we will expand upon each of these subjects later on within this very skill. Now,

6:50before we get to that, let me highlight one more thing. Within this particular course,

6:54we see a lot of focus on things such as CI-CD pipelines. Honestly, it's been a really heavy

7:00focus of ours because it's a really heavy focus in the world of network automation. And I just

7:05kind of want to draw your attention to how AI systems actually fits into this type of architecture.

7:11One of the most important components of building a robust CI-CD system is actually choosing the

7:16correct tooling. Just as we mentioned before, which type of tools are we going to be using to

7:21automate our network? Which type of protocols are we going to be using? Is it going to be RESTConf?

7:26Is it going to be the CLI? Is it going to be gRPC? When it comes to building out a responsible and

7:32robust automation system, the whole design of the process, the whole architecture, really requires

7:38great consideration and AI can really help you think through this particular problem.

7:42And in a similar sense, when you have selected the tools and you have selected the configuration

7:47style that you want to be implementing, AI systems, as we have already seen, can help you

7:51build these particular scripts and build these particular processes. And then also, when we

7:56happen to be making these changes in our CI-CD systems, we can also validate these changes via

8:02the use of AI because AI can help you analyze log outputs. It can help you identify error messages.

8:08Basically, what I'm trying to highlight is that the use of AI tools is not just beneficial in this

8:12small, isolated manner. Ultimately, AI systems help improve and stabilize the entire life cycle

8:19of our automation operations. Now, like I said, it's not just all benefits and roses and happiness

8:25with the use of AI. There also are some serious risks and considerations to think about. So,

8:30friends, how about we highlight some of those risks in the very next video.

Data Privacy and IP Ownership Considerations

0:00Hey friends, welcome back.

0:01So in this video, what we're going to be doing is talking about some of the risks, the potential downsides of using AI.

0:08So I suppose the first thing we will talk about is data privacy.

0:12All right, so let's imagine this.

0:13Let's just have some network configurations and let's imagine this as a real live network, okay?

0:18Not my lab environment, okay?

0:20So let's just do a show run and get the running configuration.

0:23And all I'm going to do here is just highlight it all and copy it.

0:26Okay, so copy here.

0:28Now, let's just say I go to a public instance of an AI system and I say, here's my configuration on my Cisco switch.

0:34And what I'm going to do is just paste it all in, okay?

0:36And then I earnestly just ask it something like, do you see any configuration errors or problems, okay?

0:41So I'm getting it to study my configuration.

0:43All right, so it thinks for a bit and it says here nothing jumps out as a syntax error.

0:47It looks valid and should boot fine.

0:49And it gives some suggestions about potential things I could do.

0:51Now, this is not the issue.

0:53This is why someone would like to use an AI system to get this type of feedback.

0:57But what actually is the issue?

0:58Well, this is a public instance of ChatGPT and I've just dumped in all my network configurations.

1:04Now, like I said, this is a pretty bare configuration, so there's not much on it.

1:07But imagine it was a real live production environment.

1:11I may have just potentially told it some sense of information.

1:14Maybe we've got some SNMP community strings in here.

1:17Maybe if my security is really bad, I've got some unencrypted passwords that I've just sent to this AI system.

1:23Maybe I've divulged the internal IP addressing in the system,

1:27my VLAN configurations, my access control list, my security posture,

1:30my routing protocols, so on and so forth.

1:32Now, if this here was just a conversation between me and a private system, a private AI system,

1:38whereby the data here was just, well, just private to me and not being shared to anyone at all ever,

1:45well, that would be fine.

1:46But that's not how these tools work, unfortunately.

1:49Very often, by default, the conversations that I'm typing here is used to, well, improve the actual training data.

1:57Because when you think about it, especially on the free tier version of these particular utilities,

2:02these tools are so expensive to run.

2:05I mean, like, seriously, the amount of energy they use is astronomical.

2:09And if they're just giving it to you for free or for, like, $20 a month or something,

2:14you can be pretty sure that there is an upside for them.

2:17The information that you are giving these particular tools and these particular companies,

2:22they're using it to train their models.

2:25So what that might mean, therefore, is that the configurations that you have on your live network

2:30may actually be the input today, but maybe in the future it is the output for someone else's request.

2:37Now, what I will say is that many of these tools happen to have an enterprise-style offering,

2:42whereby you pay more money, you have a type of business account,

2:46and because of that, the information, the way it's processed, is a lot more restrictive

2:50and it's a lot more secure.

2:51But the point is, is that when you happen to be using these particular tools,

2:55you want to make sure, make sure absolutely,

2:58that the information that you're sending is not being sent somewhere else

3:01without you knowing about it and without you actually understanding that.

3:05Because, you know, maybe some things that you send are not sensitive at all, and that's fine.

3:09But if you are completely unwitting about this fact,

3:12you might be divulging really sensitive information.

3:15So really the main thing to highlight here, especially, especially in a commercial setting,

3:20whereby this is you working in the purview of your job as an employee,

3:24if you really want to be understanding your company policy,

3:27if they tell you, hey, by the way, never, ever, ever put our configurations into a public AI system

3:33like ChatGPT, then definitely don't do it.

3:36You're opening yourself up for a lot of problems and you can be compromising your security.

3:40This might be what some people comically refer to as a resume generating event.

3:45Which means you'd be looking for a new job.

3:47So just don't do it, okay?

3:49So be aware of your policy.

3:50The next thing you can also do if you're going to be interacting with these systems

3:54is to actually sanitize the output.

3:56So say, for example, as opposed to just blindly pasting all the configurations,

4:00look at the unique data like here, like the IP addressing.

4:02How about if it's not necessary for the actual problem

4:06to actually divulge the IP addressing, for example,

4:09why not just sanitize it before you just paste it in blindly?

4:12Why not just go and, you know, change this information

4:14or deliberately truncate it and leave it blank?

4:16The AI system, if it doesn't need to know about it,

4:19it's not going to somehow impair its ability to solve a completely unrelated problem.

4:23So sanitize it.

4:24So again, pasting this in.

4:25Okay, let's just maybe say version.

4:27Let's just leave that as version redacted.

4:30Down here, hostname.

4:32Change it to my hostname.

4:33Username, John.

4:34Privilege 15.

4:35Secret.

4:35And it's got the actual hash of the password here.

4:37Change that to redacted.

4:39Same again here, redacted.

4:40And you can just keep doing this on all the sensitive data.

4:43Now, again, this is maybe not the quickest way to interact with AI,

4:47but it certainly is, it's a more secure way

4:49as opposed to just giving away the keys to the kingdom

4:52with respect to your sensitive configurations.

4:54So really know what the company policy is.

4:56If you have the ability to use the more enterprise version of these tools,

5:00whereby we have stronger privacy guarantees,

5:02definitely do that.

5:03And where you can, be sensible about replacing the sensitive data

5:07that you happen to be inputting into these systems.

5:10All right, so that's just some basics on data privacy.

5:12Let's now talk about something known as IP ownership.

5:15So let me go and give you a really, really simple example, okay?

5:18Let's just say,

5:19write me a network automation utility that tests OSPF.

5:22Let me hit enter.

5:23Now, as it stands right now,

5:24this is going to go and spit out a fairly simple and generic script.

5:28Now, that is not really going to be such a concern for you, okay?

5:31The problem, though, is if you try to develop this

5:33into some type of proprietary software,

5:36whereby you claim ownership of it,

5:38and even worse, if you try to monetize it and sell it,

5:42if in the event that you've just had an AI system

5:44generate this particular tool or large blocks of this particular tool,

5:48it may actually be the case that you have no valid claim to it at all,

5:52because all you did was just ask an AI system

5:55to go and create or mostly create it.

5:58And that, my friends, is not the same thing

6:00as actually creating something on your own.

6:03Now, what I will say is straight off the bat,

6:05I'm not a lawyer,

6:06and this very topic, it's quite contentious at this time of recording,

6:10so there is no clear path as to how to solve this particular problem.

6:14So I'm not going to go and pretend I know the exact legal bar

6:17whereby something becomes your ownership

6:20versus something that you cannot actually copyright.

6:22What I'm trying to highlight more generally

6:24is just be aware of this particular stuff.

6:26So if, for example, you just blindly copy this AI code,

6:30don't be surprised that the new tool that you have supposedly

6:33quote-unquote created is not actually yours

6:36and can actually even be used by a competitor,

6:38and there is nothing you can do about it.

6:40You'd have no claim to say,

6:41this is mine, you can't use it.

6:43If you rely just on AI

6:45and you're not making sufficient modifications,

6:47whatever that legal bar happens to be,

6:50just be aware that this is a potential pitfall.

6:52Now, that said, if you happen to be the main designer of the architecture,

6:56the main person writing the code,

6:58AI is just maybe assisting you here and there,

7:00modifying things a little bit.

7:02Well, you can imagine you would have a much stronger claim

7:05to ownership of that material.

7:07And, by the way, here's another one.

7:08See the type of code that is generated here?

7:11The way that the tool is so good at writing this particular code

7:14is that, well, many of it has been trained on open source material.

7:18Now, much of that original code that it was trained off of

7:21could actually have been written under a particular public use license.

7:25So the actual code that you're using

7:26that has been derived from original code

7:29that had a public use license,

7:31it might still carry that same licensing.

7:33Again, this is still not quite clear

7:35as to how all of this is going to play out.

7:37So, really, what I'm saying here is my advice to you

7:39is to be very, very careful

7:42when using these particular tools

7:44to generate and create what you think is custom and original solutions.

7:48So, friends, as we know, AI, absolutely awesome.

7:51Two thumbs up. We like it a lot.

7:53But as we can see,

7:54there are some potential pitfalls that we have to understand.

7:58One of the big ones, data privacy.

7:59Again, this is a very, very easy one to fall foul of.

8:02People make this mistake all the time.

8:04Do not let it catch you out.

8:05And, again, especially in the enterprise environment

8:08whereby you might be creating your own tools,

8:11including, by the way, what might end up being commercial products,

8:14remember to keep in mind the potential issues of IP ownership.

8:18In fact, you know what I should do?

8:20I should probably clarify what IP actually means.

8:22I'm just talking about intellectual property.

8:25This thing that we created, this thing actually belongs to us.

8:28And if anyone tried to use it without our authority,

8:32well, ultimately, we have some legal standing

8:35to challenge that and prevent those actions.

8:38So, friends, those are just some of the potential issues of using AI.

8:41How about we talk about some more in the very next video?

Hallucinations and Output Validation

0:00Hey friends we're back we are back with a vengeance and in this particular video

0:04what we're gonna do is talk about one of my favorite not definitely not one of my

0:09favorite maybe one of my what you say pet peeves one of the things that

0:13annoys me the most about AI and this is the subject of hallucinations. Now if you

0:17happen to have experience with AI no doubt this has probably driven you

0:21pretty crazy at least well now that I'm used to it it's not so bad I've kind of

0:26half expect it but when I first got into the whole AI thing to be quite honest

0:31with you it was a little bit too trusting and that ultimately leads to a

0:34lot of frustration and confusion so we don't want that so what we're gonna do

0:38in this particular video is to talk about what hallucination is and of the

0:43importance of validating what the AI system actually generates for us because

0:49here is the thing if you happen to have used AI quite a bit no doubt you have

0:53experienced that AI can be super super confident you know for example you ask

0:58it to do something for you and maybe it gets something that you can clearly tell

1:03is wrong then you point that out and it says you know what you're totally right

1:07I'm sorry this is what I did wrong here is a solution that will definitely work

1:11this time and the first time you hear this it's quite reassuring you think wow

1:15this is really really good it must have solved a problem this time and must have

1:19thought very deeply about it this thing here this new corrected version is

1:24definitely going to work and then it doesn't work and you're left annoyed

1:28this is just the nature of many of these AI systems they are designed to sound

1:33confident but ultimately what they're doing is probabilistic reasoning and

1:37that is quite hard to say sometimes probabilistic so what that means

1:42therefore is that they are trying to get the what would you say the thing that's

1:47most probable from a statistical point of view so by its very nature it should

1:52be a little bit uncertain about the nature of the response that it gives but

1:57that ain't the case very often they'll just tell you this answer is absolutely

2:01certain and you should just trust it apparently but definitely don't do that

2:05because here is the thing in the world of networking and particularly network

2:10automation whereby you can use these particular generations to automate out

2:15across a large amount of devices making many configuration changes you can

2:21ultimately black hole your network if you're not actually certain about what

2:25the outcome is going to be from this code that was generated so that could be

2:29things like misconfiguring access control lists it could be misconfiguring

2:32routing protocols there's tons and tons of ways in which these systems can get

2:37things wrong let me give you an example okay one thing you might notice with

2:40respect to AI systems is that it might just get the syntax wrong maybe the

2:44training data was based off of older versions of the tool that you're trying

2:49to be using so maybe the training data uses an older version of Cisco iOS XE

2:53and the newer version has a slightly different command or a slightly

2:58different implementation if the training data is all on the old version then the

3:03AI system is going to statistically generate an outcome based on that

3:07version and then present it to you as this type of perfect solution almost you

3:12would be wise to always have a good healthy dose of skepticism when

3:17interacting with artificial intelligence next thing and this is the topic that we

3:21kind of kicked off this video about and this is the concept of hallucinations

3:25now if you're not certain what a hallucination actually is what we're

3:29talking about here is when the AI system happens to just make something up and

3:33pull it out of thin air something that doesn't actually exist so how could this

3:37present itself in the world of network automation well what it might do is it

3:41might invent a non-existent function inside of a Python library the way you

3:46actually talk to the AI system can kind of have an effect on this well I mean

3:51when I say that well if you happen to talk to the AI system in this way that

3:55almost expects a particular response it's almost like it freaks out it can't

4:00actually find an authoritative source on what you're expecting it to do but it

4:04can tell by your tone that you are absolutely expecting this particular

4:08thing to be there so it's just going to go and invent it out of thin air let me

4:12give you an example okay all right check it out what I've written here is a lot

4:14of rubbish see this particular module doesn't actually exist totally made it

4:19up but I sound pretty confident okay because I've specified a very particular

4:24version I've asked something that sounds really quite technical I mean LFIB

4:28does relate to MPLS and resconf is something you would use with an actual

4:32yang model so it kind of sounds like it should actually have an answer but it's

4:37just gibberish let's see though what the AI system happens to say because it

4:42sounds like I'm expecting a particular response let's hit enter so it's

4:45searching the web give it a moment and look at this right here now it says this

4:51is one of those areas where the iOS XE yang gets very under documented well I'm

4:57pretty sure why it's under documented this doesn't exist this model so it

5:01shouldn't actually be documented at all key point first so you don't chase

5:05ghosts okay so it's trying to help me out here it says here and this

5:09particular XE version this model does not expose LFIB adjacency statistics

5:14directly as a flat stats container instead it follows the MPLS model

5:20hierarchy now it doesn't do this because this here doesn't even exist so then we

5:24scroll on down we get a nice big green tick about the actual path to be using

5:28with this non-existent model and it just goes on and on and on and on so again

5:32this is obviously really annoying but notice the trend I sounded really

5:37confident the training data was obviously quite limited because this is

5:41quite a technical subject but if we don't have some type of expertise here

5:45to actually recognize that this here is all completely wrong you may be

5:49possibly putting this stuff into your network automation solutions and this is

5:52definitely not a good thing at all now let's be a little bit mischievous but

5:56we're doing it for educational purposes I'm gonna flat out confess that this

6:00model doesn't exist and I'll ask it why it told me these paths and then it's

6:03gonna say you're right to call that out that was incorrect there is no model of

6:07that type so now it's giving me a little bit better data but if I happen to change

6:10this and say the model should be called and all I'll do is paste in the model once

6:15again and let's add on like LFIB at the end something that sounds quite

6:18technical and roughly plausible okay so let's hit enter see what it does and

6:22look at this you're absolutely right the correct model is this I just made this

6:27up right there and now it's saying that's the one that actually backs the

6:31show MPLS forwarding table does it really not at all and then off it goes

6:35generating all this nonsense and what I'm trying to really stress to you is

6:39that you can't just be relying on this stuff this is why expertise is still

6:43very very important because if you don't actually truly understand this stuff and

6:48you just try to spam these solutions you might be really confused as to why your

6:53device is just giving you client errors all the time now one thing we can do to

6:57actually improve this we can use something called retrieval augmented

7:01generation and what this can do it can kind of constrain what your queries are

7:06actually going to be in essence what we're talking about here is grounding

7:10the actual answers with particular context so once again let me give you a

7:14quick example what I'm going to do here is open up a new chat and what I'm going

7:17to do is to ask it something quite vague so I'm saying which HTTP method and URL

7:22should I use to associate a site with a network profile now here is the thing

7:26see the terminology I'm using here this is quite specific to Cisco catalyst

7:31center so I should expect the AI system to perhaps generate some information

7:36about this but it might not get it correct so let's go and enter here and

7:39see what it says so it has recognized that this is catalyst center terminology

7:43and what it's done here is that it's giving me the actual URL or at least it

7:47purports to tell me that this is the correct URL now what I'm going to do

7:51here is I'm going to go and check that and verify this to make sure that this

7:54actually is correct so all I've done is search for the actual documentation

7:58right here go and click this and I'll get down to the API reference and let's

8:03click on API right here okay now the section I'm looking for is in site

8:07design so let's click this right here and if I scroll on down I can see this

8:11option for associates and as we can see right here this is going to allow me to

8:15associate a site to a network profile now look at the exact wording I had

8:20right here okay this is basically why I asked the system right here associate a

8:24site with a network profile but look at the endpoint they're saying it's going

8:28to be site site ID network profile then network profile ID where in reality it's

8:34actually going to be network profile network profile ID site site ID that is

8:39the endpoint we need to use so once again it was quite plausible what the

8:42answer was but it got it completely wrong what I want to do though is I want

8:46to give it particular context by just having it reference this documentation

8:51so check this out what I'm gonna do here is go back and when I get to this I'm

8:56going to choose to download the open API document okay so it's just gonna go and

8:59download like so now I'm gonna do here is choose to save a copy and I'll save

9:03this so what I'm gonna do here is choose to create a new project and let's just

9:07call us like catalyst helper and create the projects now what I can do here is

9:11specify particular sources that I want to include and to give this chat a lot

9:15more context so let's go and add the documentation alright so now the

9:19documentation has been uploaded as a source and all I'm gonna do is to paste

9:23in the exact same question and see if we get any better responses so let's hit

9:27enter and now you can see it's beginning to search the project context and look

9:31at this right here this looks a lot better see this right here it's now

9:34specifying we're gonna have to use the post request and the endpoints this

9:38actually looks like the correct endpoint this time and in fact if I go to the

9:41documentation and compare this it should be DNA intent API v1 network

9:47profile then you put in the profile ID then forward slash site and then the

9:52site ID and it also tells us any required parameters so again if we

9:56consult the documentation if we look right here it shows us the required

10:00parameters as the network profile ID as well as a site ID and those are the two

10:04that are required so friends be aware that whilst AI is awesome it can do this

10:09really annoying thing known as hallucination and we can ultimately

10:13mitigate hallucinations by giving our AI systems a lot more constraints and

10:17context as to what we're trying to do

Considerations for Using AI Responsibly

0:00Alright, so we know about many of the benefits of AI as well as some of the potential pitfalls and

0:06in this particular video what I just want to do is to spend a little bit more time on

0:10kind of talking about how we can use AI in a responsible and secure manner.

0:15So the first thing I just want to highlight is just some kind of questions you should have when

0:21interacting with AI especially in the setting of network automation.

0:25So the first thing which is probably at the top of the list and that is always to verify

0:30what it is you're getting back from the system and we kind of hinted at this in a previous video

0:34but what does it really mean? We're not just talking about just being skeptical and you know

0:40executing the code with a little bit of trepidation.

0:42We're talking about actual steps that we can do to help mitigate the risk of

0:46something going wrong if we choose to execute the code that was written via the AI system.

0:51So say for example, the AI system is writing some code to

0:55templatize and generate some CLI configurations. What would you want to do?

1:00Well, first thing you would want to ensure that the CLI commands are indeed the correct ones and in a similar sense if

1:07let's maybe say it was generating some type of YANG payloads and it's going to be deploying it via NetConf or RESTConf.

1:15Once again, you want to be verifying this.

1:17So in the case of the CLI you could go to the actual CLI

1:21documentation of that particular model of the device you're using and before you attempt to deploy this on a real-life network

1:27go and check that what has been rendered is actually matching up with what you would expect.

1:31Same thing is true for the YANG based automation. Ensure that the actual modules are indeed correct.

1:36Use the tools that we've talked about already throughout this course. Things like PyYang or say for example

1:42YANG Explorer, that type of thing.

1:44These are the types of tools that you can use to help ensure that what has been suggested is actually real and it's not just

1:51some type of hallucination. Now again, maybe for you this seems really really obvious and you know

1:56it's just something you clearly would do anyway, but to be honest with you many people are not doing this at all.

2:01They're just kind of blindly trusting the god of AI and

2:04assuming that it must know better than them and just going in kind of gung-ho and

2:08well, I would say taking a reckless approach to network automation via using AI.

2:13So ultimately whether it's rendering CLI commands, whether it's you know

2:17using YANG based automation or whether you happen to be interacting with a particular controller

2:22the main thing to do is to trust the authoritative resource. Go to the actual documentation and make sure

2:28what you're seeing in the AI system is actually matching up with reality. All right, next point.

2:33So let's say you have done your verification and you are highly confident.

2:36Still not a good idea just to go and deploy this directly onto the production network.

2:40Instead what you would want to do is to test this in a nice isolated environment.

2:45So that could be things like using EVE-NG for network simulation or as we talked about earlier on throughout this course

2:51you could use Cisco's modeling labs to model your topology and

2:55just go and inspect what the AI system has actually done when you deploy this code or when you run this playbook that type of

3:02thing. And another tool you could use is one we have seen already throughout this course once again is to also use the

3:08Cisco DevNet Sandboxes very very useful. Once again

3:12they give you a nice isolated and secure environment

3:15whereby you can kind of go crazy. And the worst case is as if you happen to break something

3:19you never really broke anything in reality. It was just a simulation. Now another component

3:24which is very very valuable and this is the kind of thing that's going to keep you in a job is to use your own

3:29expertise. Really spend time learning these technologies, become comfortable in them, become an expert in them because even though AI can't allow you to work

3:37quicker more efficiently

3:39ultimately you should see it as a tool to augment your own work. And if say for example

3:43the AI is going off the rails because you have expertise

3:47you are more able to easily detect that. Because here's the thing when it comes to making changes and networking

3:54particularly you may push out a change and it might seem like it has worked

3:57but you also maybe have to think about the downstream effects of the change that you just implemented.

4:03Maybe it transpires that the BGP configuration that the AI system actually told you it's using the correct format

4:10it's using all valid values, the configuration does apply and it can actually work.

4:14But maybe the AI systems are not really thinking about how that might affect your MPLS network.

4:19This is once again whereby you can shine when you understand the holistic picture and you have expertise and confidence in the technology.

4:26Then maybe when the AI system gets a little bit gung-ho and recommends changes to a particular technology

4:31you have a good enough

4:33understanding to know all the potential side effects that that may cause and you can go and check them and verify them in your

4:39isolated environment before deploying it to production.

4:42Now again, just another point to talk about with respect to actual security when using AI.

4:47Now previously we talked about these public AI utilities such as

4:51ChatGPT or Clod that type of thing and we highlighted some of the potential pitfalls that you can fall into when using these particular tools.

4:59For example, you happen to paste in your API token directly into an AI system.

5:04Maybe you divulge your inner security posture of your network configurations.

5:08As we know the real vulnerability of this as the data that you're sharing

5:12well, it can be shared and it can be used elsewhere.

5:15So one thing I just want to highlight to you is that whilst we can get these enterprise grade

5:20implementations of these tools, one thing you can also do is run your own local and private AI system.

5:26So the benefit here is that while it's offline

5:29it's just between you and the AI tool. Now the downside to this is in order to be able to run these

5:35well, these more modern models, quite honestly, you need an absolutely massive amount of compute and power.

5:41So to be honest with you, to use the latest greatest best models in the world

5:45you're kind of gonna have to go the public route whereby you have access to Clod whereby you have access to ChatGPT and their

5:51latest models and their infrastructure to run those models. That said though not every solution requires the most advanced AI.

5:59So what I want to do is I want to just briefly show you how we can install your own

6:02local AI system and we can see how that can benefit us in the world of automation.

6:07So check it out. What I'm gonna do here is to go on to my Ubuntu machine.

6:10Now what I'm gonna do here is to install a particular utility known as Olama.

6:14So let's go and open up the browser.

6:16Now all I've done here is search for download Olama and let's just click this right here.

6:20And what you're gonna see here is we have all the options to download this if it's on Windows, if you're on Linux or if

6:26you're on Mac OS. Now in my case here, I have a Linux machine.

6:29So let's just click this and we can see here the command is this one.

6:32So if I just go and paste this in and to enter, what it's gonna do is to go and begin

6:37downloading Olama onto my machine. Now in the meantime, if we just go back to the browser here,

6:41what you're gonna see here is we have all of these particular models that can be run on Olama.

6:46So if I click this right here, you can see here

6:49these are all the things that you can ultimately use. You can see here

6:52we have tons and tons and tons of models. Now one that happens to be particularly powerful for coding is this one right here,

6:59the Quen 3 coder. But one thing to note here in order to run this at its most powerful,

7:04this has 480 billion parameters, which requires an enormous amount of power.

7:10So what I'm saying here is that when you happen to choose these models,

7:13you really have to consider your environment and what you can actually power. Now a good generic use model

7:19that is not so intensive that can be run on a regular laptop is this one right here, Mistral.

7:24So what we're gonna do is once Olama is ready,

7:26we're gonna go and pull this particular model and use it. And even though it's not the most powerful,

7:32it should be enough to kind of get us going in our network automation scripts. Now straight away here,

7:37we get this warning and this is because I have downloaded this in a virtual machine on my system.

7:42So we're not getting access to the GPU,

7:45we're only going to be running it via the CPU, which is going to make things run really quite slowly.

7:50So with that said, all I want to do now is to show you how we can pull in the actual Mistral model and use

7:56it. And then what I'm going to do is to slide on over to my MacBook, my native computer, and then do the AI

8:01there, whereby I have access to my GPU.

8:03So the way I can get the model is really quite similar to Docker.

8:06All I'm gonna do is say Olama pull and then Mistral and say I want to get the latest version.

8:11So if I hit enter, what's gonna happen is we're gonna begin pulling this down.

8:14And if I want to run this, I can just say Olama run Mistral, okay?

8:18So if I hit enter here and

8:20what it's given me is an error straight away saying that we need more memory than is available inside this particular virtual machine.

8:27So pause, let's hold that thought. Let's now take the same installation over onto my MacBook, okay?

8:32All righty-o, so now I'm over on my MacBook and if I just say Olama list, we're gonna see here

8:37I have already installed Mistral as well as another model as well.

8:41So if I want to be interacting with the Mistral model, I can just say Olama run Mistral and to enter.

8:47And now we drop into this command-line interface and like I say, this is completely offline.

8:51So let's just ask you something quite simple.

8:53What is the capital of England? And it tells you straight away that the capital of England is London.

8:57So it seems to be working. Now here is the thing.

8:59What I can also do is use the graphical user interface.

9:02If I just go and open this up to click on this logo, as we can see right here,

9:06I have this little chat interface and down here what I can do is select the model that I want to use.

9:11So let's choose Mistral.

9:12I'll just say, can you write me an Amico script that will connect to Cisco iOS device?

9:17The IP address is 192.168.1.201.

9:21Username is John and the password is Cisco123.

9:26Just say send the show version commands and print the result.

9:30So let's hit enter, give it a moment and now it's beginning to write this out.

9:34Okay, so it's given me a response,

9:35but what I've noticed is that it's actually using the getpass module to prompt the password.

9:40So I'll just correct it and say, obviously this is good,

9:42but hard code the password of Cisco123 instead of using the getpass module.

9:47So let's hit enter, see what it does.

9:49So now it's beginning to correct things and now we have our code.

9:52Let's go and just copy this right here.

9:54And what I'll do here is create a little script called olamascript.py

9:57and I'll just paste this in like so.

9:59Okay, so let's just save this.

10:00And if I just run the script and to enter, let's see what we get back.

10:04And bam, we get our response back.

10:06And you know what, just to highlight this, if say for example, I disconnect my internet.

10:11Okay, so if I try to ping the internet, we're going to see here I don't actually have any access,

10:15but the cool thing is, is I can still use Olama.

10:17So check this out.

10:18Let's imagine this is now the zombie apocalypse

10:21and, you know, I don't have access to the internet.

10:24I don't know what I can do.

10:25But the good thing is, is I still have access to the intelligence of AI.

10:29So whilst I'm disconnected, I could say something,

10:31let's say write an Ansible playbook to do the same kind of thing.

10:34And if I hit enter, what is going to happen is even though I'm disconnected from the internet,

10:39I'm still now getting back my responses from Olama.

10:42So see this right here, all this is coming out.

10:44And as we can see here, it's given me all the instructions to do things like make sure Ansible is installed on the system,

10:50make sure I've got a host file, that type of thing.

Validation

0:00Alright friends so let's now validate what we've learned within this skill. So the first thing

0:03we're going to do here is to launch the lab below. So let's go and click this and then once it loads

0:08we're going to go and open up the Linux Mint virtual machine, run the command olamalist to see

0:13all the available models installed on the system. Then we're going to run the Mistro model and use

0:18it to generate a Netmego script that's going to connect to the Cisco iOS device in the lab with

0:23the IP address of 10.0.0.1. The username is going to be John and the password is cisco123 and the

0:28script should run the command show ip interface brief and print the results. Now once you get

0:33your result the last thing I want you to do is to test that script against the lab device. So

0:38friends go build up your lab give it a go and I will see you in the very next video where we discuss

0:42the solution.

Validation

0:00All right friends, the first thing we're going to do is to run the olama list command.

0:03So let's hit enter and as we can see here we have the Mistral model available on the system.

0:08So what I'm now going to do is I'm going to go and use Mistral to generate this netmicro script

0:13to talk to the device of 10.0.0.1. So all I'll do here is say olama run mistral and hit enter.

0:20Now what I will say is because this is in a virtual machine things are going to be really

0:24quite slow compared to how it would work if you had a GPU available. But nevertheless we're just

0:28going to have to be patient and allow it to run. All right also let's write this I'll say

0:33write me a netmicro script that will connect to a cisco ios device just say ip is 10.0.0.1 username

0:41is john and password is cisco123. I'll just say just hard code the credentials into the script

0:49and I'll say run the show ip interface brief command and print the results. So let's hit

0:55enter and see what we get back. All right so it's beginning to respond and as you can see straight

0:59away it's a little bit slower in typing out the response but again like I say it's a virtual

1:04machine so we're just going to be patient. Now straight away I can see here it's wanting to use

1:08the getpass module once again as you can see here these particular models are not quite as smart as

1:13the higher end ones but you know it's still going to do the job. In fact what it's doing is actually

1:18hard coding the credentials as I said but for some reason it's importing getpass even though it's not

1:23going to use it so that's a little bit bizarre but nevertheless. So let's try to correct it and I'll

1:26say simplify the script remove getpass since it's not being used and I'll say don't set the terminal

1:32length to zero and remove the fine prompt. So let's hit enter and see what we get back this time.

1:39Now one thing I will say with respect to the Mistral model it's just a general use model and

1:43it's really quite simple. It's not designed for coding, it's not designed for network automation

1:48so you can expect some mistakes. Now if you happen to have a more powerful machine at home then by

1:53all means go and run a more powerful model that is optimized for coding. Alright so it's now

1:58beginning to respond back with the actual results. Alright so it now has completed let me just

2:03fullscreen this for a moment and all I'm going to do is to go and copy all of this like so okay so

2:08let's just go and grab you and I'll just go and copy this and let's exit olama by saying forward

2:14slash by and let's just create this little script and let's just call it again like olamascript.py

2:19and I'll just paste all this in like so and let's just save it and then finally we'll go

2:24and run this script like so and as we can see the script does appear to work. So friends that is us

2:29for our validation challenge on artificial intelligence. I hope this has been informative

2:33for you. I'd like to thank you for viewing.

Team training path

Turn this skill into assignable team training

This free skill is a preview of the courses your team can assign, track, and report on with CBT Nuggets.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Book a Demo
Just need CCNP AUTOCOR?

Learning on your own? Browse individual plans ($49/month, billed annually)

Not ready to buy?
with no purchase required. Already have an account?
Book a Demo