An AI agent is just a while loop. I built one in 70 lines of Python, then tricked it into leaking my .env A developer from Tigera built a minimal AI agent in under 70 lines of Python using Ollama and the OpenAI API, demonstrating that an agent is essentially a language model, a set of functions, and a while loop. The developer then showed how such an agent can be tricked into leaking an API key, and discussed fixes that don't involve the model itself. Every framework, every job posting, and about half of LinkedIn wants to tell you what an "AI agent" is. Most of the definitions are marketing. Here is the one that fits on an index card: an agent is a language model, a short list of functions it is allowed to ask for, and a while loop. I'm going to prove that by building one in under 70 lines of Python with no framework. Then I'm going to hide one paragraph in a web page and watch the agent hand over my API key. Then we fix it, and the fixes are the interesting part, because none of them involve the model. You need one semester of Python. If you know what a function, a dict, and a while loop are, you're fine. You don't need Docker, a cloud account, or a credit card. Disclosure: I work at Tigera, on the Kubernetes end of this exact problem. Nothing in this post needs anything we make. Python 3.10 or newer, and Ollama https://ollama.com , which runs open models on your own machine. Install Ollama, then pull a model that knows how to call tools: ollama pull qwen2.5:7b That is a 4.7 GB download. If your laptop has 8 GB of RAM or less, llama3.2:3b is about 2 GB and also works. Any model is fine as long as ollama show