Anthropic ran its Claude AI model over 25 open-source projects and found 493 issues in code that attackers could reach unnecessarily. Anthropic says the work is early research into automated attack surface analysis and reduction. The attack surface is the code a deployed program exposes to outsiders.
The method has Claude map which code is reachable, then restrict anything a given deployment does not need. Anthropic says this can mean moving code from before login to after login, from zero clicks to one click, or from on by default to opt-in. It argues that these steps do not remove unknown vulnerabilities but make them harder to reach, which lowers their severity.
Anthropic focused on three kinds of exposure. The first is code reachable in the default configuration that no default feature uses. The second is pairs of settings that look fine alone but together disable a security control or leave a feature undefined. The third is complex, security-sensitive code that runs before authentication, victim interaction, or a protocol state change. The 25 projects span more than five million lines of code in languages including C, C++, Java, and PHP.
Source: Using Claude to reduce the attack surface of code \ Anthropic.