They miss runtime behaviour. An inventory tells you which scripts exist, but not whether they are reading form fields, watching session data, or sending information to unauthorised destinations. Effective control requires both composition visibility and execution-time enforcement.
Why This Matters for Security Teams
Client-side inventory answers a narrow question: what code is present in the browser or application bundle. Security teams also need to know what that code does after it loads, because dynamic behaviour can expose secrets, capture form inputs, alter payment flows, or redirect data to third parties. Without runtime visibility, an organisation can pass a composition review and still fail at protection in practice.
This is especially important for data-heavy websites, authentication journeys, and SaaS platforms that depend on third-party scripts, tags, and embedded components. A script may be approved at procurement time but later change behaviour through updates, tag-manager rules, or chained dependencies. Guidance from NIST SP 800-53 Rev 5 Security and Privacy Controls reinforces the need to control system behaviour, not just document assets.
Teams often focus on inventory because it is easier to evidence for audits, but that can create a false sense of security. The real exposure is usually in what the browser executes on behalf of users, not what appears in a software bill of materials. In practice, many security teams encounter exfiltration only after a customer complaint, payment anomaly, or privacy incident has already occurred, rather than through intentional runtime monitoring.
How It Works in Practice
Effective control combines static discovery with runtime enforcement. Static inventory identifies first-party and third-party scripts, tags, and dependencies. Runtime controls then observe network destinations, DOM access, event listeners, storage access, and changes to sensitive fields. That combination helps distinguish a benign analytics library from one that reads credentials or transmits personal data to an unexpected endpoint.
For web applications, practical controls often include:
- Maintaining an authoritative inventory of scripts, tags, and embedded resources.
- Monitoring browser behaviour for access to forms, cookies, local storage, and session tokens.
- Restricting outbound destinations with allowlists and content security policy enforcement.
- Reviewing change paths introduced by tag managers, feature flags, and dependency updates.
- Testing high-risk journeys such as login, checkout, and account recovery under realistic conditions.
For security engineering, the key question is whether a script is permitted to observe or transmit sensitive data, not merely whether it exists in the page source. This aligns with broader web application security practice and with OWASP Top 10 concerns around access control, data exposure, and misconfiguration. Runtime inspection is also useful when client-side code is delivered through third-party CDNs or marketing platforms, because those supply chains can change outside normal release gates.
Organisations should treat browser-side execution as a control surface. That means pairing code inventory with change management, content security policies, subresource integrity where feasible, and alerting on unexpected data flow. It also means defining which business teams can add scripts and what review is required before those scripts touch authenticated sessions or payment pages. These controls tend to break down when tag managers are used as an unmanaged deployment path because business users can introduce or modify behaviour outside engineering review.
Common Variations and Edge Cases
Tighter client-side control often increases operational overhead, requiring organisations to balance faster marketing and experimentation against stronger privacy and security assurance. Best practice is evolving because modern web stacks are highly dynamic, and there is no universal standard for every runtime monitoring scenario.
Single-page applications, micro-frontends, and heavily personalised sites complicate the picture because the executed code path can differ by user, region, or session state. In those environments, a static list of approved scripts may be technically correct but operationally incomplete. Current guidance suggests focusing on the highest-risk user journeys first, especially authentication, profile management, checkout, and any page that handles personal or payment data.
There is also an identity and trust intersection. If client-side code can read tokens, intercept one-time codes, or modify login flows, then the issue is no longer just web inventory but identity security and session protection. That is where browser-side monitoring complements NIST SP 800-63 Digital Identity Guidelines and broader privacy obligations such as GDPR. The practical lesson is that inventory remains necessary, but it is not sufficient when code can change behaviour after page load.
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 OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST AI RMF and NIST SP 800-63 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.DS-2 | Runtime monitoring protects data in use and detects unintended browser-side exposure. |
| OWASP Agentic AI Top 10 | Browser-executed code can behave like an agentic component when it acts on user data. | |
| NIST AI RMF | Inventory without runtime controls misses behavioural risk, a core AI governance pattern. | |
| NIST SP 800-63 | 6.1 | Client-side code can intercept authenticators, session data, and identity workflows. |
| OWASP Non-Human Identity Top 10 | Scripts and tokens in the browser can become unmanaged non-human identities or secrets. |
Treat high-trust scripts as execution-capable components and validate their actions at runtime.
Related resources from NHI Mgmt Group
- What breaks when a GitHub token is embedded in client-side code?
- When should organisations prioritise client-side code protection over simpler hardening measures?
- What breaks when organisations rely on manual review for client-side risk?
- What breaks when an iOS app ships secrets inside the client code?