alxk
← All writing

Org-scale appsec harnesses on a token budget, with coverage guarantees

TL;DR: Some thoughts on optimising appsec harnesses for token spend while gaining some form of coverage guarantees. Map attacker-controlled data flows across services, run some taint analysis, and feed the resulting chains to vuln-hunting LLM workers.

Intro

Nicholas Carlini from Anthropic (Black-hat LLMs, [un]prompted 2026) half-jokingly says his harness for finding critical 0-days is a 10-line bash script that feeds every file in a repo to a frontier model with a prompt to find vulnz here plz. That approach is effective, but it is better suited to a frontier lab with infinite tokens and trying to prove a point!

On the other end of the spectrum we have full blackbox pentesting harnesses like ARTEX; you give them an objective, maybe point them at some infra, and off they go.

Somewhere in the middle there’s whitebox harnesses like Mandiant’s AVDH (Offensive Harness Design, OAIC 2026), which inspired this post. Much smarter about where tokens go: entry points become leads, leads get prioritised, findings get checked before anyone sees them. They have an agent read Terraform to work out the network topology and how exposed each service is. But they don’t stitch data flow across services.

While all of these have their place, they’re either token hungry or blind to how data moves across the org, and none of them come with much in the way of coverage guarantees.

Can we do better?

If we’re an internal security team operating with a token budget looking to improve our appsec posture, we can do better.

We have whitebox access to our cloud infra and our version control system. To keep things conceptually simple let’s just assume all our workloads are containers and they only make synchronous calls to other services (though the idea extends to async services and non-container workloads).

This means we can:

  1. Use cloud infrastructure asset tracking (Cartography, Wiz, or direct control plane queries) to map our ingress points and the services that sit behind them
  2. Trace container image provenance back to repositories and their build paths (we do attest our images in the CI pipeline, eh?)
  3. Map endpoints and data parameters those services expose (OWASP Noir)
  4. Trace those data parameters down to the outbound requests of those services (CodeQL)
  5. Enrich with more contextual data from our cloud infra or infra as a code (like NetworkPolicy)

We’re now in a position to map the flow of data parameters that are internet exposed and user controlled down through our services.

A chain through the map: internet request, Ingress, orders service, billing service, SQL sink. body.tenant_id flows across both services into a bound SQL argument and becomes a lead; body.note is not forwarded; a call to analytics is denied by NetworkPolicy

Most of this mapping can be done with deterministic static rules, and maybe a sprinkle of LLM magic on top.

None of these steps are new on their own; code-to-cloud tools like Wiz already trace running images back to their repos and flag how exposed they are. What I haven’t seen yet is tooling that follows the actual data parameters across services, and turns that into a finite set of leads for appsec agents to churn through.

Cross-service taint analysis and lead generation

With this map in hand, we can do some taint analysis and query code sinks across our services. CodeQL only sees one repo at a time, but the map tells us which endpoint each outbound call lands on, so we can stitch the per-service flows into chains.

  • “Give me all chains that go from user data input down to an outbound request (SSRF)”
  • “Give me all chains that go from user data input down to a SQL query, bound or not (SQLi, IDOR…)”
  • “Give me all chains where user data input ends up as an identity or tenant a downstream service trusts (confused deputy)”
  • …

Those chains become our leads. We give the chains, along with the code around each hop, to a review agent tasked to investigate given vulnerability classes; it can pull more code with read-only tools if it needs to.

Additionally, we can generate those leads in the context of a particular service’s CI pipeline, and feed them to a SAST agent; it’s no longer looking at the code change in isolation but now also has context on how that service is deployed in the org.

Coverage guarantees, costs & limitations

With tooling like this, we no longer say “I pointed the pentest agent at our infra and codebase, let it burn $10k tokens and it came back with X vulns”. Instead, we can say “the agent investigated all X chains where user-controlled input flows to an outbound HTTP request and we now have high confidence we’ve eliminated SSRF as a vulnerability class within what we can map”.

Funnel: the whole map, internet reachable, user input to sink, leads, reviewed, findings. Mapping is mostly static rules, review is done by an agent; what drops out at each step is noted below

This works great for vulnerability classes with well-defined sinks like injections, SSRF, IDOR (the data flow kind) etc; we only have sinks for what we know we’re looking for.

There are some limits too: As the folks highlight in the AVDH talk, path explosion is an issue. We have to limit ourselves to depth N in the mapping. We also have to decide to what extent we want to descend into 3P code.

Overall, this is more token efficient than the blackbox and full-loop approaches: we investigate what attackers can reach, from a whitebox perspective. And with the leads so well defined, we can delegate the vulnerability analysis to cheaper models.

Taking it further

Above I said this works for vulnerability classes with well-defined sinks we can query, but the map is useful beyond queryable sinks. We know every endpoint that’s reachable from the internet, directly or via service hops, and which data the attacker controls on it and where that data goes, so those are leads to investigate too: is there auth/z here, does that make sense for how exposed it is, does this chain vibe with business logic?

What’s reachable from the internet is also just one starting point. Swap it for a compromised 3P pod somewhere, or someone who got onto the internal network with some user token, and we know what they can reach, what they control and which sinks they can get to (we’d need to model things like mesh policies, identity etc, of course). We can generate leads to investigate from those vantage points.

The same map from two starting points: from the internet, every front door and what is behind it; from a compromised third-party pod, only what it can reach, including an analytics service the internet cannot reach