Penetration testing, often called pen testing, is the practice of hiring someone to break into your own systems on purpose. The tester tries the same tricks a real attacker would, then reports what worked so you can fix it. The key word is authorized: a pen test has permission, a defined scope and an agreed end date. The same actions without permission are a crime.
What a pen tester does
A typical test follows a few stages. The tester first gathers information about the target, such as which servers, web apps and software versions are exposed. Next they look for weaknesses, like an unpatched program, a weak password or a login form that trusts user input too much. Then they try to exploit a weakness to see how far it goes, for example reaching a database. Finally they write a report ranking the problems and explaining how to fix them.
This is different from a vulnerability scan, which is an automated check that lists possible problems without trying to use them. A pen test shows which problems actually matter.
Where AI comes in
Much of a pen test is repetitive: probing many endpoints, reading output, picking the next step. That is the kind of work an AI agent can do. Security teams use agents to scale testing across more systems for less money, and to run tests more often than a yearly engagement.
The same ability helps attackers. A tool built for authorized testing can be pointed at targets without permission, and an agent that works through steps on its own lowers the skill and cost needed to try. This is a dual-use problem, and it is one reason labs run red teaming on their own models and add guardrails against misuse.
AI systems get tested too
Pen testing also applies to AI products themselves. Testers try prompt injection to make an assistant follow hidden instructions, check what tools and data an agent can reach, and see whether an agent sandbox really contains it.
Why it matters to you
If you run a website, an app or an agent, assume automated probing is already happening. Keep software patched, keep secrets such as an API key out of anything the public can load, and limit what each agent can access. If you hire a tester, get the scope and permission in writing first.