# Don't let your AI write your login.

> Move sign-in, sessions, roles and payment state out of code your AI wrote and onto servers built for it. What it covers, and what stays yours.

Page: https://www.buildbase.app/use-cases/secure-ai-built-apps

Sign-in, sessions, roles and who-paid-what run on our servers, not in code your AI wrote. Card details never touch your app.

**What it is:** BuildBase is a hosted SDK and console for React apps that runs sign-in, roles, billing and email for you.

Start free: https://console.buildbase.app

For your coding agent: Replace the hand-written login and role checks in this app with BuildBase hosted sign-in and roles. Ask me before moving existing users. Start with: npx skills add buildbase-app/claude-skill

## Who looks after what

The whole list, so you know exactly what is still yours to check.

| Part of your app | Who looks after it |
| --- | --- |
| Sign-in, passwords and passkeys | BuildBase |
| Sessions and signed-in devices | BuildBase |
| Roles in each workspace | BuildBase, with the roles you define |
| Which plan a workspace has | BuildBase, from your Stripe |
| Card details | Stripe |
| Your database and its access rules | You |
| Your own API and its checks | You |

## Where AI-written apps leak

The risky code is the code that decides who someone is and what they may do. That is the code to stop writing.

| Without it | Already covered |
| --- | --- |
| Login logic written once and never reviewed | Hosted sign-in, maintained by us and updated through the SDK |
| Sessions that outlive a password change | Sessions revoked on the server, and sign out everywhere in one call |
| Admin checks that live in the browser | Roles set in the console and checked per workspace by BuildBase |
| A paid flag anyone can flip | Plan state kept on our servers, set from your Stripe and your console |
| Card numbers anywhere near your code | Stripe handles cards, so your app never sees them |

## The parts attackers try first, off your plate

- **Hosted sign-in.** Sign-in pages, resets and passkeys run on our servers, on your domain, so your AI never writes them. (Authentication: https://www.buildbase.app/auth)
- **Server-side sessions.** Signing out revokes the session on the server, and a user can sign out of every device at once. (Authentication: https://www.buildbase.app/auth)
- **Roles per workspace.** Roles are set in the console and checked per workspace, not kept in your page's state. (Access Control (RBAC): https://www.buildbase.app/permissions)
- **Teams kept apart.** Data, feature switches and settings belong to the workspace, so switching team switches everything BuildBase serves. (Multi-Tenant Workspaces: https://www.buildbase.app/workspaces)
- **Payment state on our side.** Which plan a workspace has comes from your Stripe, so a paid flag is not a field anyone can set. (Billing & Subscriptions: https://www.buildbase.app/billing)
- **Cards stay with Stripe.** Checkout runs on Stripe, so card numbers never reach your app or ours. (Billing & Subscriptions: https://www.buildbase.app/billing)

## Swap the risky parts first

1. **Install and run init.** Add the SDK and run init. It writes the auth routes and keeps the session in an httpOnly cookie, out of reach of page scripts.

```bash
npm install @buildbase/sdk && npx buildbase init --org-id <id>
```

2. **Move sign-in and role checks.** Replace the login screens and role checks your AI wrote with the SDK, so the server decides who sees what.

```tsx
import {
  WhenAuthenticated,
  WhenUnauthenticated,
  WhenPermission,
  Permission,
} from '@buildbase/sdk/react';

function Dashboard() {
  return (
    <>
      <WhenUnauthenticated>
        <LoginPage />
      </WhenUnauthenticated>

      <WhenAuthenticated>
        <MainApp />
        <WhenPermission permission={Permission.WORKSPACE_BILLING_MANAGE}>
          <BillingSettings />
        </WhenPermission>
      </WhenAuthenticated>
    </>
  );
}
```

3. **Bring your users across.** Import them with their passwords where the old hash can be checked, so nobody gets a reset email. Then review your own database rules.

```bash
npx buildbase import --from supabase users.json
```


## Writing these parts carefully yourself

Sign-in, roles, billing state and workspaces, built with an AI coding agent and reviewed, against having them here.

|  | Build it yourself | BuildBase |
| --- | --- | --- |
| Hours | 115 | 8 |
| Time | about 3.8 weeks | about 1.3 days |
| First year | $11,505 | $670 (Launch, paid yearly) |

Modules: Authentication, Access Control (RBAC), Billing & Subscriptions, Multi-Tenant Workspaces. At $60 an hour. Estimates for a senior developer working with an AI coding agent such as Claude Code or Cursor, tests included. Upkeep covers dependency upgrades, provider API changes, incidents and support. Not a quote. Last reviewed 17 November 2026. Calculator: https://www.buildbase.app/build-vs-buy

## Running in production

Running in production on six products today, all of them ours.

- [OnceBooks](https://www.oncebooks.com): Personalised children's books
- [PlugNode](https://plugnode.ai): Visual AI workflow builder
- [AgentCenter](https://www.agentcenter.cloud): Mission control for AI agents
- [Imejis](https://www.imejis.io): Template-based image generation API
- [RemoteWait](https://remotewait.com): Virtual queue system
- [LinkTracer](https://social-link-tracer.jagodana.com): Creator link analytics

## Sign-in on every plan

Start on the Free plan with 10,000 monthly active users. Paid plans start at $19 a month with a 7-day trial and no card.

| Plan | Monthly | Yearly | Monthly active users | Workspaces |
| --- | --- | --- | --- | --- |
| Free | $0 | $0 | 10,000 | 50 |
| Launch | $19 | $190 | 25,000 | 1,000 |
| Grow | $49 | $490 | 100,000 | 25,000 |
| Scale | $99 | $990 | 500,000 | 100,000 |

Paid plans start with a 7-day free trial, no credit card. Free stops at its allowance and never bills over. Enterprise: Custom, by conversation. Full pricing: https://www.buildbase.app/pricing

## Questions

### Does BuildBase make my whole app secure?

No, and nobody honest can promise that. BuildBase runs sign-in, sessions, roles, plan state and payments through Stripe. Your database, its access rules and your own API are still yours to check.

### My app uses Supabase. Are my tables safe now?

BuildBase does not touch your Supabase tables or their row-level security. Check those rules yourself. BuildBase takes sign-in, roles and billing off your plate, not your data.

### Where do card numbers go?

To Stripe only. Payments run on your own Stripe account through Stripe Checkout, and neither your app nor BuildBase stores card data.

### Does moving sign-in cost extra?

Sign-in is part of every plan, Free included. The Free plan is $0 for up to 10,000 monthly active users and never bills over. Paid plans start at $19 a month, with a 7-day trial and no card.

### When is moving sign-in not worth it yet?

If your app has no real users and holds nothing sensitive, fixing it later may be fine. Moving sign-in also does not secure your database: its access rules and keys stay your job either way.


## Read more

- [The vibe-coded app that got hacked, and the five checks](https://www.buildbase.app/blog/vibe-coded-app-hacked-incidents-and-five-checks)
- [What a coding agent builds for login and billing on its own](https://www.buildbase.app/blog/what-a-coding-agent-builds-when-nobody-tells-it-otherwise)
- [Teams, invites and admin vs member](https://www.buildbase.app/guides/teams-invites-and-roles-for-a-vibe-coded-app)
- [The vibe coder's launch checklist](https://www.buildbase.app/guides/vibe-coded-app-launch-checklist)
- [Fix login after publish](https://www.buildbase.app/use-cases/fix-login-after-publish)
- [AI-built apps](https://www.buildbase.app/use-cases/ai-built-apps)
- [Supabase apps](https://www.buildbase.app/use-cases/supabase-apps)
- [All use cases](https://www.buildbase.app/use-cases)
