Skip to content
AI Systems Architect · Full-Stack & Native Engineer
About Contact
API security Essay 002 / Secure API design

The Art of Designing a Secure API

What a straw can teach us about moving data safely and reliably

A wrapped straw with a padlock carries glowing data from a glass to an API.
A secure API combines a clear contract, controlled access, and protection for the data it carries.

A straw has a clear purpose: move liquid from a cup to your mouth. Its shape, size, and material determine how comfortably it does that job. When it works well, you barely notice it.

An API creates a similar connection. The cup is a system holding information or providing a capability. The person drinking represents the consumer: an application, another service, a partner, or an AI agent. The straw gives that consumer a defined way to request what it needs.

The analogy also gives us a useful way to think about security. A wrapper helps keep a straw clean while it is handled and transported. A lid helps keep the drink from spilling. An API adds a similar layer of protection by returning only the information the caller needs and has permission to see. The connection needs protection, and so do the contents and the people using it.

An API gives the caller a contract for what they can request and how the system responds. The server checks who may act and decides which data to return. We’ll follow one order API from an allowed read to an interrupted submission, then use those outcomes to check it before release.

In this article

Start with a clear purpose and a predictable contract

API stands for Application Programming Interface. It defines how one piece of software can request information or an operation from another. APIs exist in operating systems and libraries as well as across networks. This article focuses on web APIs and the systems they connect.

Consider a customer checking an order. The application might send this request over HTTPS:

GET /v1/orders/ord_1042 HTTP/1.1
Host: api.example.test
Authorization: Bearer <access_token>
Accept: application/json

The address identifies the order, and GET asks for its details. The Authorization header carries a bearer token. Anyone holding a valid bearer token can use it within its scope, so treat it as a secret. The API validates that the token is intended for this service and checks whether the caller can read this order.

The owner receives 200 OK with a JSON body containing the fields they need and have permission to see.

{
  "id": "ord_1042",
  "status": "shipped",
  "tracking_available": true
}

The status code and headers tell the client what happened and how to interpret the body. The response indicates its format with Content-Type: application/json. Document these details as part of the API contract.

Pulling and pushing describe the intent. HTTP methods express particular operations: GET retrieves information; POST submits data for processing; PUT creates or replaces a resource at a target address; PATCH applies partial changes; and DELETE requests removal. A read operation should not unexpectedly charge a customer or change an order.

A good straw saves you from thinking about fluid mechanics. A good API saves its consumer from needing to understand every database, queue, and internal service behind it. The consumer still needs a clear explanation of the available operations, their limits, and the authority required to use them.

Wrap the straw and protect the journey

An unwrapped straw can be exposed before it reaches you. Its wrapper protects it during handling. For an API, the closest parallel is protecting the communication channel while information travels.

HTTPS uses Transport Layer Security, or TLS, to protect the confidentiality and integrity of traffic between connection endpoints. Proper certificate validation also helps the client establish that it is connected to the intended server. Ordinary HTTPS does not, by itself, establish which application user is making the request.

Keep that protection intact across the actual route. If a gateway or reverse proxy terminates TLS, it can read the decrypted request. The connection from that proxy to the backend is a separate connection that needs its own appropriate protection and verification. Encrypting both connections still leaves their terminating components able to read the data.

That distinction matters when a system includes a browser, gateway, application server, database, and external provider. Identify where encryption starts and ends, which components can see plaintext, and which credentials each component holds.

The wrapper protects the journey. It does not decide whether someone may drink from a particular cup, make a malicious request harmless, or prevent an authorized endpoint from exposing what it receives. Those responsibilities require additional controls.

Protect the journey. Encrypted data travels through a locked channel between a laptop and a server.

Encrypt each connection and verify its endpoints. A gateway that terminates TLS can read the request. View full-size illustration.

Knowing the drinker does not establish which cup they may use

This is where API security becomes more demanding than the straw analogy first suggests.

Authentication establishes who or what is calling. Authorization determines what that caller may do. A successful login is the beginning of a permission decision, not permission to access every record.

Now another signed-in customer asks for ord_1042. Their bearer token is valid, but they lack permission to read that order. This API returns 403 Forbidden with no order data. An API that conceals whether an order exists can choose 404 Not Found for that denial. Returning the order would be an object-level authorization failure. Check permission for the requested record on every request, even when order identifiers are hard to guess.

Design access around the operation, record, organization, and fields involved. A customer might read an order and change delivery instructions before shipment. A support employee might view internal notes. An accounting integration might create an invoice without having authority to issue a refund.

For software serving multiple companies, establish the caller's right to act for the selected company. A submitted company_id or tenant_id is input, not proof. Preserve the verified organization context through queries, caches, queues, exports, and background jobs. These are all places where one company's information could otherwise cross into another's workflow.

The policy should be precise enough to express this sentence:

This caller may perform this action on this record, for this organization, under these conditions.

Enforce it on the server across every relevant path. A button hidden in the interface cannot stop a caller from constructing the underlying request.

Check every permission. A verified identity passes a gate that opens one record cabinet while the other two stay locked.

Verify the caller and check their permission for the specific action, record, and organization. View full-size illustration.

Match the protection to the environment

A public API, a partner integration, and an internal service have different exposure and operational needs. The controls should reflect the sensitivity of the information, the consequences of misuse, and the trust boundaries involved.

Internal network location does not establish trust. Internal services can have stolen credentials, vulnerable dependencies, or compromised neighbors. NIST's zero-trust model explicitly rejects granting trust solely because an asset or account is inside a particular network. Services still need verified identities and appropriate authorization.

Cross-Origin Resource Sharing (CORS) controls when a browser lets a script read a response from a different origin. The browser checks permission before sending some cross-origin requests. Others can reach the server directly, so enforce access control at the API.

Protect cookie-authenticated changes against cross-site request forgery (CSRF). In CSRF, another site causes a signed-in browser to send an unintended request. Use established framework protections and appropriate cookie settings. Review cross-site scripting separately, since injected code can abuse a user’s session even when some cookie protections are enabled.

The right design gives each control a clear job. It should be possible to explain which threat a control addresses and where its protection ends.

Keep control over what enters and leaves

A protected connection can still carry something unsafe. The API needs rules for both incoming data and outgoing information.

Accept only the changes the caller may make

Imagine a customer updating an address while also submitting payment_status: "paid". Copying every supplied field into the database could let them change a fact they do not control.

Define writable fields explicitly. Keep trusted prices, ownership, permissions, and payment state under server control. Validate business meaning as well as data types: a numeric quantity can still be negative, excessive, or incompatible with the order's current state.

Return only the information the caller should receive

An API can expose confidential notes or other sensitive properties even when its interface does not display them. Once those properties reach the client, hiding them visually provides no protection.

Use explicit response models and field-level permissions. Give the caller the information needed for the task, rather than serializing the entire internal database object.

Keep data separate from executable instructions

SQL injection occurs when supplied data changes the structure of a database query. Bind values through parameterized queries, and use approved choices for query elements such as selectable column names. Input validation complements safe query construction; it does not replace it.

Treat vendor responses with the same care. Validate their structure, constrain their size, set timeouts, and control redirects. Familiarity with a provider does not establish that every response is safe to process or forward.

Control fetching and uploads

An endpoint that fetches a supplied URL can be abused to contact unintended systems. This is server-side request forgery, or SSRF. Control permitted destinations, check resolved addresses and redirects, and restrict access to internal management services.

Uploaded files need their own controls: allowed types, actual-content checks, size limits, safe filenames, controlled storage, and scanning or isolated processing where appropriate. A filename or declared content type is not enough to establish what a file contains.

The aim is to enforce what the application understands and is prepared to handle at every boundary.

Design the opening and control the flow

A straw's diameter affects what can pass through it. An API's equivalent includes payload size, page size, query complexity, execution time, and concurrent work.

Length matters, too. An interaction can become slow when each request waits for another service or takes repeated trips across a network. Set a response-time budget, measure slower responses under realistic conditions, and choose dependency timeouts using observed latency. Include the time needed to establish connections and cross networks.

Rate limits control request frequency. Quotas can limit accumulated use. Both need to reflect the cost of the operation. One request that generates thousands of messages or a massive export can consume more resources than many inexpensive reads.

Apply meaningful limits to accounts, organizations, operations, and downstream spending. Bound uploads, batch sizes, result sets, and expensive processing. Decide how the system will reject or defer work when those limits are reached.

GraphQL requires particular attention to query complexity, depth, and batching, alongside permissions on objects and fields. Client flexibility should remain within a budget the server can enforce.

Persistent connections also need continuing control. For WebSockets, validate message contents, authorize requested actions, limit message size and frequency, and define how sessions end when access expires or is withdrawn. Accepting the initial connection should not create unlimited authority for everything sent afterward.

An integration that exceeds its request limit can receive 429 Too Many Requests. If the response includes Retry-After, such as Retry-After: 30, wait at least that long before making another eligible attempt. Keep the retry budget and the write’s idempotency rules in effect.

These are product decisions as well as infrastructure settings. Consider how limits affect a customer's normal work, how an integration learns that it has exceeded them, and what a responsible retry should look like.

Make interruptions safe

Smooth flow includes what happens when the connection stops working.

Go back to when the customer first submitted the order. The server saved it as ord_1042, but the response never reached the client. The client has no confirmation and may be tempted to submit it again.

Retry a write only when the API contract makes repetition safe or the client can establish that the first attempt had no effect. Set timeouts, cap retry attempts, and use backoff with jitter to spread retry attempts over time.

An idempotency mechanism lets the client repeat the same logical operation without repeating its business effect. In this order API, the client sends an idempotency key with the submission and reuses the same key and request on retry. The server commits the order and its idempotency record in one database transaction. If the response is lost after the commit, the retry returns the original ord_1042 and leaves one order for that submission. A new operation gets a new key.

Define the key’s scope, retention period, parameter-matching rules, and concurrent-request behavior. Document whether a retry returns a stored result or resumes unfinished work. Check authorization on every attempt, including a retry. These guarantees come from the API’s implementation and contract.

Business rules also need protection against racing requests. Two simultaneous requests must not both spend the same limited credit because they checked the balance before either updated it. Use database constraints, transactions with appropriate isolation or locking, or another suitable atomic operation.

For webhooks, verify each delivery using the provider’s signing scheme, including its required request body and freshness checks. Stripe signs each delivery attempt with a fresh timestamp, including a retry of an event you may already have processed. Track processed event IDs to recognize repeated deliveries. Make the business update safe to repeat and account for deliveries that arrive out of order.

QuickBooks Online: one invoice for one order

Suppose accounting needs an invoice for ord_1042. Your integration records a unique requestid before it sends the invoice creation request to the QuickBooks company. If the response is lost, retry with the same requestid and identical payload. QuickBooks can replay the original response without creating a second invoice. Save the returned invoice ID alongside the order ID, keep failed work available for controlled retries, and use filtered invoice queries to reconcile records. Intuit’s request ID guide

Plan for expiry. QuickBooks Online OAuth access tokens last 60 minutes. Refresh tokens expire after 100 days without a refresh and have a five-year maximum lifetime. Coordinate refreshes for each connection and store the latest token pair securely. If the authorization expires or the customer revokes access, pause that company’s jobs and prompt an authorized user to reconnect.

Budget requests and monthly usage. The REST API allows 500 requests per minute per company (the realm ID) and 10 per second per company and app, in sandbox and production. When you receive 429 Too Many Requests, distinguish a temporary rate limit from an exhausted monthly allowance. Core calls are unmetered for billing and still subject to rate limits. Builder includes 500,000 CorePlus calls per workspace per month. Many reads and queries count toward that allowance, so schedule and monitor reconciliation accordingly.

Choose the right straw for the job

A narrow cocktail straw and a wide milkshake straw solve different problems. Neither is the universal answer. API designs also need to fit the information, workload, and people using them.

The comparisons below are analogies, not performance or security rankings.

Straw analogy API approach What the design provides
A straight straw with familiar handling REST-style HTTP API Resource-oriented interaction through a consistent interface. REST is an architectural style, not another name for JSON.
A flexible straw that can reach selected parts GraphQL Clients select fields and related data from a defined schema. The server controls which selections are permitted.
A precisely fitted industrial connection gRPC Defined service methods and message types, commonly using Protocol Buffers, with generated client and server code.
A connection that stays open in both directions WebSocket Both sides can send messages over an established connection. Useful when the conversation must continue.
An ongoing feed toward the consumer Server-sent events The server sends an event stream to the client. Client changes use separate requests.
A specialized connection with a formal message format SOAP Structured XML messaging with an extensible framework. Security mechanisms must still be selected and implemented.

These approaches can coexist. A product might use REST-style endpoints for orders, webhooks for payment notifications, and WebSockets for live support. gRPC also supports streaming. Hypermedia, which lets responses guide clients through available links and actions, belongs within REST's architectural model.

A webhook is a different part of the design: an event causes a service to send an HTTP request to an endpoint you registered. It is one way to build an event-driven integration, and it can work alongside the API used to retrieve current records.

Choose based on actual behavior. GraphQL can reduce unwanted response data, yet one request may still trigger many backend queries. gRPC offers efficient communication patterns, but performance depends on the implementation and workload. Measure the connection you build.

Give every credential a purpose and an end

A shared credential with broad access makes every connected system depend on the same secret. If it leaks through code, logs, or configuration, both investigation and containment become harder.

Give each integration an identifiable credential and a narrow purpose. Keep privileged service secrets out of distributed application code. Use an appropriate secrets-management system and define issuance, expiration, rotation, and revocation. Know who owns each credential and which services depend on it.

OAuth provides an authorization framework for delegated access. OpenID Connect adds an identity layer for authentication. A public OAuth client, such as a browser-only app or a native app, cannot keep a client secret. When it uses the authorization-code flow, it must use Proof Key for Code Exchange (PKCE). PKCE ties redemption of the authorization code to the flow that requested it. Follow the supported design of a maintained identity implementation.

If you use JSON Web Tokens, or JWTs, verify their cryptographic protection, issuer, audience, relevant time claims, allowed algorithms, and purpose. Decoding a token is not validation. An ID token and an API access token serve different purposes, and a signed token is not automatically encrypted.

Short token lifetimes reduce exposure, but immediate revocation needs an explicit design. Test what happens when an employee leaves, a device is lost, or an integration is compromised. Establish how quickly existing access must stop, including active sessions and refresh credentials.

Keep Google API keys scoped to one job

A Maps JavaScript key in a browser is visible to anyone who loads the page. Restrict it to the Maps JavaScript API and approved website referrers. Choose the corresponding application restriction for other clients, such as fixed egress IPs for a server, an Android package and signing certificate, or an iOS bundle ID. Pair client restrictions with an API allowlist. Review existing keys each time you enable a new service.

That review matters because a credential's reach can change after deployment. In 2026, researchers found that some older, unrestricted Google keys exposed in websites could also call Gemini after it was enabled in the same project. Google now rejects unrestricted standard keys for Gemini. The broader design rule is to separate public browser keys from keys used for server-side services.

Keep privileged keys on the server in a secrets manager, with separate credentials for testing and production. Keep them out of repositories and logs. Where the API supports it, use the official client or the x-goog-api-key header to keep secrets out of URLs and the histories and logs that record them. For private user data, use delegated OAuth where supported. For sensitive cloud workloads, prefer short-lived workload credentials and least-privilege service accounts.

Worked example of access-token expiry

For the accounting integration, suppose the authorization server issues a 15-minute access token for one organization and the permissions needed to work with invoices. The 15 minutes are an example policy. Choose and document a lifetime based on the integration’s risk and operational needs.

  1. Issue the token. The accounting service authenticates to the authorization server using its service credentials. The server returns expires_in of 900 seconds, so a token issued at 09:00 expires at 09:15. Store the service credentials on the server and use them for the client credentials flow.
  2. Handle expiry. The API checks token validity on each request. In this example, an expired bearer token receives 401 Unauthorized with WWW-Authenticate: Bearer error="invalid_token". An active integration can authenticate to the authorization server for a new access token. If the server denies replacement, surface the authentication failure and stop retrying.
  3. Revoke access early. If access ends before 09:15, the authorization server stops issuing replacements for that integration. The API checks revocation or the current grant so it can reject already issued tokens within its documented revocation target.

Choose a revocation time target for the accounting integration. In a test environment, measure the time from revoking access until every serving instance rejects new requests from that integration. Verify that active connections lose access within the agreed time and that future webhook deliveries stop. Document whether already queued work is canceled or allowed to complete, then check that it follows that policy.

Decide what remains protected if the connection is compromised

Identify what each failure can expose and which control still limits the damage.

  • Stolen integration credential. Whoever holds a valid credential can use the permissions granted to it. Scope the accounting integration to the invoice fields and actions it needs for one organization. Check the action and organization on each request.
  • Compromised application. A compromised service can expose data it has permission to read or decrypt. Limit each application identity to the data and actions it needs. For content that requires stronger privacy, consider keeping decryption keys with authorized devices. Work through the effects on server-side search, sharing, recovery, and automation before promising end-to-end protection.
  • Exposed storage. A copied database or backup can reveal whatever it holds in plaintext. Encryption at rest can protect the encrypted copy when the keys and decryption access stay outside what was exposed. Review logs, exports, backups, and analytics separately, and limit what they collect and retain.

A gateway can enforce shared controls. The application still checks business permissions for each record and action.

Design for the breach. A compromised server is shown alongside separate protected systems and a secured recovery vault.

Scoped credentials and separate trust boundaries help contain damage. Test how the system recovers. View full-size illustration.

Six API configurations to avoid

An offline review of 77 structured report files surfaced these themes. Credential exposure and token handling came up most often. The examples below use fictional services. Confirmation and current impact remain unverified in the reviewed material.

Bad API configuration Safer design
Privileged credentials in client code or logs. A browser bundle or diagnostic log contains a long-lived integration key. Keep privileged credentials server-side, scope them to one integration, redact them from logs, and revoke exposed keys promptly.
Checking login while skipping record permissions. An invoice API accepts a valid session and retrieves a record without checking the caller’s organization or authority over that invoice. Derive organization context from verified identity and grants. Check the action, record, and fields on every request.
Overly broad credentialed CORS. An account API lets unapproved websites read responses sent with a user’s credentials. Allowlist the exact trusted origins, enable credentials only where needed, and enforce authorization independently on the server.
Shared caching for private responses. A CDN applies a public caching rule to personalized account data. Bypass shared caching for personalized responses. Use Cache-Control: private when browser caching is appropriate or no-store when storage should be prevented.
Counting requests while leaving the work unbounded. An export API limits calls per minute, but one export can consume excessive time, memory, or downstream spend. Cap work per operation, including result size, execution time, concurrency, and cost.
Giving user-directed fetches broad network access. An API that retrieves external files can reach destinations beyond what the feature needs. Restrict the fetcher to approved destinations and give it only the outbound network access it requires.

Apply the same boundaries to AI agents

An AI agent that can call an API can do more than generate text. It can change records, retrieve private information, send messages, or initiate transactions.

Documents, messages, and API responses can contain instructions intended to manipulate the agent. Enforce its tool permissions in an execution layer outside the model. Natural-language instructions are not a substitute for an authorization check.

An order-support agent might be permitted to read assigned orders and draft replies. Changing a payment destination or approving a large refund would require a separate authorization step tied to that exact action and its parameters. Give approvals a limited lifetime and prevent inappropriate reuse.

An agent with read access can still disclose order data through a reply or another tool. Limit the fields that can enter the model, then have the execution layer check the destination and permitted fields before sending a reply or passing data to another service. Apply those checks in the caller’s verified organization context.

The agent may propose what should happen. The surrounding system must determine whether that operation is allowed and record what actually executed.

Treat the API as a product people depend on

A comfortable straw matches the drink and the person using it. A well-designed API should match the consumer's workflow just as deliberately.

Use consistent names, understandable errors, examples that work, and clear limits. Document permission requirements, pagination, retries, idempotency, and failure behavior. OpenAPI can describe HTTP operations and schemas in a format that documentation and development tools can use. The running service still needs to honor that contract.

Decide which system owns each business fact. In an order-to-accounting workflow, the order system might own fulfillment status while accounting owns invoice status. Define permitted changes in each direction so two integrations do not repeatedly overwrite one another.

Plan how the contract will evolve. A field rename, new required input, altered permission rule, or changed error behavior can break a consumer. Give clients a migration path for incompatible changes, track deployed versions and their owners, and verify that retired endpoints and test environments are actually removed.

The quality of the interface becomes visible when another developer can use it correctly, understand a failure, and recover without guessing.

Watch the flow and keep the construction clean

Observability helps you distinguish a slow connection from an authorization failure, a broken dependency, or abuse. Logs record events, metrics reveal patterns, and traces help follow work across services.

Record enough context to connect a request to its caller, organization, target, and outcome. Monitor unexpected exports, repeated access failures, unusual costs, and growing backlogs. Keep passwords, raw tokens, and unnecessary sensitive payloads out of logs, and restrict access to the logs themselves.

Security also starts before the API is deployed. Protect source repositories and build systems, review dependencies, restrict deployment credentials, and verify the software being released. A compromised build process can place unsafe code behind an otherwise well-configured endpoint. Keep the delivery pipeline and its infrastructure maintained.

That is another lesson from the wrapper: protection during delivery works best when the item inside was constructed carefully and handled responsibly throughout its life.

Spot API key abuse before the bill arrives

  1. Check traffic by credential. In Google Cloud, open Monitoring → Metrics Explorer and chart serviceruntime.googleapis.com/api/request_count. Where the service exposes it, filter by credential_id using the key's ID and group requests by API. For Gemini, also check Google AI Studio → Dashboard → Usage. Look for unexpected APIs, sustained traffic above the usual range, or calls you can't account for after checking app logs, deployments, and retries. Google's API key monitoring guide
  2. Alert on traffic and spend separately. As a starting point, alert the on-call owner if traffic stays above three times the usual peak for five minutes. Tune that threshold to the integration, including legitimate batch jobs. In Cloud Billing → Reports, filter to the affected project, then group by service or SKU to see what drove the cost. Set spending alerts before the full budget is reached. Billing reports can lag. An alerts-only budget sends notifications. A spend cap can pause new usage for eligible services such as Gemini, with possible overages before enforcement. Google Cloud spend caps
  3. Contain confirmed exposure. Revoke the exposed key promptly, deploy a restricted replacement, and verify traffic on the old key stops. Record the project, key ID, time window, affected APIs, and charges. Keep the key value out of incident notes. If the credential could access private data, review that access as well. Retire unused keys and give each active key an owner who can rotate or revoke it.

When someone reports a security problem

Publish a security contact in your integration docs and provide a private channel for supporting evidence. Ask for the affected workflow, approximate time and time zone, request ID if available, and what the reporter expected and observed. Ask them to omit access tokens and customer records from the initial report.

Suppose a partner reports receiving fields from ord_1042 beyond its permissions. Open a case, assign an owner, and record the report as a concern pending review. If the issue is confirmed, document the fields, organizations, and operations affected. Use that impact to prioritize containment and the fix.

Before closing the case, record the fix and the build that contains it. Use synthetic data in an authorized test environment to verify the intended permission rules on the affected operations. Record the observed results and keep a regression check with the case. Keep the case open for any affected path that still needs verification.

Turn the design into a release you can defend

For a first implementation, start with one complete workflow and make its rules observable:

  1. Describe the job. Identify the consumer, the information it needs, and the actions it should be able to request.
  2. Map the boundaries. Trace where data, credentials, and authority pass between components. Include external providers and background jobs.
  3. Define the contract and permissions. Specify operations, inputs, outputs, ownership, company membership, and restricted fields.
  4. Implement the entire request path. Connect validation, authentication, authorization, business rules, durable storage, and explicit responses.
  5. Add failure handling. Define timeouts, safe retries, duplicate handling, resource limits, and recovery from interrupted work.
  6. Test misuse as well as normal use. Try another customer's identifier, another company's export, a protected field, an expired credential, and repeated consequential requests in an authorized test environment.
  7. Prepare to operate it. Establish ownership, monitoring, patching, rollback, credential revocation, and a tested recovery procedure.

These are proposed development steps, not a claim that a short checklist covers every architecture. A small service and a large distributed platform can follow the same discipline while choosing different infrastructure.

Ask the team to demonstrate three outcomes with the ord_1042 example before release.

  • The owner receives 200 OK with only the order fields they may see.
  • Another signed-in customer receives 403 Forbidden and no order data.
  • When the response is lost after the server commits the submission, retrying the same request with the same key returns ord_1042. Exactly one order exists for that submission.

Example release evidence for the denied read

Use synthetic data in an authorized test environment. Here is what to record for the ord_1042 denial.

  • Test identity. A signed-in test customer in the order’s organization who does not own ord_1042 and has no role that grants access to it.
  • Expected result. 403 Forbidden with no order fields and no changes to the record.
  • Observed result. Record the actual response and record state after the test runs.
  • Evidence to retain. Record the build version, test time, and request ID. Attach the sanitized server-side authorization decision so a reviewer can match it to the request without seeing tokens or order contents.

Run the same check after changes to authorization or order retrieval. Keep the result with the release evidence.

Also verify that searches and exports respect company boundaries, expensive operations stay within their limits, and compromised credentials can be disabled within the agreed time.

Then rehearse an interruption: restore data, identify unfinished work, and reconcile connected systems. A backup file and a recovery plan become much more useful once the team has proved it can use them.

Make the simplicity something people can trust

Designing an API means deciding what may flow, who may request it, how much work it can trigger, and what happens when the connection is interrupted or misused.

The straw should fit the job. Its wrapper should protect the journey. The system behind it should protect the contents and enforce the rules at every point where trust changes.

The highest compliment is that people can use the connection without thinking about its internal complexity. Earning that confidence takes deliberate work: a clear contract, controlled authority, predictable failures, and evidence that the protections hold.

Further reading

Keep reading

User-held device keys and end-to-end encryption separate private data from compromised servers, databases and infrastructure.
Privacy & Security Engineering

Assume everything is compromised.

If an attacker controls your backend, what can they actually read? Design decisions from ChatZeee and Family OS on content keys, device approval, recovery and trusted clients.

Read article ↗

Essay 002 / Secure API design

Make the simplicity something people can trust.

Discuss a role → All articles →