AI Can Generate Exploits. Who’s Doing the Thinking?

AI Can Generate Exploits. Who’s Doing the Thinking?

An LLM can write a path traversal payload in seconds. Whether that payload has any chance of working depends on details the model may never see: how the application normalizes paths, where decoding occurs, and which filesystem boundaries are enforced. The tester still has to establish those conditions.

This distinction matters as AI-assisted penetration testing becomes part of security assessments. Generating more tests is straightforward; determining which assumptions can be broken in a particular environment takes considerably more work. A team that delegates the latter to an LLM risks producing plausible findings without understanding the attack surface well enough to validate them.

For clients, the concern is practical. An assessment needs to establish what is exploitable, under which conditions, and with what impact. AI can support that investigation, but it should not define its conclusions.

In this article, we examine where AI adds value to penetration testing, how overreliance on generated output can compromise assessment quality, and why independent reasoning remains essential for identifying complex vulnerabilities. We also outline a practical framework for integrating AI into security testing and explain what organizations should expect from a provider using these technologies based on the Iterasec team’s experience. 

AI in Penetration Testing: Powerful Assistant or Unreliable Decision-Maker?

AI is already useful across reconnaissance, test development, and technical analysis. Its place in an engagement should be determined by the task and the consequences of an incorrect result, not by whether the task can be prompted.

What AI Can Automate in Security Testing

LLMs can help normalize OSINT data, write parsers for configuration exports, generate testing scaffolds, examine unfamiliar code paths, and compare observed behavior with protocol documentation. During a complex application assessment, this can eliminate hours of low-value formatting or scripting work.

At Iterasec, our priority is what that saved time makes possible: closer examination of authorization flows, application state, cloud privileges, and the connections between individual findings. We treat generated test ideas as leads to investigate, not as evidence that a vulnerability exists.

Why More Automated Tests Do Not Necessarily Mean Better Security Coverage

A tool can issue thousands of API requests and never test whether one tenant can access another tenant’s resources. Doing so requires knowing the expected ownership relationship and exercising it across different identities and roles.

Similarly, checking an endpoint for known injection signatures says little about a flaw caused by two services interpreting authorization state differently. Coverage must reflect the security properties under examination, not only the number of payloads executed. This is also where AI-assisted work differs from the broader manual-versus-automated pentesting discussion: an LLM can influence the tester’s hypotheses, not just run checks.

The Hidden Risks of Overreliance on AI in Penetration Testing

The immediate danger is not an obviously broken script. It is a coherent explanation that survives because nobody checks its premises. In a penetration test, that failure can change both where the team spends its time and what it ultimately reports.

Automation Bias and False Confidence

Suppose an assistant reviews an API and concludes that access control is sound because all endpoints require bearer tokens. The observation may be correct, while the conclusion is not. Authentication provides an identity; it does not prove that the identity is entitled to a requested object or action.

If the tester accepts the summary, object-level authorization may go untested. The reverse is also possible: a model identifies a dangerous-looking function without establishing that untrusted input can reach it. A reliable assessment requires tracing the relevant data and control flow in both cases.

Cognitive Offloading and Loss of Independent Analysis

Delegating repetitive coding is useful. Delegating the formation of every attack hypothesis is a different matter. Without an independent model of the target, a tester has little basis for challenging a model’s proposed path or recognizing a missing one.

A 2025 Microsoft Research study found an association between greater confidence in generative AI and lower self-reported critical-thinking effort among knowledge workers. That does not establish deskilling in penetration testing. It does identify a workflow risk: confidence in the tool can displace scrutiny of its output.

Generic Outputs and Missing Architectural Context

In a distributed application, an authorization decision may be made at the gateway, cached by a service, and interpreted differently downstream. A model given only the endpoint specification will not necessarily expose the inconsistency. Testing must establish where trust is created, transferred, and enforced before suggested attacks can be assessed meaningfully.

The Hacker Mindset: What Human Pentesters Bring to AI-Assisted Security Testing

The hacker mindset is not about refusing automation. It is the discipline of questioning expected behavior, following anomalies, and revising a hypothesis when the target does not behave as predicted. Those decisions are what turn isolated checks into an investigation.

Thinking Beyond Known Vulnerability Patterns

The presentation describes four modes of AI use: the Passive Passenger, the Script Kiddie 2.0, the Augmented Copilot User, and the Cognitive Orchestrator. The distinction is useful, even if these are conceptual archetypes rather than measured professional categories.

The Script Kiddie 2.0 can generate a sophisticated exploit without understanding the protocol or parser it targets. The Cognitive Orchestrator does the opposite: starts with an architectural hypothesis, uses AI to test alternative explanations, and independently verifies the result. The tool may be the same. The investigative quality is not.

Understanding Business Logic and Context

Consider a payment workflow that checks approval when a transfer is created but does not repeat that check after the beneficiary changes. Individual endpoints may validate inputs and authenticate the caller correctly. The weakness appears in the sequence of operations and the lifecycle of the authorization decision.

We look for these relationships when assessing web applications and APIs: resource ownership, role transitions, state changes, and enforcement consistency between services. A generic payload library is unlikely to establish whether the workflow violates its own security rules.

Chaining Individual Weaknesses Into Realistic Attacks

A leaked identifier may be low impact until combined with an authorization failure. An overprivileged workload identity may be unreachable from outside a cluster until another weakness provides a foothold. An experienced tester must validate each prerequisite and determine whether the chain is feasible within the agreed scope.

That is the difference between listing findings and explaining an attack path. The latter gives the client a basis for prioritizing remediation.

The Hacker Mindset vs. AI: What Happens When We Outsource Thinking?

A significant part of offensive security expertise develops through investigating failed hypotheses. Understanding why an exploit doesn’t work, identifying an overlooked condition, or discovering that a system behaves differently than expected often leads to more valuable findings than executing a known attack successfully.

Generative AI changes this process. Instead of working through an unfamiliar mechanism, a researcher can request a ready-made explanation or exploitation approach. The immediate task becomes easier, but repeated reliance on generated solutions can reduce opportunities to develop independent analytical skills.

This is particularly relevant to junior security professionals, who need direct experience with protocols, application logic, and exploitation mechanisms. Experienced researchers face a different risk: allowing familiar AI-generated approaches to narrow their investigations instead of considering less obvious attack paths.

Preserving the hacker mindset requires deliberate cognitive engagement. This means developing hypotheses before consulting AI, examining why its suggestions might be wrong, and treating unexpected results as opportunities for investigation rather than reasons to request another payload.

AI can be particularly useful as an adversarial thinking partner. Asking a model to challenge architectural assumptions, identify gaps in an attack hypothesis, or propose competing explanations encourages deeper analysis without delegating the final judgment.

For offensive security teams, the objective is to preserve the curiosity, technical intuition, and independent reasoning that make unconventional vulnerabilities discoverable. AI should expand the range of possibilities a researcher investigates, rather than determine the limits of that investigation.

Practical Examples: Why Context Matters More Than AI-Generated Payloads

The gap between payload generation and vulnerability analysis is easy to see in familiar web vulnerabilities. Even relatively simple examples depend on exact input-processing behavior, not on the number of strings an assistant can produce.

Example 1 — Path Traversal and Input Sanitization

Consider download?file=invoice.pdf.An AI tool can generate dozens of traversal variants, but the useful question is how the application transforms the parameter before opening a file.

Suppose it removes ../  using a single, non-recursive replace('../', '') operation. The input ....// can then become ../

after replacement: the sanitizer has reconstructed the sequence it meant to eliminate.

That behavior is a candidate weakness, not yet a proven vulnerability. We would examine decoding order, path normalization, allowed base directories, and the filesystem access actually available to the application. Controlled requests would then establish whether the transformed value reaches an unauthorized file.

AI is useful here for comparing string and parser behavior or generating isolated test cases. It does not replace confirming the transformation in the implementation. The remediation question also changes: deleting suspect substrings is brittle; resolving paths against an approved directory and enforcing the resulting boundary addresses the underlying problem.

Example 2 — Context-Dependent Cross-Site Scripting

Now consider input rendered inside JavaScript: var searchQuery = "USER_INPUT";.

Asking an LLM for common XSS payloads may produce HTML-oriented strings that do not exercise the relevant context. The assessment instead needs to establish how quotation marks, backslashes, line terminators, and encoding transformations affect the generated script. HTML parsing and Content Security Policy can introduce further constraints.

A tester should inspect the exact response, formulate a context-specific hypothesis, and verify whether user-controlled input can change executable behavior. AI can help enumerate parser edge cases; it cannot establish impact from the payload’s appearance alone.

In both examples, the value of web application penetration testing lies in identifying the failed control and demonstrating its consequences. A long list of attempted payloads does neither.

A Human-Led Framework for AI-Assisted Penetration Testing

The presentation proposes a four-stage loop: Formulate → Predict → Prompt → Audit. It is a useful way to structure AI assistance without allowing model output to become the first assumption and the final verdict.

Step 1 — Formulate: Understand the Target Before Using AI

Build a working picture of assets, trust boundaries, identity flows, and expected behavior. In a Kubernetes assessment, that includes how RBAC, service accounts, network policies, and cloud IAM interact. The depth of access available will determine what can be inspected and what must remain a testing limitation.

Step 2 — Predict: Develop Independent Attack Hypotheses

State where a control might fail and what would constitute evidence. For example: a gateway enforces tenant identity, but a downstream service may trust an object identifier without repeating ownership checks. Define the identities, requests, and expected results needed to test that proposition.

Step 3 — Prompt: Use AI for Targeted Analysis and Execution Support

Use AI to interpret a specification, develop a parser, or explore alternative explanations for an observed discrepancy. Socratic prompting is useful here: ask which assumptions the hypothesis relies on, which edge cases could invalidate it, and what conflicting evidence should be sought.

Only approved tooling should receive sensitive source code, configurations, or engagement data. Generated scripts must remain within the agreed rules of engagement.

Step 4 — Audit: Verify Every Security-Relevant Conclusion

Review generated code, reproduce suspected issues, confirm reachability and prerequisites, and document observed impact. If the evidence contradicts the initial hypothesis, revise it rather than promoting a plausible model answer into a finding.

The output should be reproducible test evidence and a root-cause explanation. The loop is not a prompt recipe; it is a validation discipline that keeps the assessor accountable.

What Organizations Should Expect From an AI-Augmented Pentesting Provider

For a buyer, the useful distinction is not whether a provider uses AI. It is where AI enters the methodology, how sensitive information is handled, and which claims the testing team can substantiate when challenged.

Human Ownership of the Assessment

The provider should be able to identify who established the scope, selected attack paths, reviewed generated code, and approved the findings. For complex systems, the team should also explain which architecture-specific hypotheses were tested and which were excluded.

Verified Findings and Reproducible Evidence

A report should separate confirmed vulnerabilities from unresolved leads. Evidence needs to show the affected boundary, exploitation prerequisites, observed result, and practical impact. A convincing explanation generated by a model is not an adequate substitute.

Data Protection and Controlled AI Usage

Ask whether client code, credentials, configurations, or vulnerability evidence are sent to third-party models. Data residency, retention, logging, access restrictions, and permission to execute AI-generated scripts should be addressed before the engagement begins.

Testing Depth Over Automation Metrics

Coverage claims should be tied to actual scenarios: cross-role and cross-tenant authorization, business workflows, trust-boundary transitions, and feasible exploit chains. For clients, the stronger result is a validated explanation of why a weakness exists and what change will remove it—not a higher count of automated tests.

How Iterasec Combines Human Expertise With AI-Assisted Security Testing

At Iterasec, we scope penetration testing around the client’s architecture and the assets an attacker could realistically reach. That approach matters across API testing, cloud and Kubernetes assessments, and applications with complex authorization or business workflows. An isolated scanner finding rarely explains the complete exposure.

Our testing process combines manual investigation, established methodologies, and appropriate automation. Where AI assistance adds value, it should support analysis and routine execution without replacing evidence-based validation. We retain responsibility for the testing logic, the conclusions in the report, and remediation guidance that addresses the root cause rather than the visible symptom.

Iterasec is CREST-accredited for penetration testing and vulnerability assessment. For clients evaluating a provider, the relevant deliverable is still the assessment itself: a defensible scope, documented methods, validated findings, and clear remediation priorities.

Conclusion 

Generative AI changes the cost of producing scripts, test cases, and technical hypotheses. It does not remove the requirement to understand a target well enough to challenge those hypotheses. In fact, plausible machine-generated output makes independent verification more important.

For a penetration testing provider, the measure of progress is not how much reasoning can be outsourced. It is whether automation creates more time for architectural analysis, exploit-chain validation, and technically sound reporting. Clients should expect that distinction to be visible in the methodology and the evidence delivered.

Iterasec provides expert-led penetration testing tailored to application behavior, infrastructure boundaries, and realistic attack paths. Contact our team to discuss the scope and testing depth your environment requires.

 



 

FAQ

It uses AI to assist with reconnaissance analysis, code review, scripting, test-case generation, and vulnerability research. In an expert-led engagement, qualified testers establish the methodology and validate findings against the target environment before reporting them.

AI can automate increasingly sophisticated tasks, but an assessment still needs accountable decisions about scope, system behavior, exploitability, and evidence. The quality of those decisions matters more than whether an individual payload was written by a human or generated by a model.

Potential gaps include business logic abuse, inconsistent cross-service authorization, tenant-isolation failures, and multi-step attack chains. Coverage depends on the tool, the supplied context, and the testing methodology; no vulnerability class is inherently invisible to every AI system.

AI-assisted testing uses AI during an assessment of applications or infrastructure. AI/LLM penetration testing assesses AI-based systems themselves, including prompt injection, tool permissions, and sensitive-data exposure. These are different scopes, although the testing techniques can overlap.

Review the proposed scope, human oversight, validation process, protection of sensitive information, and reporting standards. Ask how the team will investigate business logic and attack chains, how it handles uncertain findings, and what technical evidence will support remediation.

Latest posts

AI-assisted Software Development Security: Risks, Vulnerabilities, and Best Practices

At Iterasec, we are watching a fundamental shift in how software is built. In 2026, manual syntax is no longer

Read more

Practical Attacks on LLMs: Full Guide to LLM Attacks

Large Language Models (LLMs) are integral to many modern applications, from chatbots to decision-making systems. However, their growing use also

Read more

Understanding AI Attacks and Their Types

In today’s rapidly evolving technological landscape, integrating Artificial Intelligence (AI) in cybersecurity brings significant advantages and challenges. AI cyber-attacks are

Read more

Contacts

Please tell us what are you looking for and we will happily support you in that. Feel free to use our contact form or contact us directly.

    Thank you for submission!

    We’ve received your request and will get back to you shortly. If you have any urgent questions, feel free to contact us at [email protected]