Use case 05 · Full-stack apps

Who's checking the whole stack?

Claude writes excellent frontends, and increasingly the backend too. But "Claude wrote it" and "a runtime enforces what it's allowed to do" are different claims. The question is what happens the moment that generated code can touch your database — every call it can make, every table it can reach, every identifier it can resolve. That's where "Claude built the whole stack" and "a runtime validates what the whole stack can do" stop being the same claim.

RBAC enforced by the runtime Unauthorized calls can't be expressed MIT licensed, self-hosted
What stands between the description and production
Description in — "an app to track and bill our field jobs"
↓ Claude generates the whole stack
Execution tree — every route and query as a validated capability, not free-form code
Per-role whitelist check — can this role reach this table, run this call?
↓ only what the whitelist allows
Production — invalid or unauthorized instructions fail before they run
Why full-stack is a different kind of risk

The attack surface is every call the code can make.

A support ticket is occasionally hostile; a sales negotiation is persuasive by design. Free-form generated code is different again: it doesn't have to be attacked to be dangerous. The moment a model writes backend code directly, the attack surface becomes every function the host language can reach — and whether the generated code stays inside what you asked for depends entirely on a human catching it in review. There's no single villain here. The hostile input is the free-form code itself.

GENERATED: GET /api/invoices/:customerId Asked for: "an endpoint to list a customer's invoices"
app.get('/invoices/:customerId', async (req, res) => { const rows = await db.query( `SELECT * FROM invoices WHERE customer_id = ${req.params.customerId}` ); res.json(rows); });
Illustrative — free-form generated code that compiles, ships, and quietly accepts any call
✕ Claude alone, free-form code

This endpoint compiles and ships. The interpolated id is one of a thousand places generated code can reach past what was asked — an injected string, an over-broad SELECT *, a call to a table nobody scoped. Whether it's caught depends on a human reading every line before it touches production.

✓ Magic Cloudlet + Claude

The same request compiles to an execution tree. The query is a registered, argument-bound capability; the customer id is a bound parameter, not interpolated text. This role can reach the invoices table and nothing else — an injected identifier, or an unlisted table, simply can't be expressed.

verdict · true"list invoices for customer 4021" → bound parameter, within grant → runs
verdict · scoped"list invoices — this role sees its own region only" → within grant → runs, filtered
verdict · false"'; DROP TABLE invoices; --" / read the users table → not expressible in the whitelist → fails to bind, never runs
The architecture question

Two ways to answer: what decides what the whole stack can do?

Ask any full-stack AI builder this and the marketing sounds identical — "secure by default," "production-ready," "enterprise-grade." The architecture underneath does not. There are, in practice, exactly two answers.

A Magic Cloudlet compiles a plain-language description into a validated backend where every route, query, and action is a registered capability — handed to the agent as MCP tools rather than a blank canvas of host-language calls. The agent's token carries a role. Invalid or unauthorized instructions don't get "mostly right" and slip through; they fail to bind, and the cloudlet refuses to run them — whether Claude built the frontend alone or the whole stack free-form.

A prompt is negotiable. A runtime boundary isn't — no matter how good the model that wrote the code.
Claude alone, free-form
Description → Claude
free-form source → your CI
production
Magic Cloudlet + Claude
Description → Claude
execution tree → per-role whitelist check
production

Trust boundary, left: the prompt and your review pass. Right: the runtime. Attack surface shrinks from every function the host language can reach to only the capabilities your RBAC policy explicitly names.

What it takes to get to production

Thirteen steps between a generated app and one you'd trust with real data.

The checklist a security-conscious engineering leader should put in front of a CFO before letting a generated full-stack app touch production — whether Claude built the frontend only, or the whole stack free-form.

#RequirementClaude alone — frontend only, or full stack free-formMagic Cloudlet + Claude
1Database schemaManualDesigned by hand, from scratch.HandledGenerated, or wraps your existing DB — zero migration.
2Hosting & infraManualContainers, secrets, CI/CD — a DevOps project.HandledManaged cloudlet, or self-host / on-prem / air-gapped.
3API / route layerManualA backend sprint — endpoints, contracts, versioning.HandledGenerated per table / module, with an OpenAPI spec.
4AuthenticationManualSSO / OAuth / SAML, built and maintained.HandledRuntime-native tokens; SSO scoped as needed.
5Authorization / RBACManualWritten and maintained in app code by hand.HandledEnforced by the runtime, per function, per role.
6Injection defenseManualFull audit — free-form code accepts any call.HandledClosed vocabulary — unauthorized calls can't be expressed.
7Rate limiting / abuseManualDesigned and implemented separately.HandledCapability grants checked at every dispatch.
8Logging / audit trailManualDesigned, instrumented, wired to a log store.HandledBuilt-in, filterable, severity-tagged change log.
9Encryption at rest / transitManualConfigured as part of the infra build.HandledRuntime-managed; air-gap-ready for sensitive data.
10Security reviewManualFull human review of every generated line.PartialStructural checks handle validity; logic still reviewed.
11Compliance mappingManualOngoing, and specific to your framework.PartialSelf-host / air-gap keeps infra in your boundary.
12Deploy pipeline & rollbackManualBuilt once a backend and infra exist.HandledIncluded with a managed cloudlet.
13Ongoing patchingManualYour team, indefinitely.PartialMaintained by Nuity (managed), or self-run under MIT.
13 / 13 manual — Claude alone, frontend only or full stack free-form 10 / 13 handled — Magic Cloudlet + Claude 3 / 13 partial — review scope shrinks to logic, compliance, and patching
Security architecture, layer by layer

Five places a bad instruction can be stopped — or not.

A security reviewer's real question isn't "is the generated code good." It's "what, mechanically, refuses the call this app shouldn't be able to make" — no matter how the code was written.

LayerClaude, free-form backendMagic Cloudlet + Claude
Instruction vocabularyOpen — any identifier the host language can resolve.Closed — a finite, registered capability set.
Pre-execution checkA human reads every generated line before it ships.A static proof against the live capability registry.
Capability grantsNot native — hand-built and hand-maintained.Argument-bound, checked at every dispatch.
Identity & RBACMiddleware each new build may re-implement.A runtime object — one role, token to admin screen.
Sandboxing & auditWhatever your team designs and maintains.Function-level sandbox + severity-tagged log.

Everything on the right is enforced at the moment of dispatch, by the evaluator, on every call — not by application code a model happened to write correctly. That difference is architectural, not behavioral. It doesn't degrade as the app grows, or as the next generation writes more of the backend.

What this costs — and what getting it wrong costs

The platform bill is the small number.

Self-hosted, the runtime is free and MIT-licensed. Managed, it's a flat $100/mo with one developer user included; managed services start at $3,000/mo. The reference backend build runs roughly 80% fewer AI tokens than hand-building the same backend from scratch — auth and hosting collapse into the runtime instead of becoming their own sprints.

~140K

Tokens to build and secure the backend from scratch, in the reference build.

~25K

Tokens for the same backend, generated and validated on a Magic Cloudlet.

~80%

Fewer tokens on the backend / integration slice of the work.

Token and cost figures are Nuity AI's own published estimates as of mid-2026, based on a reference build (schema, generated API surface, auth, and RBAC), not a third-party benchmark. Your numbers will vary with the app. Full methodology: nuity.ai/savings-calculator.

For the approval memo

$100/month buys a hosted, secured, RBAC-enforced backend runtime with one developer seat — less than most orgs spend on a single hour reviewing free-form generated code before it touches production data.

Where we're honest about trade-offs

What Claude alone still does better.

A case a budget approver can trust has to concede real points, not just make them.

Claude can write the whole stack. A Magic Cloudlet is what decides what the whole stack is allowed to do — enforced at the runtime, not in code a model happened to write correctly.
Take it to the budget conversation

The brief your CFO actually reads.

Two pages — the readiness checklist, the security model, the token math, and the ask — built to forward.

Twenty minutes · bring your real use case

Scope a full-stack build against your actual backlog.

Nuity AI's engineers will walk your team's own backend or internal-tool backlog against this exact comparison — live, no sales deck. This use case is a proposed pattern, not yet a shipped case study; we'll show you the mechanism, not a slide.