# captiveagent, the daemon that asks the Wi-Fi one question

> captiveagent is the daemon that checks whether the Wi-Fi you just joined wants a login page. Measured: 19 runs in 29 days, a tenth of a second each.

Source: https://www.ribbonmac.com/guides/captiveagent-mac · Updated 2026-11-18

You tap the hotel Wi-Fi name, the bars fill in, and a window slides open asking you to accept the terms or enter a room number. Nobody opened that window. The network was not working yet, no browser was running, and yet the Mac knew: this network wants something from you before it lets you online.

The process that knows is called captiveagent. It is one of the quietest daemons on the Mac, and it owns one of the smallest jobs in this series: ask every new network a single question and report the answer.

The name decodes in two parts, and the strange half is the interesting half. Agent, because it acts for the system rather than for you, the same convention as softwareupdate or install agents. Captive, from the ISP trade vocabulary: a captive portal is a network that holds you until you sign in, agree, pay or both. The word sounds like a threat and describes a lobby.

## Two sentences from 2017

Like the best daemons in this series, this one has a manual page short enough to quote whole. captiveagent(8), dated February 16 2017 and still current on macOS 27:

"captiveagent - Daemon to detect and process captive networks. This daemon issues HTTP requests to determine whether the network contains a captive web portal. It may also perform HTTPS transactions to login to and logout from the web portal."

Written for a version of macOS nine years old, and nothing about the job has changed, because nothing about hotel Wi-Fi has changed either. You still get a voucher, the network still grabs your first request, and the Mac still needs to notice.

## The 69 byte question

What does the question actually look like? You can ask it yourself. Open a terminal and fetch the probe URL the daemon uses, http://captive.apple.com/hotspot-detect.html, and on a healthy network you get back the entire verdict:

`<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>`

Sixty nine bytes. That page is the daemon's idea of the internet working. Fetch it from a captive network instead and you will not get it: the portal intercepts the request and answers with itself, a redirect, a form, a status page. The probe response header even carries a cache policy telling clients to remember it for a year, which would be terrible advice for a captive check, and the daemon's own strings show it managing that trap deliberately: it configures and clears proxy settings around each probe, because a captive answer that came from a cache would be a lie.

The binary holds the verdict vocabulary in plain text. A string that reads not-captive for the good outcome. A function name that reads foundRequiredNonCaptiveHTMLElements, the check for pages that openly declare themselves portal free. And a probe result dictionary that gets passed up the stack to whoever asked.

## Nineteen runs in twenty nine days

Most daemons in this series run continuously and you measure their cost per day. This one barely runs at all, and the launch file explains why. It sets no KeepAlive and no RunAtLoad. It registers one Mach service and lets launchd leave the daemon unstarted until somebody knocks. The knock comes from the network stack every time a join needs a verdict.

The counter on the measured Mac, a MacBook Pro on macOS 27.0.1 with 29 days of uptime, reads 19 runs. Nineteen verdicts in a month, which is roughly how many times this machine changed networks or woke on a new one. The current run started at 14:47, summoned by a Mach message, and six hours later it had spent 0.11 seconds of processor time on about 4 MB of memory. The run before it did not crash, did not idle, and did not linger: launchd's ledger says the last exit was a memory idle exit, the system politely reclaiming a process with nothing left to do.

There is a temperament visible in the launch file beyond the on-demand design. ProcessType Adaptive, meaning schedule it around what else is happening. EnablePressuredExit, meaning it volunteers to be evicted under memory pressure. A minimum runtime of 10 seconds, so launchd will not flag it as crash looping if the network hands it three verdicts in a row. Everything about the file says: this job is not important enough to keep, only to run correctly.

The daemon does not even run as root. It gets its own reserved account, _captiveagent, user ID 258, home directory /var/empty, a home that is deliberately nothing. In the account database its real name is simply captiveagent, one of the few in this series not dressed up as a sentence.

## The login window you actually see

The daemon asks the question, but the sheet you type your room number into is a different thing, and it has been in CoreServices for fifteen years: Captive Network Assistant, bundle identifier com.apple.CaptiveNetworkAssistant, still present on a current install. When the probe comes back captive, that is the window the system puts on screen. The daemon's own project string, visible in the binary, reads CaptiveNetworkSupport, which older readers will recognise as the name of the configd bundle that did this job in earlier macOS versions. The work was lifted out into its own agent, and the old name stayed behind as the project label, the same way buildings keep their first tenant's name on the deed.

The login itself has two protocols, one from each era of the internet. The old one is WISPr, the 2000s wireless ISP standard, an XML scheme where the portal answers authentication requests with structured replies. The daemon carries a full WISPr parser, and its strings name the parts: AuthenticationPollReply, AbortLoginReply, the logins and the logouts, and a strict rule that the login scheme must be https. The new one is quieter: the binary lists application/captive+json among the content types it accepts, the media type the IETF reserved for its captive portal API, a standard way for a portal to say here is the URL where you log in. One daemon, two protocols, fifteen years apart, both still spoken, because hotel networks age slowly.

There is even a third lane for the modern case where the portal hands out a token: a string in the binary logs starting token based captive portal authentication with a URL, the flow where you approve on your phone and the Mac never shows a form at all. The paperwork moved. The question stayed.

## What the sandbox admits

The sandbox profile is 2,173 bytes, copyright 2016, and it reads like a list of confessions. Network outbound, allowed. Network inbound, absent entirely: this daemon cannot accept a connection from anyone, it can only ask and receive. For a process whose whole job is talking to strangers' networks, that one direction is the design.

The file reads allowed: the System keychain, the security preferences, and the trust evaluation and certificate validation services. That admission answers a question you might not have thought to ask: when the daemon logs you into a portal over HTTPS, somebody has to decide whether the portal's certificate is any good, and that check is the same machinery your browser uses. The write permissions are the shortest list in this series, a few Spotlight metadata databases and paths under /private/var. A daemon that can barely write anywhere cannot leave much of a mess.

People sometimes remember a firewall prompt from older Macs asking whether captiveagent should accept incoming network connections. On the arrangement measured here the question cannot arise: the profile has no inbound rule to grant. The traffic goes out, the answer comes back, the connection closes.

## If it ever does something odd

The search family for this daemon has no high CPU rows and no virus rows, which matches everything measured here: one log line in a quiet hour, a tenth of a second per run, an RSS smaller than most menus. The realistic failure mode is not the daemon misbehaving but the network lying: a portal that answers the probe with Success and then gates your traffic anyway, so the Mac thinks it is free and nothing loads, or a portal that redirects every probe to a login page that never completes, so the join loops. Both are known shapes, both are documented in [the airportd guide](https://www.ribbonmac.com/guides/airportd-mac) as join restarters, and neither is fixed in Activity Monitor. The fix is the voucher, the front desk, or forgetting the network and moving on.

For the curious, the probe is safe to try by hand anywhere, and it is the fastest way to understand the daemon: fetch hotspot-detect.html on your home network and see Success, do it on hotel Wi-Fi before you sign in and watch the hotel answer instead. Two fetches, one page, and you have watched the Mac's smallest bouncer decide who gets in.

- [What Is airportd on Mac?](https://www.ribbonmac.com/guides/airportd-mac), the radio daemon that hands the joined network over for the verdict
- [What Is configd on Mac?](https://www.ribbonmac.com/guides/configd-mac), where the captive check lived as a bundle before it got its own agent
- [What Is symptomsd on Mac?](https://www.ribbonmac.com/guides/symptomsd-mac), the daemon that records how every network actually behaved
- [Why is my Mac running slow?](https://www.ribbonmac.com/guides/why-is-my-mac-running-slow), the ledger every measured daemon in this series is filed in

## FAQ

### What is captiveagent on my Mac?

It is the daemon that checks whether a network you just joined is holding you captive. Apple's manual page gives it two lines: captiveagent is a daemon to detect and process captive networks, it issues HTTP requests to determine whether the network contains a captive web portal, and it may also perform HTTPS transactions to login to and logout from the portal. That is the whole job. When you join hotel or airport Wi-Fi, this is the process that fetches a tiny test page, notices the network answered with a login form instead, and sets up the sheet you sign into. It ships with the system, it runs under its own reserved account named _captiveagent, and on the Mac measured here launchd had started it 19 times in 29 days, once per network change.

### Why does captiveagent connect to the network?

Because probing is the job. The daemon fetches one page over plain HTTP, http://captive.apple.com/hotspot-detect.html, and reads the answer. When the network is open, Apple's server answers with a 69 byte page that says Success and nothing else, and the daemon reports the network free. When a portal is in the way, the portal intercepts the request and answers with a redirect or a login form instead, and that wrong answer is how the daemon knows you are captive. Its sandbox profile on this Mac allows outbound connections only, so the traffic flows one direction: the daemon asks, the network answers.

### Can captiveagent use high CPU?

Not on any healthy network. Its measured cost is a tenth of a second of processor time for the current run, about six hours old at the time of measurement, and the run before it ended in an idle exit, the system reclaiming a quiet process. There is no high CPU search row for this daemon at all, which matches the design: it does one fetch per network join and goes back to sleep. The one pattern that could make it work hard is a portal that never finishes, a login page that redirects to itself every time it is probed, so the join and the probe loop. If you are on such a network the fix is not in the daemon, it is at the desk with the voucher code.

### Is captiveagent a virus or malware?

No, and this one is easy to check. The real daemon lives at exactly /usr/libexec/captiveagent, it is signed by Apple on the sealed system volume, and it runs as the reserved user _captiveagent with user ID 258, an account that exists for nothing else. The name frightens people because captive sounds like something done to you, but in networking jargon a captive portal is simply a network that wants a login before it lets you browse, the card you accept at a hotel desk. The virus question has no search rows attached to this name at all. A process calling itself captiveagent running from your Downloads folder would be a different story, and Activity Monitor's path column is the honest test.

### What is the difference between captiveagent and airportd or configd?

Three processes, three jobs, one join. airportd runs the radio: it scans, associates and keeps the link alive. configd configures the connection: DHCP, DNS, routes. captiveagent answers one question the other two cannot, whether this network gives you the internet or wants something first. The sequencing is visible in the machinery: airportd hands the joined network to configd, and the captive check is a separate Mach door in configd's table named captivenetworksupport, the modern face of an old bundle. Each has a page in this series, and none of them can do the others' work.

### Can I quit or disable captiveagent?

There is nothing to disable, because there is nothing running most of the time. The launch file has no KeepAlive and no RunAtLoad entry; the daemon exists only between a network join and its verdict, launchd starts it on a Mach message and it exits idle when finished, 19 times across the measured month. Quitting the visible instance buys you nothing either, since the next join starts a fresh one. The lever you actually have is upstream: forget the network in System Settings under Wi-Fi if its portal misbehaves, or ask to join networks manually, and the question simply stops being asked.
