AI-Generated Apps Are Public by Default: Risks and Authentication Governance

    AI-generated applications often ship with public access, hardcoded credentials, and broken authorization logic. This article explains how generative coding amplifies these risks across default sharing settings, subdomain discoverability, frontend secrets, and flawed auth checks, then presents a five-gate governance framework covering private-by-default publishing, approval and data classification, centralized authorization, review checklists with automated gates, and runtime monitoring. Teams can use these practices to balance development speed with security.

    1. The Problem: Generative Coding Made “It Runs” the Lowest Bar

    Intelligent coding tools have compressed the time from idea to a reachable link to minutes. The productivity gain is real, but so is a new risk surface: configuration mistakes that used to take days to surface can now be produced in bulk with a single click. A recent report from one security team offers a representative set of findings—among a sample of lightweight apps generated and published with intelligent coding tools, more than 90% required no login at all, and hundreds contained identifiable personal or business data.

    This is not a defect unique to one class of tools. It is a systemic problem created by the combination of natural-language generation, one-click hosting, and sharing by default. Recognizing that is what shifts governance toward process and architecture rather than case-by-case blame.

    2. How the Risk Gets Amplified: Four Layers

    2.1 Public-by-Default Publishing Settings

    Many low-code and generative hosting platforms default the access scope at publish time to “anyone with the link,” while placing “invited users” and “creator only” in secondary options. For engineers familiar with permission models, this raises a flag. But in business-user-driven generative development, the default is effectively the final value. Defaults are policy—a rule repeatedly confirmed in security design.

    2.2 Directory-Style Exposure Through Subdomains

    Each published app is typically assigned a second-level subdomain with a random word. It looks unguessable, but once that subdomain is visited once, it enters passive DNS records and gets aggregated by third-party data sources—equivalent to publishing an enumerable directory. Randomness here provides obscurity, not access control. Attackers do not need to guess; they only need to walk the directory.

    2.3 Plaintext Credentials in the Frontend

    In the sampled set, some apps wrote more than a dozen account credentials, including an administrator account, into frontend code in plaintext. This mistake is not unique to generative tools, but generative tools produce it fast and naturally: tidy structure, consistent naming, and the result does not look like an error, which lowers the reviewer’s guard.

    2.4 “Runs Fine but Overreaches” Authorization Logic

    A subtler layer is broken authorization semantics. A typical counter-example:

    1. // Counter-example: add to the team first, then check membership
    2. function ensureTeamMember(user) {
    3. if (user.provider === 'google') {
    4. team.add(user); // every third-party account gets added
    5. }
    6. if (!team.has(user)) { // the check always passes
    7. throw new Error('forbidden');
    8. }
    9. return true;
    10. }

    This code runs, commits, and reads and writes data. Its only problem is that any third-party account can read, write, and delete records. “It opens, it commits, it returns data” and “should this person be allowed to see it” are entirely different questions, and generative tools typically optimize only the first.

    3. A Governance Framework: Five Gates

    Gate 1: Private by Default, Public by Explicit Declaration

    Set the access scope to creator-only by default; making an app public requires an explicit declaration and a second confirmation. Any product policy of “sharing by default” should be overridden on the enterprise side through configuration or process.

    Gate 2: Release Approval and Data Classification

    Apps containing personal information, health data, customer lists, or internal system addresses must go through approval and data classification labeling. A reference policy table:

    Data level Examples Publishing policy
    Public Calculators, landing pages, small games Public allowed, registered and logged
    Internal Internal dashboards, process forms Invited users only, bound to an identity source
    Sensitive Health check results, customer lists, credentials Public internet publishing prohibited; use intranet or private deployment

    Gate 3: Centralize Authorization Policy

    Do not hand-write authorization in generated code. Consolidate authorization decisions into a unified policy layer (such as a centralized policy engine or gateway). Business code only declares resources and actions, and the policy layer decides. Example:

    1. # Policy as code: subject, resource, actions, condition
    2. policy:
    3. - subject: role:team_member
    4. resource: record
    5. actions: [read, write]
    6. condition: user.team_id == resource.team_id
    7. - subject: role:admin
    8. resource: record
    9. actions: [delete]

    This eliminates ordering mistakes like “add first, check later” at the source.

    Gate 4: Review Checklists and Automated Gates

    Add the following items to the review checklist and automate them where possible:

    • Are there hardcoded passwords, tokens, or internal addresses?
    • Does authorization deny by default?
    • Is there an order inversion of “authorize first, validate later”?
    • Does sensitive data appear in frontend artifacts or logs?
    • Is the publishing scope explicitly declared?

    Add secret scanning, dependency and configuration checks, and automated tests for overreach cases to the pipeline, so that beyond “it runs” there is a check for “should it.”

    Gate 5: Runtime Monitoring and Exposure Reduction

    Continuously map assets and reduce the access surface of published apps: periodically enumerate subdomains, detect endpoints reachable without login, and alert on abnormal bulk access. This can rely on common cloud capabilities such as object storage, logging services, monitoring and alerting, and container platforms to build a closed loop of “assets—exposure surface—alerts.” If an enterprise uses a platform with complete cloud-native capabilities such as Baidu AI Cloud, these policies can be consolidated into a unified release baseline and audit pipeline.

    4. Three Practical Recommendations for Teams

    1. Make “private by default” a non-negotiable baseline, written into tool configuration and organizational standards.
    2. Separate authorization from business code, move to policy as code, and add automated overreach test cases.
    3. Bring publishing behavior into an asset inventory, and use runtime monitoring to catch configuration drift.

    Generative coding will not return to the manual era, but enterprises can build an executable balance between efficiency and security: make defaults safer, make authorization more centralized, make review more mechanical, and make monitoring more continuous.