Auth, rate limiting, input validation, and the defaults that stop the majority of real-world attacks.
Most API incidents do not require an especially clever attacker. They require one forgotten endpoint, one missing permission check, or one system assumption that stayed implicit for too long.
That is why API security should be designed as a set of defaults. Teams should have to opt out of protection intentionally, not remember to add it manually to every route under deadline pressure.
Authentication answers 'who is calling?'. Authorization answers 'what may they do?'. Teams still collapse those concerns constantly, then wonder why privileged data leaks through edge cases.
AuthN vs AuthZ
Authentication
Who are you?
Authorization
What can you do?
A valid token should only get a caller into the building. It should never silently grant access to every room inside it.
const account = await requireSession(request);
if (invoice.workspaceId !== account.workspaceId) {
throw new Response("Forbidden", { status: 403 });
}Rate limiting is often treated as an infrastructure concern, but the best rate limits reflect product behavior. A login endpoint, a report export, and a public search endpoint should not be protected the same way.
Rate limit tiers
3
Useful tiers: anonymous, user, system
429
Status code clients should expect
0
Endpoints that should be unlimited by accident
Input validation is not just a developer ergonomics improvement. It is one of the cheapest security controls you can ship. The closer invalid data is rejected to the system boundary, the smaller the blast radius becomes.
const schema = z.object({
email: z.string().email(),
role: z.enum(["owner", "member"]),
invite: z.boolean().default(false),
});
const payload = schema.parse(await request.json());Security posture is also about how fast your team can detect, scope, and respond to a problem. The time to decide what to log, who gets paged, and how to revoke access is before an incident, not during it.
Most breaches exploit a forgotten check, not a clever exploit.Archiom Engineering
Strong API security usually looks like consistent discipline rather than dramatic complexity.
Backend & architecture
Archiom's backend group โ multi-tenant SaaS, APIs, and the infrastructure decisions that quietly determine whether a product scales.
View all articlesKeep Reading
Work With Us
Archiom helps startups, agencies, and businesses build scalable digital products and business solutions.