Authentication, resource authorization, token lifecycle, API boundaries, gateway enforcement, webhooks, CORS, and AI-agent threats.
A versioned HTTP API baseline with tests and primary sources.
Credential transport, rotation, token validation, and obsolete OAuth flows. Covered by OWASP API2:2023.
Algorithm confusion, weak keys, cross-JWT confusion, and profile-specific claim failures.
Prompt injection via API, model endpoint abuse, token exfiltration through LLM responses.
Centralize shared controls at the gateway while keeping object and business authorization in the application.
The method you use to prove who's calling the API. Each has a different threat profile, operational cost, and appropriate use case. Most APIs use more than one mechanism depending on the caller type.
Static bearer API keys provide limited identity and lifecycle semantics compared with modern token or signed-request designs. Use them only with explicit transport, storage, scope, rotation, monitoring, and revocation controls.
HMAC request signing is a useful M2M option when both parties can protect a shared secret and agree on canonicalization. Add timestamp validation and duplicate detection for replay resistance; a timestamp alone is not sufficient.
mTLS plus workload identity is a strong option when the threat model requires mutual authentication or certificate-bound tokens and the deployment can operate PKI safely. Automated issuance, rotation, revocation, and workload identity are part of the control.
JWTs are common in API authentication and authorization, but safe validation depends on the exact token profile. These are concrete attacks and the validation rules that address them.
Algorithm-confusion defenses require more than signature success. Configure the expected token profile and algorithm set server-side, reject unsupported algorithms including none, use the correct key type, and test negative cases.
Library defaults vary. Configure the accepted token type, algorithms, issuer, audience, required claims, and clock-skew policy explicitly, then test rejection of a token from the wrong profile or audience.
Choose storage from the client type and threat model. Browser applications commonly use a backend-for-frontend or Secure, HttpOnly cookies with CSRF defenses. M2M services commonly use a protected in-memory cache. Avoid exposing bearer tokens to script-readable browser storage.
jku or x5u as an unrestricted fetch target.kid as ambiguous instead of selecting by array order.kid, perform a bounded refresh with request coalescing and cooldown. A miss must not create an attacker-controlled fetch loop.kid, zero usable keys, malformed JSON, timeout, concurrency, cooldown, and recovery.JWKS handling is a state machine, not a one-time signature lookup. Document which responses are authoritative and which are retrieval failures. Sources: RFC 8414, RFC 8725, and the FAPI 2.0 JWKS requirements.
jti claim does not revoke anything by itself. A resource server must consult an authoritative denylist or another active-state mechanism.Do not infer delegation merely because a service possesses a user's token. Preserve actor context and exchange for a token intended for the next resource. Source: RFC 8693.
Use the gateway for shared edge controls such as TLS policy, coarse token validation, request limits, and rate limiting. Restrict direct service access. Keep object, property, tenant, and business authorization in the application or its policy layer.
| Requirement | Evidence to Require |
|---|---|
| JWT verification | Negative tests for wrong issuer, audience, type, algorithm, signature, time, and required claims. |
| JWKS lifecycle | Rotation, duplicate and unknown kid, malformed refresh, cache, cooldown, and revocation-state tests. |
| mTLS / DPoP | Handshake or proof validation, token confirmation binding, replay behavior, failure telemetry, and key rotation. |
| Authorization boundary | Document which coarse checks run at the gateway and which object, property, tenant, and business checks remain in the service. |
| Resource controls | Per-principal and per-tenant rate, concurrency, request-size, decoded-size, timeout, and cost limits. |
| Logging and privacy | Correlated security events with credential, token, prompt, personal-data, and body redaction verified. |
| Bypass resistance | Network tests prove protected services are not directly reachable around the gateway. |
APIs cross trust boundaries in both directions. Validate what clients send, constrain where the service can connect, and treat upstream responses as untrusted input.
URL parsing alone is insufficient. Application validation and network egress restrictions must agree. Source: OWASP API7:2023.
Authentication of an upstream system does not make all of its data safe for every downstream use. Source: OWASP API10:2023.
A schema is both an interoperability contract and a security allowlist. Keep authorization checks separate because valid shape does not imply permitted access.
Rate limiting is both an availability control and a security control. Without it, a single caller can exhaust your service, enumerate your data, or run brute-force attacks. AI endpoints have additional exposure because inference is expensive and slow.
| Strategy | Burst Handling | Use Case |
|---|---|---|
| Fixed Window | Edge burst | Simple quotas. Easy to implement. Vulnerable to burst at window boundary. |
| Sliding Window | Good | More accurate than fixed. Good for general API rate limiting. |
| Token Bucket | Allows burst | Allow controlled burst with long-term average limit. Good for variable-load APIs. |
| Leaky Bucket | No burst | Smooth output rate. Good for protecting slow downstream services. |
Request-count limits alone can miss large differences in inference cost. Combine them with bounds on input and output tokens, concurrency, execution time, tool calls, and spend where those dimensions apply.
Webhooks reverse the API call direction — a third-party calls your endpoint. That means you have no control over the caller at the network level. Verification happens at the payload level.
A webhook receiver needs a provider-defined authenticity and integrity check, replay handling, durable acceptance, idempotent processing, and secret or key rotation. HMAC is common, but the exact signed bytes and header format are scheme-specific.
CORS is a browser-enforced policy. It does not protect your API from non-browser callers. Its purpose is to control which web origins can make cross-origin requests from a browser. Misconfiguration is extremely common and often has high impact.
Origin: null unless a documented sandboxed or local-origin use case requires it and has an independent authorization boundary.Vary: Origin so shared caches keep responses separate.Unvalidated origin reflection can expose credentialed responses to an attacker-controlled origin. Review framework behavior and cache handling. Use an explicit allowlist and emit Vary: Origin when the response header varies by request.
Standard API security controls are necessary but not sufficient for AI systems. These threats are specific to APIs that sit in front of or behind LLMs, agents, and ML inference endpoints.
Prompt injection has no parameterization boundary equivalent to prepared SQL statements. Manage it with capability scoping, no ambient authority, approval for consequential actions, provenance-aware handling of retrieved content, and output validation. Input filtering alone is not sufficient.
AI inference endpoints have a cost dimension that standard APIs don't. Standard request-count rate limiting is insufficient. You need token quotas, cost tracking, and anomaly detection on usage patterns. Treat inference budget management as a security control, not just a cost control.
Every call to an externally operated model is a potential third-party data transfer. Classify prompt and retrieval content, minimize it, confirm the approved purpose and contract, isolate tenants, and validate outputs. Private network connectivity does not settle data-use or retention questions.
The deterministic authorization layer, not the model, owns capability and approval decisions. Sources: OWASP LLM06:2025 and the OWASP Agentic Top 10 2026.
AI artifacts and retrieved content are executable influence even when they are not executable code. Sources: OWASP LLM03:2025, LLM04:2025, and LLM08:2025.
Every live API version remains part of the attack surface. Older versions become higher risk when fixes, authorization policies, inventory, monitoring, or gateway controls diverge from the current version.
Use this for design reviews, vendor assessments, and internal API audits. Click each item to mark it complete. Progress is not saved — copy this to your review document.
Use the documented header scheme. Scan logs for api_key= or token= in URL patterns.
Not committed, baked into images, or stored in plaintext configuration. Exposure through environment, process, diagnostic, and orchestration surfaces has been assessed.
alg:none rejected. An approved algorithm set is enforced for the token profile. Never select the verifier from an untrusted alg header alone.
Token type, algorithm, issuer, audience, time claims, and every profile-required claim are configured explicitly. Wrong token types and audiences are rejected.
Use an explicit list. Reject the null origin unless a documented use case and compensating controls require it.
Verify the exact signed bytes before acting. Where supplied, validate signed time and event identifiers; process idempotently.
Document exceptions. Apply per-client and per-operation controls; AI endpoints also bound tokens, concurrency, time, tool calls, and cost where applicable.
Scan cipher suite config. TLS 1.3 preferred where clients support it.
No shared user accounts for service-to-service calls. Use client credentials, workload identity, token exchange, or another reviewed non-user design as applicable.
Authentication, authorization, gateway, schema, monitoring, and abuse controls remain effective until the sunset date is enforced.
Access-token exposure, refresh-token rotation, introspection, revocation, cache behavior, and authorization-server availability are tested against the threat model.
Read-only keys cannot write. Per-endpoint scoping where the platform supports it.
Max request body size. Max URL length. Prevents payload flood and some injection attacks.
Record auth failures, policy denials, 4xx/5xx rates, and usage anomalies with sensitive fields redacted. Document intentionally unlogged traffic.
No stack traces, file paths, DB errors, or schema info in API error responses.
Model context can propagate into application, proxy, tracing, evaluation, or provider systems. Inject credentials only at the deterministic tool boundary.
Purpose, retention, training use, region, contract, tenant isolation, and necessary redaction or transformation are documented.
Apply schema, authorization, encoding, destination, and sensitive-data checks before displaying output, executing code, calling tools, or sending external messages.
Least privilege for agent API credentials. An agent that reads email should not write to the DB.
Private connectivity reduces network exposure but does not by itself settle provider processing, retention, training, region, or support access.
Cross-user, cross-tenant, nested-resource, bulk, export, and guessed-identifier tests fail closed even with a valid token and scope.
Mass assignment, confidential response properties, alternate methods, and administrative routes are tested with an ordinary principal.
Quotas, state transitions, idempotency, concurrency, replay, and distributed low-rate automation are tested.
Unknown and duplicate kid, zero usable keys, malformed/truncated response, timeout, concurrency, cooldown, rotation overlap, and recovery have explicit expected outcomes.
Revocation, introspection, denylist, gateway cache, application cache, and account-disable paths agree.
Explicit destinations, address-range rejection, redirect revalidation, DNS rebinding, metadata endpoints, size/time limits, and network egress policy are tested.
Status, media type, schema, size, redirects, timeouts, retries, and hostile content are validated before downstream use.
Remote HTTP MCP uses the pinned specification revision. Upstream API calls receive separate tokens intended for those resources.
Destructive, financial, privilege-changing, data-export, and external-communication actions cannot proceed on model output alone.
Poisoned content, malicious metadata, stale permissions, deleted sources, cross-tenant vector matches, and memory-write provenance are tested.