Application Context Made Easier
One of the more interesting things about performing application security reviews is how much of the work involved has very little to do with looking for vulnerabilities.
When you sit down to review an application you're unfamiliar with, you spend a considerable amount of time learning how the software works. You look at how requests are routed, how authentication and authorization are implemented, how data moves throughout the application, and what assumptions different components make about one another. You also need to understand what the application actually does from a business perspective because, particularly when reviewing for logic flaws, that understanding is often what allows you to recognize that something is wrong in the first place.
Anyone who has spent a meaningful amount of time performing security code reviews probably has some appreciation for how expensive this process can be. What I find particularly frustrating is how often we repeat it.
We might acquire a fairly sophisticated understanding of an application during a pentest, only to have much of that knowledge disappear into a report containing a handful of vulnerabilities. Another practitioner comes along six months later and performs much of the same research. A developer introduces a new feature, and someone on the security team has to reacquaint themselves with the application to determine the implications of the change.
For most of my career in application security, this was a reasonable consequence of the technology available to us. I don't think that's the case anymore.
We recently launched SecMaps at DryRun Security with a substantially expanded approach to how we construct, maintain, and utilize application context. SecMaps are detailed security context graphs that represent the features of your applications, their security mechanisms, the relationships between them, and the source code that implements them.
I'd like to spend some time explaining what we've built, why we've invested so heavily in it, and where I think this capability becomes particularly interesting for the future of application security.
Application context has always been part of the work
Consider something as seemingly straightforward as reviewing an endpoint for an insecure direct object reference (IDOR).
Depending on how the application was written, determining whether a user can access another user's data might require understanding the routing configuration, middleware, controller inheritance, authorization libraries, tenancy model, and the behavior of the underlying data access layer. You may also need to understand whether the application intentionally allows certain classes of users to access resources belonging to other users.
I've seen plenty of situations where an individual function looks perfectly reasonable in isolation, but the assumptions it makes about its callers are incorrect. The inverse happens quite frequently as well, where something appears vulnerable until you understand the controls implemented elsewhere in the application.
This has historically been one of the more difficult problems for automated application security tooling to solve. It is also why experienced practitioners spend so much time developing an understanding of the software they're reviewing.
Since the early days of DryRun, we've invested in constructing application context to help our systems perform this kind of analysis. Understanding the application has become fundamental to how we perform pull request reviews, conduct full-repository security assessments with DeepScan, and answer questions about our customers' software.
Our original approach to SecMaps organized this understanding into documents covering various security-relevant topics. These included things like application behavior, authentication, authorization, configuration, frameworks, and data storage.
This worked quite well, but as we began doing increasingly sophisticated things with our agentic security systems, we found ourselves wanting considerably more from the context we were constructing.
Why we moved to a graph
Imagine an application that supports traditional browser sessions, API tokens, and single sign-on. It also has a customer-facing administrative interface, an internal support application, several background workers, and a rather elaborate permissions model.
Describing all of this in an authentication document and an authorization document is certainly possible, but the usefulness of those documents begins to diminish as the complexity of the application increases.
If one of our agents is investigating whether a customer can access an export belonging to another tenant, I want it to be able to acquire the relevant details about the export functionality, the tenancy model, and the authorization mechanisms governing that particular feature. Giving the agent several lengthy documents containing everything we know about authentication and authorization is a relatively inefficient way of accomplishing that.
There is also the issue of relationships. Much of what makes application security interesting exists in the relationships between otherwise unremarkable pieces of functionality.
The new SecMaps represent individual application features and security mechanisms as nodes within a graph. Each node contains a detailed description of the functionality it represents and connects to other relevant nodes and the source files responsible for its implementation.
For example, a SecMap might contain individual nodes for:
Session-based authentication and service-to-service authentication.
Role-based permissions and resource ownership checks.
Administrative functionality and customer impersonation capabilities.
Tenant isolation and data access mechanisms.
File uploads, data exports, billing, and other application-specific features.
The relationships between these nodes allow us to represent which authorization mechanisms govern a particular feature, which components implement those mechanisms, and where the relevant behavior exists in the codebase.
We've also accounted for repositories containing multiple applications. The authentication behavior of an internal administrative application shouldn't inadvertently become part of our understanding of a public-facing API simply because the two happen to live in the same repository.
The result is a much more granular representation of the software that both our security agents and our customers can work with.
How do we know the context is correct?
One of the things that concerns me about the proliferation of AI-generated software documentation is that it can be remarkably convincing even when it is incorrect.
In application security, an inaccurate description of how a security mechanism works can have some fairly significant consequences. If an agent incorrectly believes that a particular authorization middleware applies to every endpoint within an application, subsequent investigations may inherit that assumption and overlook legitimate vulnerabilities.
Conversely, an incorrect assertion that an endpoint lacks authentication can cause an agent to spend considerable resources investigating a condition that doesn't actually exist.
We wanted to be particularly deliberate about this aspect of SecMaps.
Security-relevant assertions within a SecMap are represented as claims, with evidence pointing to the specific files and lines of code that support them. We perform deterministic validation of these references before accepting the content into the graph, ensuring that the referenced files and line ranges exist within the repository being analyzed.
We've also put considerable thought into what constitutes an acceptable claim in the first place.
For example, stating that an endpoint has no authorization checks requires considerably more investigation than establishing that the function implementing the endpoint doesn't contain an explicit authorization check. Depending on the framework and architecture, authorization could be implemented in several other places.
Similarly, asserting that every endpoint uses a particular authentication mechanism requires evidence about every endpoint covered by that assertion. We shouldn't allow an observation about a subset of the application to quietly become a statement about the entire application.
There are also considerations around feature flags, environment-specific configurations, inherited behavior, and code that exists in a repository but isn't actually invoked.
These distinctions may seem somewhat pedantic until you've spent time building systems that utilize the output of one AI agent as an input to another. An incorrect assertion made early in a workflow can become the basis for a substantial amount of otherwise perfectly reasonable analysis.
This is also why our security reviewers are required to independently verify relevant SecMap claims in the source code before utilizing them as the basis for a vulnerability finding. A valid source reference establishes that the referenced code exists, but it doesn't independently establish that our interpretation of that code is correct or applicable to a particular execution path.
Our objective with SecMaps is to make the acquisition of useful application context considerably more efficient while maintaining the rigor necessary to perform meaningful security analysis.
If you're exploring a SecMap in the DryRun dashboard, you can inspect the evidence associated with individual nodes and navigate directly to the relevant source code at the revision we analyzed.
This is a capability I think security practitioners should expect from systems performing this kind of work.
Maintaining an understanding of software that continues to change
Another interesting engineering problem is figuring out how to maintain this understanding over time.
Historically, we've treated a lot of application security artifacts as point-in-time exercises. We produce threat models, architectural diagrams, security assessments, and various other representations of our software that begin depreciating in accuracy as soon as development continues.
With agentic software development, the rate at which that depreciation occurs is becoming increasingly problematic.
Because SecMap claims are associated with the code that supports them, we can identify which portions of our application context have potentially been affected by changes to the repository.
When the underlying implementation changes, we can revisit the corresponding nodes, update our understanding, and account for newly introduced functionality or mechanisms that no longer exist. We can also retain previously acquired context where the supporting implementation remains unchanged.
This is important from an inference economics perspective, but I think it is considerably more interesting from an application security perspective.
Consider an organization that introduces a new mechanism for service-to-service authentication. Even if the implementation contains no immediately identifiable vulnerability, this is something the security organization ought to know about. It may affect future architectural decisions, existing threat models, incident response procedures, or the security expectations we have for other services.
The same is true of new administrative capabilities, changes to tenant isolation, the introduction of sensitive data into a service, or a new integration with a third party.
Historically, much of our automated tooling hasn't been particularly interested in these events unless they produce something that can be classified as a vulnerability.
I think there's an enormous amount of value in continuously acquiring and maintaining this information irrespective of whether it results in a finding.
What this means for our security agents
One of the benefits of building DryRun as an AI-native application security system is that we can reconsider a number of the architectural assumptions that have historically constrained security tooling.
An experienced practitioner doesn't perform a comprehensive review by independently evaluating every line of code with equal scrutiny. They develop hypotheses about where interesting security conditions might exist, acquire the information necessary to investigate those hypotheses, and adjust their approach as they learn more.
We've invested quite heavily in enabling our systems to perform similar kinds of work.
With the new SecMaps, our DeepScan planners can reason about individual application features and security mechanisms when determining what deserves investigation. Our reviewing agents can retrieve relevant portions of the graph as they encounter questions about the behavior of the application.
An agent investigating a potential authorization flaw, for instance, can discover which shared authorization mechanisms exist, where they're implemented, and how they relate to the functionality under investigation without having to independently rediscover all of that information.
Our pull request reviews and other codebase intelligence capabilities also benefit from the application understanding we accumulate.
What's particularly exciting to me is that the work performed to understand an application becomes an asset that can be utilized across multiple security activities. We don't have to treat every review as an isolated event whose only useful output is a collection of findings.
This fundamentally changes the economics of performing contextual application security at scale.
Security practitioners should have access to this information too
While much of our investment in application context has been driven by the needs of our agentic systems, there was never any particularly good reason to restrict this information to those systems.
If DryRun has acquired a detailed understanding of how your application handles authentication, authorization, and various business-critical features, that understanding should be available to your security and engineering organizations.
There are a number of practical applications for this capability.
An AppSec engineer preparing to review an unfamiliar service can use a SecMap to understand its functionality and locate relevant security controls. A practitioner scoping a penetration test can identify interesting areas of the application before beginning the assessment. A security architect can reference the existing implementation when evaluating a proposed change to an authorization model.
When investigating a DeepScan finding, practitioners can also explore the application context as it existed when that particular assessment was performed. This provides some useful insight into the information available to our system when it was investigating the issue.
I suspect that many of the more interesting use cases for SecMaps will have relatively little to do with vulnerability management.
Why I think this matters for the future of AppSec
I've written quite a bit recently about the advantages defenders possess over attackers and how poorly we've historically utilized some of them.
We have access to the source code while it's being written. We have access to the people designing the software, the business requirements driving its development, and the architectural decisions that influence how security mechanisms are implemented. We also have the opportunity to influence the software before it reaches an environment where an attacker can interact with it.
Yet much of the institutional knowledge that enables us to capitalize on these advantages remains difficult to acquire and even more difficult to maintain.
Some of it lives in documentation. Some of it exists in conversations that occurred years ago. A substantial amount of it lives in the heads of people who may or may not still work for the organization.
Even when the answer is present in the source code, there has historically been a fairly significant human cost associated with extracting that answer and making it useful across an entire engineering organization.
AI changes what is economically feasible here.
We have an opportunity to build systems that continuously acquire an understanding of our software, retain what they've learned, revisit that understanding as the software changes, and make it available to the people and systems responsible for securing it.
I think this becomes especially important as engineering organizations increasingly rely on autonomous agents to develop software.
If an engineering agent is going to implement a new feature within an existing application, there is an enormous amount of value in giving that agent an understanding of the application's security architecture before it begins making changes.
Which authentication mechanisms should it utilize? How is tenant isolation currently enforced? What authorization abstractions already exist within the application? What security expectations should govern the introduction of a new administrative capability?
We shouldn't have to wait until the agent has implemented the feature to discover that it made incorrect assumptions about how the application should work.
This is where I think the intersection of application context, threat modeling, security policy, and agentic software development becomes particularly compelling.
Where we're going with SecMaps
SecMaps establishes the foundation for several capabilities we're actively working toward.
We're interested in making this context increasingly accessible to both humans and agents through direct querying of the graph. We also want to extend our understanding beyond individual repositories, because many of the security properties of modern software emerge from the interactions between applications and services.
I'd like a security organization to be able to understand how authentication differs across its services, where sensitive information is processed, and which applications have implemented their own versions of security mechanisms that the organization already provides.
We're also working toward utilizing this context to support continuously maintained threat models and to provide engineering agents with relevant security guidance as they're developing software.
There's still a considerable amount of interesting engineering work to be done in these areas, but having a detailed, evidence-backed, and continuously maintained representation of application behavior gives us a much better foundation upon which to build.
I think application security is going to become increasingly concerned with how well an organization understands its software and how effectively it can utilize that understanding throughout the development process.
SecMaps are a substantial part of how we're pursuing that vision at DryRun Security.
Explore your SecMaps
SecMaps are available to DryRun Security customers utilizing DeepScan.
You can navigate to a scanned repository in the DryRun dashboard and select Explore SecMaps to inspect your application's features, security mechanisms, relationships, and the source code supporting them.
If you're not currently using DryRun Security and would like to see what this looks like against one of your own applications, we'd love to show you what we've been working on. Just schedule some time with us.
