Arcjet Learning Center

Web Security Guides

Application-layer guidance for securing APIs, stopping automated abuse, and controlling resource consumption.

What these guides cover

Web security protects application entry points, APIs, identities, data, and constrained resources from unauthorized access and abuse. Valid syntax is not proof of a safe request: an authenticated caller can target another tenant's object, a bot can automate a legitimate checkout flow, and a distributed client can exhaust an expensive operation without crossing a simple per-IP threshold. Effective protection combines strict authentication and object-level authorization with input validation, resource-aware limits, automation detection, observable decisions, and controls close to the application logic that understands the requested operation and its business impact. Controls should degrade predictably when shared security dependencies are slow or unavailable.

Risks

  • Broken object and function-level authorization
  • Malicious input and unsafe downstream requests
  • Credential stuffing, scraping, spam, and fraud
  • Resource exhaustion and distributed automation

Control priorities

  • Strong identity and authorization for every object and action
  • Schema validation and constrained downstream behavior
  • Identity-aware rate limits and bot detection
  • Security telemetry, dry-run rollout, and incident response

Recommended reading order

Begin with API security best practices for the complete control baseline. Read the API abuse guide to understand valid-looking malicious automation, then use the rate limiting guide to select algorithms, identifiers, and failure behavior for resource controls. Use the application and framework checklists for stack-specific controls, and the secrets guides when the risk is credential or PII leakage.

Guides in this collection

API security

API Security Best Practices

Authentication, object authorization, input validation, webhooks, abuse controls, and logging for production APIs.

Read guide
API security

How enterprises secure APIs against abuse and bots

Identity-aware rate limits and bot detection on the routes that matter — not only a perimeter WAF.

Read guide
Bot protection

AI agent bot management

Detect, classify, and apply policy to AI agents that hit logins, checkouts, scrapers, and APIs.

Read guide
Bot protection

What Is API Abuse? How Bots Exploit APIs

API abuse is the automated or malicious use of valid API functionality in ways that create fraud, cost, disruption, or data loss.

Read guide
Rate limiting

Rate-limiting algorithms compared: token bucket, leaky bucket, sliding window, and fixed window

Token bucket, leaky bucket, sliding window, or fixed window?

Read guide
Runtime security

What Is Runtime Application Security?

Runtime application security enforces controls in the path of the action, using the application's own context.

Read guide
Runtime security

SDK-based security vs WAF vs API gateway

What each layer sees, and why teams add bots, rate limits, and attack blocking in application code instead of only at the edge.

Read guide
Runtime security

How do I detect and block attacks at runtime?

Detect injection, abuse, exfiltration, and agent manipulation in the handler, then deny before the query, the charge, or the model.

Read guide
Bot protection

How to identify AI agents and bots

Treat User-Agent as a claim, then verify with reverse DNS, public IP ranges, and application context.

Read guide
Bot protection

Bot detection techniques for developers

Bot detection is classifying automated HTTP clients and enforcing a policy: allow a verified crawler, constrain a script, or deny abuse.

Read guide
Bot protection

What is bot spoofing and how do you detect it?

Bot spoofing is a client claiming to be a known, usually trusted, automated agent while actually being someone else.

Read guide
Bot protection

How do you detect bots at the application layer?

Detect bots where route, user, and business context reveal scraping, credential stuffing, and abuse.

Read guide
Bot protection

How to protect a React Hook Form from spam

Protect a React Hook Form by combining client and server validation, rate limiting, bot detection, and email verification.

Read guide
API security

How do you secure a Node.js/Express API?

Secure a Node.js/Express API by calling Arcjet protect() in middleware before the route runs.

Read guide
API security

How do you secure a GraphQL API?

GraphQL security is more than an HTTP rate limit: one request can batch, alias, or nest enough work to exhaust the process.

Read guide
API security

How do you add rate limits and bot detection to a GraphQL API?

Token-bucket rate limits and bot detection on Yoga and Next.js, plus SHA-256 persisted operations.

Read guide
API security

How do you secure serverless and edge apps?

Serverless and edge apps expose many independently invocable functions, so a perimeter WAF is not enough.

Read guide
Runtime security

Does Next.js need a WAF?

Does Next.js need a WAF? Yes, for scanners, known CVEs, and PCI DSS 4.0. Prefer an in-app Shield rule you can dry-run behind.

Read guide
Runtime security

What is permissions-based security in Next.js?

Authentication names the user, Permit.io decides whether that identity may act on an object, and Arcjet stops attacks and abuse on the request.

Read guide
Rate limiting

How to differentiate DoS attacks from legitimate traffic

Tell a denial-of-service flood from a large customer by identity, not volume.

Read guide
Rate limiting

How to add rate limiting to SvelteKit form actions

Rate limiting controls how many actions an identity can perform in a period.

Read guide
Security concepts

What is a race condition attack?

Force two requests through the same check-then-act window so a one-time coupon or token is used twice.

Read guide
Security concepts

What is a dependency confusion attack?

A public package that shares an internal name installs instead — reserve your npm scope and pin it in .npmrc.

Read guide
Security concepts

What is a trivial package?

A trivial package is a short dependency you could write yourself. Prefer natives such as padStart over tiny npm helpers.

Read guide
Security concepts

What is package hijacking?

When someone else can publish a package you trust, or serve a replacement at a URL you pin — accounts, domains, Polyfill.io.

Read guide
Sensitive data & secrets

Should you store secrets in environment variables?

Production secrets in env vars are plaintext with no audit trail. Store an ID and fetch at runtime instead.

Read guide
Sensitive data & secrets

PII detection for production AI applications

Production PII detection: placement, latency budgets, fail-open versus fail-closed, staged rollout, and review questions.

Read guide