Authenticate the caller
Use an authentication mechanism appropriate to the client and environment. Do not treat possession of an endpoint URL as authentication.
APIs connect users, applications, AI workflows and infrastructure. Secure design makes identity, authorization, validation, failure behavior, secrets, abuse controls and audit events explicit at that boundary.
Use an authentication mechanism appropriate to the client and environment. Do not treat possession of an endpoint URL as authentication.
Check whether the authenticated identity may perform the requested action on the specific resource, not only whether it is logged in.
Validate schemas, identifiers, ranges, file types and business rules before inputs reach sensitive logic or downstream systems.
Use rate limits, quotas, request-size limits and expensive-operation controls based on the real API and threat model.
Keep API keys, signing keys and service credentials out of client code and logs. Scope credentials to the smallest practical capability.
Return useful errors without exposing stack traces, secret values, internal paths or more system detail than the client needs.
Use idempotency or duplicate protection where repeated requests could create unwanted side effects.
Record authentication, authorization, administrative and high-impact events without copying unnecessary sensitive request bodies into logs.
This guidance is defensive architecture material. It is not a penetration test, vulnerability scan, compliance assessment or claim that an API is secure.
Share the clients, identities, sensitive operations, data, integrations and deployment boundary so security controls can be matched to the actual interface.