AI agents for hacking
An agent is a model in a loop with tools: it reads output, decides the next call, runs it, and repeats toward a goal. Point that at a web application and you get something genuinely useful for coverage and genuinely dangerous for conclusions. Both halves matter, and only one of them gets written about.
This page is about how agents are actually used in offensive work here — the parts that hold up, and the failure modes that produce findings that do not exist.
Where agents earn their place
Surface mapping. Enumerating hosts, parameters, endpoints and roles at a scale no person would maintain by hand, including the tedious half: mining JavaScript bundles for API routes, diffing builds, and tracking what changed between releases.
Hypothesis generation. Given a large API surface and a permission model, a model is good at proposing which endpoint is likely to have which check missing. Most hypotheses are wrong; that is fine, because the cost of being wrong is one request.
Writing the harness. Turning a manual Burp sequence into a replayable script with the right authentication context, idempotent setup and clean teardown. This is where an agent saves the most real time and introduces the most risk, for reasons below.
Drafting from verified evidence. Report prose, impact statements and remediation notes written from captured transcripts. The agent summarises; it does not decide what is true.
Where agents fail
Confabulated evidence. A model will describe a response it never received. Ask an agent "did the cross-tenant read succeed?" and you may get a confident paragraph about a 200 that does not appear in any capture. Any claim sourced from the model rather than from a log is fiction.
Silent fallback credentials. The most expensive failure in practice. A test is meant to prove that an endpoint works without authentication; the harness, missing its key, quietly falls back to a configured default and sends a valid one. The endpoint answers 200, the agent reports unauthenticated access, and the finding is an artefact of the harness. Every harness needs an explicit assertion that the credential it used is the one the test intended, and a control run that must fail.
Success by status code. An agent that treats 200 as proof will report a soft 404, an HTML error page, or a silently ignored write as a vulnerability. Proof is the end state read back from the owner's session, not the status of the action.
Non-determinism. Same prompt, different result. Two runs of the same agent are two different tests, so results have to be pinned to a model version and a transcript, or they cannot be reproduced or regressed.
Guardrails that matter
- Scope enforced in code, not in the prompt. Egress allowlists at the proxy, not an instruction asking the model to stay in scope.
- Verification is deterministic. The agent proposes; a fixed script proves. Anything reported has a captured request and response attached.
- Every tool call is logged. Full transcripts with parameters, so a false positive can be traced to the exact step that produced it.
- Separate the generator from the checker. A second pass, ideally a different model, tries to break each claim before it reaches a human.
- Human review before anything leaves the machine. An agent's output is a draft for a tester, never a deliverable for a client.
The honest scorecard
Agents roughly double the surface a single tester can cover in a week, and they make harness writing fast enough that tests which used to be skipped now get run. They do not replace the judgement that decides whether a result is real, and the failure modes above are not edge cases — they are the default behaviour unless something in the system prevents them.
The practical rule: autonomy for exploration, determinism for proof.
Common questions
Can AI agents hack a target autonomously?
Not end to end. Current agents are effective at breadth: enumerating a large surface, mining bundles for endpoints, generating hypotheses about which parameter matters, writing the harness. They are weak at the part that matters most — deciding whether a result is real. Autonomy is fine for exploration and dangerous for conclusions.
What is an autonomous pentesting agent?
An LLM driving a loop of tool calls against a target: it reads output, decides the next action, executes it and repeats toward a goal such as mapping an API or testing an endpoint for authorisation flaws. The model plans; the tools are the only thing actually touching the target.
Do you use AI agents in client work?
Yes, for enumeration, hypothesis generation and writing reproducible scripts. Verification stays deterministic: a finding goes into a report only if a script captured the request and response that prove it. Nothing is reported on an agent's description of what it thinks happened.
Where do agents belong in an AI security assessment?
On the testing side, they speed up coverage of the conventional surface. On the target side, an agent is itself the thing being tested — its tools, its permissions and its tenancy are the attack surface described in AI and LLM security testing.
Related: AI and LLM security testing · API security testing · how an assessment runs