AI and network security

What is attack surface?

Attack surface is the set of points on the boundary of a system where an attacker can try to enter, cause an effect on, or extract data from it. That includes every reachable network service, login page, API, credential, dependency and person who can be tricked. The smaller and better known it is, the fewer places an attacker can start.

TL;DR

Attack surface is every point where an attacker can try to get in, change something or take data out, and grows with each internet-facing service, credential and AI agent. Map it from the outside in, then remove what need not be reachable before hardening the rest. One gateway on a local network exposes one door, not one per device.

Learning objectives

After reading this article you will be able to:

  • Define attack surface using NIST's wording and list the kinds of exposure it covers
  • Map an organisation's attack surface starting from what the internet can reach
  • Reduce attack surface by removing exposure, not only by hardening it

Attack surface definition

Attack surface is every point where an attacker can try to get into a system, make it do something, or take data out of it. NIST defines it as the set of points on the boundary of a system, a system element, or an environment where an attacker can try to enter, cause an effect on, or extract data from it.

The word “try” matters. A server with no known flaw is still attack surface, because it is reachable, and the next flaw found in it will be reachable too. Google’s threat intelligence team measured the average time between a vulnerability being disclosed and being exploited at five days in 2023, down from 32 days in 2021 and 2022. When exploitation follows disclosure that quickly, everything you expose is effectively one bad week away from being a way in.

Attack surface components

Anything an attacker can reach or use counts as attack surface: network services, software, credentials, people and physical access. In practice it falls into a few groups:

  • Network exposure. Public IP addresses, open ports, domains and subdomains, VPN endpoints, remote desktop, admin panels and every device that answers from the internet.
  • Applications and APIs. Websites, login pages, mobile app backends, webhooks and any endpoint that accepts input.
  • Credentials. Passwords, API keys, tokens and certificates. Each one is a way in for whoever holds it, and a long-lived key copied into code, CI systems and laptops spreads that way in to every place it is stored.
  • Third parties and supply chain. Libraries, SaaS integrations, cloud providers and anything that runs with your permissions.
  • People. Staff who can be phished, and support desks that can be talked into resetting an account.
  • AI agents and tools. The content an agent reads, the tools it can call and the keys those tools hold. OWASP’s 2025 Top 10 for LLM applications lists prompt injection and excessive agency among the top risks. Are AI agents a security risk for businesses? covers this in detail.
  • Physical and radio access. Ports on a device, and wireless links within range.

Attack surface mapping

Mapping attack surface starts from the outside and works in, because that is how an attacker starts.

  1. List what the internet can reach. Every public IP address, domain, open port and cloud service with a public endpoint. Include the forgotten ones: staging sites, old marketing pages, test APIs and devices someone put on a public address years ago.
  2. List every credential that grants access. API keys, service accounts, deploy keys, shared passwords and tokens held by integrations and agents. Note how long each lives and how widely it is copied.
  3. List what each exposed thing can reach. A web server that can talk to the production database puts the database one step behind the website.
  4. Track the count. The total number of exposed services and live credentials is a useful number to watch. If it only ever grows, the attack surface is growing faster than anyone is reviewing it.

Attack surface reduction

Reducing attack surface means removing exposure first, then hardening what has to stay. Hardening a service you did not need to expose is work spent defending a door you could have bricked up.

  • Take things off the internet. CISA’s first mitigation for operational technology is to remove its connections to the public internet, because those devices are easy targets when connected. The same reasoning applies to cameras, controllers, printers and internal tools.
  • Funnel what remains through fewer doors. NIST’s control SC-7(3) says to limit the number of external network connections to a system, which makes the traffic that does cross easier to watch. How does a single gateway reduce attack surface? explains the pattern.
  • Cut and shorten credentials. Delete keys nobody uses, scope the rest to one job, and prefer credentials that expire on their own.
  • Patch what stays exposed, fast. A five-day average time-to-exploit leaves no room for a monthly patch cycle on internet-facing systems.
  • Give tools and agents only what the task needs. Every permission an agent holds is reachable by anyone who can steer it.

Local networks and attack surface

Local coordination removes a whole category of exposure outright. When devices find, authenticate and talk to each other on a local network or over a short-range radio, they do not need to be reachable from the internet at all. An attacker on the other side of the world cannot scan for them, cannot reach their services, and cannot try a stolen password against them. To touch the fleet, an attacker has to be in radio range or already hold a foothold on a device inside.

That is the design Offline Protocol has been building. Devices generate their own Ed25519 identity keys and derive their addresses from them, so two devices verify each other directly with nothing to look up. Messages and groups are end-to-end encrypted with MLS. Discovery, messaging, shared documents and service calls run over Bluetooth LE, Wi-Fi and local IP, and a local mesh needs no portal account and no API key. The internet is an extra path, through a relay or a gateway you provision against a defined contract, not a requirement. The result is a fleet whose internet-facing attack surface is one gateway you chose and hardened, instead of every device you own.

Frequently asked questions

What is the difference between attack surface and a vulnerability?

Attack surface is where an attacker can try; a vulnerability is a flaw that lets an attempt succeed. A service with no known vulnerabilities is still attack surface, because the next flaw found in it will be reachable the day it is published.

Is an API key part of the attack surface?

Yes. Any credential that grants access is a way in, and a long-lived key that is copied into code, CI systems and laptops spreads that way in to every place it is stored.

Do AI agents increase attack surface?

Yes. An agent adds the content it reads, the tools it can call and the credentials those tools hold. OWASP lists prompt injection and excessive agency among the top risks for LLM applications for this reason.

How do you measure attack surface?

Count what is reachable and what grants access, from the outside in, such as public IP addresses and open ports, domains, login pages, APIs, credentials in use and third-party integrations. Track the count over time; a number that only grows is a warning.

Does a local network have an attack surface?

Yes, but a different one. A device that is not reachable from the internet can only be attacked from the local network or radio range, which needs an attacker nearby or a foothold on a device already there. The gateway, if there is one, is the only door from the internet and gets the hardening.

Sources

Build it with Offline Protocol

The security docs set out what each part of an Offline Protocol deployment exposes, from device identity and encrypted sessions to gateways, and the residual risks your application still owns.

Read the security model