Automated API security testing: what an AI agent checks and what it cannot
Automated API security testing means software, including AI agents, sends requests to a running API and checks the responses against security rules. With an OpenAPI spec and two test accounts per role, an agent can test object and function authorization, property exposure, authentication, rate limits, errors and undocumented routes. It cannot know your business rules, so a person reviews the evidence.
Automated API security testing means software sends requests to a running API and checks the responses against security rules. An AI agent adds planning: it reads each response and picks the next request. This page lists what an agent needs, the eight checks it can run, how it proves a finding and what it misses. It stays vendor-neutral. For tool lists, see automated pentesting tools on pentestcompare.com.
What can be automated in API security testing?#
Checks that compare responses across identities, replay requests with changed values or probe limits can be automated well. Checks that depend on what your business means by "allowed" cannot, unless you write the rule down first.
| Automates well | Needs a person |
|---|---|
| Same request as user A, user B and anonymous, then compare | Deciding whether a shared record is meant to be shared |
| Extra properties added to a write, then read back | Judging which properties are sensitive for your product |
| Call rates against a stated limit | Choosing the limit that fits your abuse model |
| Spec versus live route diff | Deciding whether an old version must stay online |
| Retest of a fixed finding | Confirming the fix matches the design |
For the human-led service, see API penetration testing on penetrationtestservices.com. This guide covers the automated side.
What does an agent need before it starts?#
An agent needs four inputs: a spec or route list, a base URL, test accounts and a written scope. Without accounts it cannot test authorization.
- The OpenAPI (or similar) spec, or a captured route list. The agent also reads client-side JavaScript for routes the spec leaves out.
- A staging base URL, for example
https://api.staging.example.com. - Two test accounts per role, plus one admin account if admin routes are in scope. Mark them as test data.
- A written scope that names hosts, accounts, allowed actions and rate limits, with the owner's written authorization.
Our AI testing agents also run under tool rules. Each tool the agents can use runs on its own, waits for approval or is blocked, and Excession Labs sets those rules for each scope.
Which eight checks map to the OWASP API Top 10 2023?#
The OWASP API Security Top 10 2023 names ten risks. Eight of them have a check an agent can run with an account pair and a spec. API6 (Unrestricted Access to Sensitive Business Flows) and API10 (Unsafe Consumption of APIs) depend on business context and on how your API calls others, so a person leads those.
| # | Check | OWASP 2023 risk | What the agent does |
|---|---|---|---|
| 1 | Object-level access | API1 Broken Object Level Authorization | Calls a route with object IDs that belong to the other account and compares |
| 2 | Authentication | API2 Broken Authentication | Tries missing, expired, malformed and another account's tokens |
| 3 | Property exposure and mass assignment | API3 Broken Object Property Level Authorization | Adds fields such as role to a write and reads the record back; checks responses for fields the client does not need |
| 4 | Resource limits | API4 Unrestricted Resource Consumption | Sends bounded bursts and large pages against the stated limit |
| 5 | Function-level access | API5 Broken Function Level Authorization | Calls admin routes and other methods with a normal user's token |
| 6 | Server-side requests | API7 Server Side Request Forgery | Submits URL fields that point to a lab-owned listener, never to internal hosts |
| 7 | Misconfiguration and errors | API8 Security Misconfiguration | Checks CORS, headers, verbose errors and unused methods |
| 8 | Inventory | API9 Improper Inventory Management | Diffs spec routes against live and older versions such as /v1/ |
OWASP describes API1 as attackers changing "the ID of an object that is sent within the request". Our guide on how AI agents test authorization covers checks 1 and 5 in detail. The OWASP API Top 10 guide on penetrationtestservices.com explains each risk and its fixes.
How does an agent prove an API finding?#
An agent proves a finding by showing an effect, then reading it back from a second account. A 200 response is not proof. The same rule applies to every row in the table above.
Worked example: object-level read
This is a demonstration. No real customer system was tested. "Harbor Notes" and api.harbor-notes.example.com are fictional.
Test user A owns note 101. Test user B owns note 202. Both accounts were created for this test.
GET /api/v1/notes/101 HTTP/1.1
Host: api.harbor-notes.example.com
Authorization: Bearer <token for test user B>
HTTP/1.1 200 OK
Content-Type: application/json
{"id": 101, "owner": "test-user-a", "title": "Test note A"}
Controls run next to it. A nonexistent ID returns 404. User A reading note 101 returns the same body. Anonymous returns 401. Because user B received user A's record while the controls behave as expected, the finding is labeled Observed.
For a longer worked case with a rejected false positive and a retest, read the example assessment. It uses a fictional e-commerce API.
A write needs the same care. If the agent changes a record as one account, it must read the record back through another session. A bare "success" message may mean the server accepted the request and ignored it.
What does automation miss in APIs?#
Automation misses flaws that need your intent. Four gaps recur.
- Business flows. A coupon that must work once, or a refund path that skips approval, looks valid to an agent without the rule.
- Shared records. Whether two users should see the same object is a product decision.
- Chains. Joining a small information leak with a weak function check into serious impact still takes human judgment.
- Severity. Someone on your side must decide what risk to accept.
This is why Excession Labs checks the evidence for each finding and writes the report. AI pentesting false positives shows what happens when no one checks.
What are the safe limits for automated API tests?#
Safe limits are written into the scope before the first request. Automated tests create and change data and can cost money, so bound each part.
| Area | Limit to state in writing |
|---|---|
| Data | Test-owned accounts and records only, marked as test data |
| Rate | A maximum request rate per route and in total |
| Uploads | File size, count and type |
| Password guessing | A small fixed list against test accounts only |
| Email and SMS | A cap, with test addresses only |
| Paid third-party APIs | A stated cost cap, reported afterward |
| Environment | Staging by default. Production only with tighter limits and a contact |
Reproduction scripts should be read-only where possible. Run them only with authorization and test-owned identifiers.
Where does it fit in releases and CI?#
Run fast, bounded checks on each build and agent-led testing on larger changes. A schema check, a two-account read test on a few routes and a spec-versus-live diff are cheap enough for a pipeline. Full flow testing costs more per run. Pentesting in CI/CD shows where each step fits, and per-release testing describes testing after a major change.
If you also run a DAST scanner, compare the two on one build with the method in AI pentest agents vs DAST scanners. To see an agent-led test on a small written scope, apply for the free pilot.
Questions
Can an OpenAPI spec alone be enough to test an API automatically?
It is enough to enumerate routes and parameters, not to test authorization. Object-level and function-level checks need at least two accounts per role, and the intended access model. Without them an agent can only report that a route answers, which proves nothing about who may call it.
How is automated API testing different from an API pentest?
Automated testing sends many requests quickly and compares results. A pentest adds a person who knows your business rules, builds chains and judges severity. Our model uses agents for the repetitive work and has Excession Labs check the evidence and write the report.
Should API security tests run on every commit?
Fast, bounded checks can. Examples are schema validation and a two-account read test on a few routes. Agent-led testing of full flows costs more per run, so many teams run it on larger releases. Keep production out of the loop unless the scope says otherwise.
Do automated tests need a staging environment?
Staging is the safer default, because tests create, change and delete records. If you must test production, the written scope should limit rates, accounts and actions, and name who to contact if something breaks.
Sources
- OWASP API Security Top 10 2023 (checked 9 November 2026)
- OWASP API Security Top 10 2023: API1 Broken Object Level Authorization (checked 9 November 2026)
- OWASP API Security Top 10 2023: API3 Broken Object Property Level Authorization (checked 9 November 2026)
- OWASP API Security Top 10 2023: API5 Broken Function Level Authorization (checked 9 November 2026)
- OWASP API Security Top 10 2023: API9 Improper Inventory Management (checked 9 November 2026)