Security teams should treat the browser-facing web app and the API as separate trust boundaries. The web layer should focus on user experience and safe token handling, while the API should enforce authorization, data access rules, and auditability. Clear separation reduces accidental exposure, makes policy easier to govern, and lets teams modernize delivery without moving security decisions into the client.
Where the browser should end and the API should begin
Modern application design fails when teams blur the user interface, session handling, and enforcement logic into one control plane. The browser is a hostile execution environment, so anything that depends on client-side enforcement can be altered, replayed, or bypassed. The API, by contrast, is where access decisions, resource scoping, and recordable policy enforcement belong. NIST’s control guidance on access enforcement and auditability is a useful reference point for that split: NIST SP 800-53 Rev 5 Security and Privacy Controls. In practice, many teams discover the boundary only after a front-end change exposes an authorization shortcut that the API was never designed to reject.
How web and API responsibilities work in practice
The cleanest way to structure responsibilities is to treat the web layer as presentation and interaction logic, and the API layer as policy and data access logic. That means the browser-facing application may render views, manage navigation, and broker user actions, but it should not be trusted to decide whether a user can read, change, or delete data. Those decisions must be re-evaluated by the API on every request.
That split matters because modern apps often use the same backend service for multiple clients, such as browsers, mobile apps, partner integrations, and automation. If authorization lives in the web app, each client variation becomes a separate enforcement problem. If authorization lives in the API, the policy is centralised at the point where the data is actually exposed, which improves consistency and reviewability.
- The web layer should minimise token exposure, avoid storing secrets in script-accessible places when possible, and treat the client as an untrusted presentation tier.
- The API should validate identity context, enforce object-level and action-level authorisation, and return only the data required for the approved use case.
- Logging should be strongest at the API boundary, because that is where meaningful security events, denials, and data access records are most reliable.
- Security controls should be designed so that a client rewrite does not change who can access what.
From an architecture perspective, this also helps teams modernise incrementally. A well-bounded API can support multiple front ends without duplicating business rules, while the web layer can evolve independently for UX changes. The trade-off is that API design becomes more important: if the API is too generic, teams tend to recreate business logic in the client or in ad hoc middleware, which reintroduces inconsistency. The discipline is to keep the browser responsible for interaction and keep the API responsible for authoritative decisions. This guidance breaks down when teams use the browser as a privileged orchestration layer that performs server-side style trust decisions on behalf of the backend.
Boundary failures that create avoidable exposure
Tighter separation improves governance, but it also adds discipline overhead, because teams must explicitly decide where each rule lives and how it is tested. That trade-off becomes most visible in edge cases where application teams want faster delivery and are tempted to let the front end “own” a rule for convenience.
One common variation is the single-page application that talks directly to APIs. In that model, the browser still must not be trusted, even if it holds the session or access token. Another variation is the backend-for-frontend pattern, where a web-specific service aggregates upstream APIs. That can be useful, but it should translate user intent, not invent new trust decisions. There is no consensus that one front-end architecture is always safer than another; the consensus is that the enforcement point must remain server-side and auditable.
Edge cases also appear in partial migration projects. Teams often keep legacy authorisation in the monolith while introducing new APIs with different rules. That creates policy drift, where two paths to the same data behave differently. The practical fix is to define the API as the system of record for access decisions and then verify that legacy and modern paths produce equivalent enforcement outcomes. If that cannot be done consistently, the boundary is not really separated yet.
Risk and Threat Considerations
When web responsibilities and API responsibilities are merged, the main risk is broken trust boundaries. The browser can be manipulated, API calls can be replayed, and weak client-side checks can create direct object access, privilege bypass, or unintended data disclosure.
Failure mechanism: An attacker or careless internal change alters client-side logic, reuses a valid token, or targets an API route that was assumed to be protected by the front end. If the API does not independently enforce authorisation and data scoping, the request succeeds because the real control point is missing.
Impact: Sensitive records may be exposed, actions may be performed outside the user’s entitlement, and audit trails become less trustworthy because the enforcement decision is not anchored at the API boundary.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.AC-4 — Access Permissions Management | API responsibility centers on enforcing access decisions at the control point. |
| DE.CM-8 — Network Monitoring | API boundaries need visibility into suspicious requests and policy violations. | |
| Recommendation — Enforce least-privilege access rules at the API boundary and recheck them on every request. Monitor API traffic for abnormal access patterns and repeated authorisation failures. | ||
| CIS Controls v8 | 6 — Access Control Management | The question is about separating who enforces access from the browser tier. |
| Recommendation — Centralise access control in the API and remove security decisions from the client. | ||
| OWASP Agentic AI Top 10 | Application Trust Boundaries | Web-to-API trust boundaries are a core application security design concern. |
| Recommendation — Treat browser requests as untrusted and enforce decisions in server-side services. | ||
| MITRE ATT&CK | T1190 — Exploit Public-Facing Application | Exposed APIs and web apps are common attack surfaces when trust boundaries are weak. |
| Recommendation — Harden public-facing endpoints and hunt for abuse of exposed application logic. | ||
Practitioner Guidance
What to prioritise: Define the API as the authoritative enforcement point for access and data rules, then review every browser-side check as a usability aid rather than a security control. That is the fastest way to reduce accidental trust in client code.
What to verify: Test that a direct API call, an alternate client, or a modified browser request cannot bypass the same authorisation decision. If the answer changes by client type, the boundary is still leaking policy.
Common mistake: Teams often separate the codebases but not the responsibility, which leaves security logic duplicated across the web app, the API gateway, and the backend service. That pattern is harder to audit and usually fails under change.
Practitioner takeaway: A clean web/API split is not an aesthetic architecture choice; it is the difference between policy that can be enforced everywhere and policy that exists only where the user can tamper with it.
Related resources from NHI Mgmt Group
- How should security teams modernise SAML-based web apps for API-first architectures?
- How should healthcare security teams manage expanding API and web application attack surfaces?
- How should security teams adapt dynamic application security testing for API driven and web 3.0 environments?
- How should security teams use exploit validation to prioritise vulnerability remediation in web application and API environments?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 7, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org