Security

How AI Catches Complex Vulnerabilities: Inside Agentic Pentesting and Exploit Chaining

Discover how agentic AI catches business logic flaws rule-based scanners miss. See a real exploit chain escalating a fixed finding to tenant-wide compromise.

How AI Catches Complex Vulnerabilities: Inside Agentic Pentesting and Exploit Chaining

Tue 28 July 2026

A SQL injection is easy to find. A payload goes in, an error comes back, a scanner flags it. That's pattern matching, and traditional AppSec tooling has been good at it for two decades.

A business logic flaw is a different animal. Nothing is malformed. No payload breaks anything. The request is syntactically perfect, fully authenticated, and completely "valid" — it just does something the business never intended, like letting a standard user apply an internal-only discount code, or letting an authenticated attacker pull another tenant's invoices by decrementing an integer in the URL. There's no signature for that. There's no regex for "this workflow makes no business sense." Catching it requires understanding intent — what the application is supposed to do — and then reasoning about how that intent can be subverted.

That reasoning gap is exactly what agentic AI is starting to close, and it's why the language around AI in offensive security has shifted from "smarter scanning" to "autonomous agents that behave like human hackers." This article breaks down, at a technical level, how that actually works: how agents build context, map attack paths, and chain individually harmless findings into a critical exploit — and where the approach still runs into real limits. Alongside the theory, we walk through a real finding from Ostorlab Agentic Deep Scan where exactly this kind of reasoning turned a hardcoded credential that had already been marked "fixed" into a full tenant identity takeover.

What is agentic pentesting? Agentic pentesting is the use of autonomous AI agents to build contextual models of an application, map multi-step attack paths, and chain seemingly low-severity findings into critical exploits, mimicking the reasoning loop of a human security researcher.

Why Rule-Based Scanners Hit a Ceiling

SAST and DAST tools are built on the same fundamental primitive: match the input or the code against a known-bad pattern. That primitive is fast, deterministic, and cheap to run in a CI pipeline — but it has three structural blind spots that no amount of additional rules can fully close.

Limitation Why it happens What it misses
No state across requests Scanners typically evaluate endpoints in isolation, request by request Multi-step abuse: adding an item, applying a coupon, then modifying quantity to negative before checkout
No concept of "should" Rules encode syntax, not intent — a request that's syntactically valid can't be flagged by a signature A regular user calling an admin-only export endpoint that never checks role, because nothing about the request is malformed
No authorization context across accounts Single-session crawlers can't easily reason about whose data an object belongs to BOLA/IDOR — object 1042 returned to a user who owns object 1041, with a 200 OK and valid JSON

Vendors have tried to patch these gaps with more rules, more regexes, and larger signature databases, but the underlying architecture is still reactive: match now, act now, forget the last ten requests ever happened. Business logic vulnerabilities live precisely in the gap that architecture can't see — across steps, across accounts, and across what a workflow is supposed to allow versus what it actually allows.

What "Agentic" Actually Means Here

An agentic pentesting system replaces the single match-and-report step with a loop that looks much closer to how a human penetration tester actually works:

  1. Recon — enumerate the attack surface: endpoints, parameters, auth flows, roles, hidden or undocumented API routes.
  2. Hypothesis — reason about what could go wrong given the observed behavior ("this endpoint accepts an order_id and never checks ownership — worth testing as a BOLA candidate").
  3. Test — craft and send a request that would prove or disprove the hypothesis, adapting based on the response.
  4. Validate — confirm the finding is genuinely exploitable, not a false positive, usually by reproducing real impact.
  5. Chain — ask whether this finding, combined with anything already discovered, unlocks a path the agent hasn't tried yet.

Steps 2 and 5 are the difference. A rule-based scanner has step 3 and, weakly, step 4. It doesn't form hypotheses about intent, and it has no memory of prior findings to combine with the current one. An LLM-driven agent, by contrast, keeps a running model of the application — what it has learned, what it suspects, what it has already ruled out — and uses that model to decide what to try next, the same way a human tester keeps mental notes across a multi-day engagement.

Building Contextual Awareness Before Attacking Anything

Before an agent can find anything interesting, it needs to build a working model of the application that goes well beyond a URL list. In practice, this context-building phase typically covers:

  • The authorization model — which roles exist, what each role is supposed to be able to do, and how that's enforced (JWT claims, session state, RBAC middleware, or — as the case study below shows — which audiences and scopes a given OAuth client is actually registered against).
  • API and schema structure — OpenAPI/Swagger specs, GraphQL introspection, or, in a code-aware setup, the actual routing and controller logic pulled from the repository.
  • Multi-step workflows — checkout flows, onboarding, password reset, invite/approval chains — reconstructed by actually walking through the application like a user would, not just listing endpoints.
  • Code-level reachability — in code-aware agents, this means traversing the call graph from an entry point (an HTTP route, a message queue consumer) to see whether tainted input can actually reach a sensitive sink, rather than flagging every instance of a risky function by name.

This is the same groundwork a competent human pentester does during the recon and mapping phase of an engagement — reading the docs, clicking through the app as different roles, noting where privilege boundaries should exist — except an agent can hold the entire schema, every role's permitted actions, and every previous test result in working memory simultaneously, and re-check all of it every time a new finding changes the picture.

From Individual Findings to Attack Paths

Once an agent has a model of the application, it stops treating each endpoint as an isolated test target and starts treating the whole application as a graph: entry points, trust boundaries, and the edges that connect them. This is closer to attack-path mapping than to scanning — the question shifts from "is this endpoint vulnerable?" to "given everything discovered so far, what's the shortest path from an unauthenticated request to something that matters — admin access, another tenant's data, funds movement?"

That graph view is what makes chaining possible in the first place. A finding that looks like a dead end in isolation — an information leak with no direct impact, say — might be the missing edge that connects two other findings into a working path to full compromise. A rule-based scanner has no graph; it has a list of independent alerts. An agent has a graph it keeps updating.

The Core Skill: Chaining Low-Severity Findings Into a Critical Exploit

This is the capability that most separates agentic testing from traditional scanning, so it's worth walking through a realistic, illustrative example end to end before looking at a real one.

Scenario: a B2B SaaS platform, multi-tenant, with a standard invoicing feature.

Finding 1 (Low — Informational): The application's error responses on /api/v1/users/{id}/profile leak that user IDs are sequential integers, and the endpoint returns a generic "not found" instead of a proper 403 for out-of-range IDs — technically low severity, since profile data returned is minimal, but it confirms the ID space is enumerable.

Finding 2 (Medium — BOLA): /api/v1/invoices/{id} performs authentication but not authorization — it checks that a valid session exists, but never checks that the requesting user's tenant owns the invoice being requested. On its own, teams often triage this as "medium" because invoices don't contain credentials.

Finding 3 (Low — Design weakness): Generated invoice PDFs embed a "manage your subscription" deep link containing a password-reset token that is valid for 24 hours and is generated from a predictable seed (timestamp + user ID) rather than a cryptographically random value — flagged as low because exploiting it in isolation would require already knowing a specific user's ID and creation timestamp.

Individually: three tickets, none above medium, likely scheduled for a routine sprint months out.

Chained: an agent that has already mapped the ID enumeration from Finding 1 uses it to iterate invoice IDs against Finding 2, pulling invoices across tenants until it lands on one belonging to an admin account. That invoice PDF contains the deep link from Finding 3. Because the token's generation seed is now derivable (the agent has the user ID from the invoice metadata and a timestamp bound from the invoice date), it reconstructs a valid reset token, resets the admin's password, and logs in with full tenant-admin privileges — cross-tenant account takeover, from three findings that no individual scan result would have flagged as urgent.

This is what "exploit chaining" means in practice: not a single clever payload, but a graph search across the discovered attack surface, where the agent continuously asks "does anything else I've found make this exploitable?" A rule-based scanner produces three separate low/medium tickets and stops. An agent that maintains state across the whole engagement recognizes the connection because it never stopped modeling the application as one system.

Seeing It Happen: A Real Chain Found by Agentic Deep Scan

The invoicing scenario above is illustrative. The pattern it describes — a finding that looks contained until it's tested against everything else the agent already knows — shows up constantly in real engagements. Here is one, from an Ostorlab Agentic Deep Scan run against an iOS application (values below are redacted or use the synthetic domain acme.test, consistent with how the underlying tenant was scoped for testing).

Finding #1 — rated High, then marked Fixed & Verified: "Hardcoded Auth0 M2M OAuth Credentials Issue Production JWTs for Internal ACME Service." The engine pulled the app's Mach-O binary apart and found a live Auth0 machine-to-machine client_id and client_secret, embedded at build time through Flutter's DART_DEFINES mechanism — a common pattern for injecting backend config into a mobile build, and a common way to accidentally ship backend secrets to every device that installs the app.

Finding tracker view of a High-severity, Fixed & Verified issue for hardcoded Auth0 M2M OAuth credentials issuing production JWTs for an internal ACME service, with root cause, vulnerable code location, and a curl proof-of-concept.
Hardcoded Auth0 M2M credentials — initial High-severity finding

Figure 1: The initial finding. The extracted credentials were proven live — not just present in the binary — by requesting a token from the tenant's /oauth/token endpoint and confirming an HTTP 200 with a real signed JWT against the fabricated-credential HTTP 401 baseline.

Decoding the returned JWT confirmed the token was real and tied to this specific tenant: a read:TSC scope, a client-credentials grant, and a signing key traceable to the tenant's own JWKS endpoint — which also happened to leak the internal tenant hostname.

Decoded JWT payload showing aud, scope, sub, azp, and gty claims, with the signing key traced to the tenant's JWKS endpoint revealing an internal hostname.
Decoded JWT confirming a live, tenant-scoped token

Figure 2: At this point, the finding reads as contained. The token only asserts read:TSC against one audience, and the finding was triaged, fixed, and verified as High — a real credential-hygiene issue, but a bounded one.

That's where a scanner — and, frankly, most one-pass manual reviews — would stop. The credential is confirmed live, the risk is documented, engineering rotates or scopes it down, and the ticket closes. The agent didn't stop there, because "fixed and verified" answered whether the credential worked, not everything the credential could authenticate to.

Finding #2 — rated Critical, still Open: "Hardcoded Auth0 M2M Credentials in ACME iOS App Enable Auth0 Management API Access and Tenant-Wide User PII Exfiltration." The same embedded credentials remained active. The agent's next hypothesis was simple, in the same spirit as the "hypothesis" step described above: an Auth0 M2M client can be authorized against more than one audience, and the app only exercises the one it was built to call — so what else is this client actually registered for?

Finding tracker view of a Critical, Open issue: the same hardcoded Auth0 M2M credentials also authenticate to the Auth0 Management API, exposing the full tenant user directory and administrative scopes.
Same credentials, Auth0 Management API access — escalated to Critical

Figure 3: Same client_id and client_secret as Finding #1. Audience enumeration revealed they were also registered against the Auth0 Management API audience, which issues tokens with eight distinct scopes — including update:users, delete:users, create:users, and create:client_credentials.

The exploitation evidence shows exactly how the pivot was found and validated: systematic audience enumeration, not a lucky guess.

Exploitation evidence showing 38 candidate audiences tested against the OAuth token endpoint, the Management API audience returning a 200 with an 8-scope token, and a non-destructive GET request against the Management API returning a 1000-record tenant user directory containing PII.
Audience enumeration to full tenant user directory exfiltration

Figure 4: Step 1 tested 38 candidate audiences against the same token endpoint used in Finding #1, until https://acme.auth0.test/api/v2/ — the tenant's own Management API — returned an HTTP 200 instead of a 403. Step 2 used the resulting token for a single, non-destructive GET request and retrieved the full 1,000-record user directory: emails, phone numbers, last IPs, and login behavior.

Lay the two findings side by side and the chaining logic is exactly the graph-search idea from the section above, just with a credential's authorization surface as the graph instead of a set of endpoints:

Finding #1 (fixed) Finding #2 (open)
Same root cause M2M credential hardcoded in the iOS binary Same credential, same binary
What was tested The one audience the app itself calls 38 candidate audiences, systematically
What it unlocked A read:TSC token for an internal service An 8-scope Management API token
Practical impact Bounded internal-service access Full tenant user directory (1,000 records of PII) plus latent power to create, update, and delete users and mint new client credentials
Status when re-tested Already "Fixed & Verified" Still Open — the fix addressed the known audience, not the credential's actual authorization surface

Nothing about Finding #2 required a new vulnerability class or a clever payload. It required treating "this credential works against audience A" as a hypothesis to keep testing, not a closed question — the same instinct that turned three unrelated low/medium tickets into a tenant takeover in the illustrative walkthrough above. The difference here is that the finding it built on had already been marked resolved, which is exactly why state and re-evaluation matter: a fix that closes the documented path can still leave the underlying credential's full reach unmapped.

Where This Matters Most: Business Logic Flaws

Business logic vulnerabilities are the category where this contextual, stateful approach earns its keep, precisely because these flaws don't correspond to a CWE signature — they correspond to a broken assumption about how the workflow should behave.

Business logic flaw What a rule-based scanner sees What an agent tests for
Checkout price tampering A price parameter in a POST body — nothing malformed about it Whether the server re-validates price server-side, or trusts the client-submitted value at final charge
Coupon/discount stacking Two valid, independently-working API calls Whether applying coupon A then coupon B bypasses a "one discount per order" rule the frontend enforces but the backend doesn't
Negative quantity / refund abuse A quantity field accepting an integer Whether a negative quantity is accepted and processed as a credit rather than rejected
Workflow step-skipping Independent, individually authenticated endpoint calls Whether calling step 3 of a 4-step approval workflow directly, without steps 1–2, still completes the action
Race conditions on limited resources N/A — timing isn't visible to single-request scanners Firing concurrent requests against a rate-limited or one-time-use endpoint (a promo code, a withdrawal) to see if the check-then-act logic can be raced

None of these require an unusual payload. They require an agent that understands what the workflow is for, then systematically tries the sequences, parameter values, and timing windows a designer didn't anticipate — exactly the exploration a skilled human tester does when they stop looking for broken syntax and start asking "what happens if I do this out of order?"

Solving for False Positives: Proof, Not Pattern-Matching

Contextual awareness solves half the problem; the other half is trust. Security teams have spent years tuning out scanner noise, and an agent that "reasons" its way to a finding is worthless if engineering doesn't believe the output. The fix that mature agentic platforms converge on is the same one a bug bounty triager would apply: don't report a hypothesis, report proof.

In practice, that means the validation step (step 4 in the loop above) isn't a confidence score — it's an actual reproduction, close to what Figures 1 and 4 above show: a runnable request, the exact response it produced, and the specific claim that response substantiates. That means:

  • Generating a runnable proof-of-concept, typically an executable cURL command or request script, that a developer can run to see the exploit happen.
  • Capturing the full evidence trail — request, response, and where relevant, screenshots or logs showing the real-world impact (another tenant's data on screen, a privilege change taking effect).
  • Re-testing the finding after a fix ships, to confirm the patch actually closed the path rather than just changing the error message — the exact check that would have caught Finding #2 above sooner, since Finding #1's fix didn't retire the credential's broader authorization surface.

This is also where human-in-the-loop review still earns its place even in a highly autonomous pipeline: novel findings, or chains that touch particularly sensitive systems, benefit from a person confirming the agent's proof before it lands in a developer's queue. The goal isn't to remove judgment from the process — it's to make sure the judgment being exercised, human or automated, is backed by evidence rather than a pattern match.

How These Systems Are Actually Built

Under the hood, agentic pentesting platforms generally converge on a layered architecture rather than one monolithic model doing everything at once:

  • A coordinator layer that scopes the target, breaks the engagement into independent workstreams, and decides which specialist to route each one to — it doesn't attack anything itself.
  • Specialist agents, each focused on a narrower problem: one tuned for BOLA/IDOR exploration, one for authentication and session flaws, one specifically for multi-step business logic abuse, one for regression-testing previously fixed issues.
  • Sandboxed, deterministic tools the agents call into for the actual mechanical work — sending requests, parsing responses, diffing state — so the LLM is reasoning about what to test, not hand-crafting raw HTTP traffic from scratch every time.

Splitting the architecture this way matters for accuracy as much as for safety: a single general-purpose agent trying to reason about recon, injection, access control, and business logic simultaneously tends to lose the thread inside a crowded context window. Narrower, coordinated agents stay focused, which is also why the specific model behind each agent tends to matter less than how well the orchestration layer manages scope, memory, and tool access. Platforms built specifically for application security — Ostorlab's Agentic Deep Scan among them — apply this same pattern across both web and mobile targets, pairing autonomous exploration with an AI triage layer that revalidates every finding before it's surfaced, so the output a developer sees is proof-backed rather than a raw model guess.

Where Humans Still Win

None of this makes human pentesters redundant, and the more credible vendors in this space are explicit about that. Agentic systems are currently strongest on the vulnerability classes that reward systematic, exhaustive exploration — role-based access control, IDOR/BOLA across large numbers of objects and tenants, and known chaining patterns applied at a scale no human could match in the same time (testing 38 candidate audiences one by one is exactly this kind of task). They're comparatively weaker on genuinely novel attack chains that require creative lateral thinking outside the patterns they've been exposed to, deep business-risk judgment ("is this technically exploitable but operationally irrelevant to this specific client?"), and social engineering or physical-adjacent scenarios that fall outside an API surface entirely.

The realistic picture for 2026 is augmentation, not replacement: agents handle the continuous, wide-coverage exploration that used to consume most of a pentest engagement's calendar time, and human testers spend their hours on the harder, more creative 10% of findings — plus validating the output the agents produce.

Evaluating an Agentic AI Pentesting Platform: What to Actually Check

For an AppSec architect deciding whether to bring one of these tools into a DevSecOps pipeline, a few questions cut through most of the marketing:

  • Does it maintain state across the full engagement, or does it re-run isolated tests per endpoint? State is the prerequisite for chaining at all.
  • Does every finding ship with a reproducible proof (a runnable request, not just a description) rather than a severity score you have to manually verify?
  • Can it test authenticated, multi-role workflows — logging in as multiple distinct user types and testing cross-role access, not just unauthenticated surface scanning?
  • Does it re-test after a fix, closing the loop instead of leaving your team to manually confirm remediation — including checking whether a fix addressed the full authorization surface, not just the specific path first reported?
  • How does it fit CI/CD — can it run on every pull request without becoming a bottleneck, and does it integrate with the ticketing system your developers already use?
  • What's the human-in-the-loop model — is there a review step for high-impact or novel findings before they reach engineering, and can you bring your own model/API key if data residency matters to your org?

FAQ

Can AI agents find business logic vulnerabilities? Yes, within limits. Agents that maintain context about roles, workflows, and prior findings can identify logic flaws like checkout tampering, workflow step-skipping, and cross-tenant access issues that pattern-based scanners structurally can't detect, because these flaws don't correspond to a malformed request. They're less reliable on flaws that require judgment about business risk unique to a specific organization.

How does agentic AI penetration testing differ from traditional DAST/SAST? DAST and SAST match requests or code against known-bad patterns, request by request, with little or no memory across the engagement. Agentic pentesting runs a continuous reasoning loop — recon, hypothesis, test, validate, chain — that keeps a working model of the whole application and actively looks for ways prior findings combine into a larger exploit.

What are automated exploit chaining tools, technically? They're systems that treat the discovered attack surface as a graph rather than a list, tracking how each finding changes what's reachable elsewhere in the application. When a new finding is confirmed, the agent re-evaluates whether it connects to anything already discovered — the way an information leak might make a previously "medium" IDOR exploitable at scale, or the way one exposed credential's full authorization surface might extend well past the single audience it was first reported against.

Do agentic AI pentesting tools eliminate false positives? No tool eliminates them entirely, but the leading platforms reduce them significantly by requiring proof of exploitability — a runnable PoC and evidence trail — before a finding is reported, rather than reporting a pattern match or a model's confidence score.

Can AI replace human penetration testers? Not currently, and most credible vendors don't claim otherwise. Agents excel at systematic, wide-coverage testing across known vulnerability classes at a speed and scale humans can't match. Humans remain stronger at novel attack chains, business-risk judgment, and validating the highest-impact findings before they reach a client or engineering team.

The Bottom Line

Rule-based scanners will keep catching the vulnerabilities that look wrong on the wire. The vulnerabilities that don't — the ones hiding in a workflow's assumptions, or in a credential whose full authorization surface was never fully mapped — need something that reasons the way an attacker does: build a model of the system, form a hypothesis, test it, and keep asking what else it connects to. That's the actual technical shift agentic AI represents in application security, and it's why the conversation in AppSec has moved from "can we scan faster" to "can we think like an attacker, continuously, at the scale of a modern application estate."