08

DevOps Engineer · Step 8 of 8 · 10 min

AI in DevOps, and a portfolio project

Use AI for scripts and configs without leaking secrets or running made-up commands, then ship a project you can show.

Where AI helps

AI assistants are good at drafting shell scripts, Dockerfiles, CI workflows and IaC, explaining error messages and summarising long logs. Coding agents can now run commands and open pull requests. That is useful and it raises the stakes.

The real risks

Secrets: never paste keys, tokens, kubeconfig files or .env contents into a chatbot. Redact logs before sharing. Made-up details: models invent command flags, config options and even package names. Attackers register packages with names that models often hallucinate, so check every dependency exists and is the one you meant.

Destructive commands: rm -rf, terraform destroy, kubectl delete and DROP TABLE do exactly what they say. Read every command before running it. Do not give an AI agent production credentials; let it work in a sandbox and open a pull request that a human reviews.

A project that shows the whole loop

Build one small app, even a hello-world API. Put it in Git with branch protection. Add a CI pipeline that tests it and builds a container image. Describe its infrastructure with OpenTofu or Terraform. Add a health check and a basic dashboard. Write a README and one practice post-incident review.

You can do all of this locally or with free tiers. If you deploy to a cloud, set a budget alert before you create anything and destroy resources when you are done.

Show your thinking

In the README, explain why you chose each tool, what you would change for a larger team, and one thing that broke. Note where you used AI and how you checked its output. Employers want judgment, not a list of logos.

Try it

Check an AI-written script before running it

  1. 1.Ask a chatbot for a shell script that backs up a folder to a dated archive.
  2. 2.Before running it, ask the second prompt below in a new chat.
  3. 3.Look up any flag you do not know in the man page, with man followed by the command name.
  4. 4.Run it only in a test folder, and plan your portfolio project in your repository README.
Review this script for safety. List every command that deletes, overwrites or changes permissions, any flag that might not exist on Linux or macOS, and anything that would behave badly if a variable were empty. [paste script]
An AI assistant suggests installing a package you have never heard of. What should you do?

Check yourself

An AI assistant suggests installing a package you have never heard of. What should you do?

Read alongside