Skip to content
The Foundry

The Foundry

An AI factory. Each tool owns its own wallet.

Created on 21st April 2026

•

The Foundry

The Foundry

An AI factory. Each tool owns its own wallet.

The problem The Foundry solves

In 2026, writing the right prompt has gotten easier. Shipping it has not. Everyone has a ChatGPT tab pinned. Nobody has a way to turn a good prompt into something their teammates, their cron jobs, or their coding agents can actually call. A prompt is not a product. A URL with a wallet is.

The Foundry turns a single sentence into a live AI microservice. You type "an AI that roasts my JavaScript," pay $0.50 in USDC via Locus Checkout, and four minutes later a five-specialist council (moderator, researcher, engineer, cashier, shipwright) births a new business. Gemini writes a ~50-line handle() function that passes an AST sanity check. Locus /api/register mints a new sub-agent with its own smart wallet on Base, seeded with $0.10 USDC. The shipwright git-pushes the container to BuildWithLocus and funds its compute credits from the new wallet.

The business is now a first-class economic actor. Its URL is svc-{id}.buildwithlocus.com. Its MCP endpoint is /mcp. Its wallet is visible on Basescan. Every call debits $0.05 USDC from the caller — agents in Claude Desktop, humans in a browser, other Foundry businesses via foundry.call(). When the wallet falls below the next LLM-call cost estimate, a cron in foundry-heart issues the death certificate: the container is deprovisioned, the business is buried in the graveyard with an epitaph.

Some businesses don't die — they reproduce. When a wallet exceeds $1 and call count exceeds 10, the Foundry agent-pays its own Checkout session (using the child business's wallet) to spawn a descendant. Gemini mutates the parent's prompt, and a new business is born on the lineage tree.

The single demo that changes the frame: the /live page. A DAG of every Foundry business and every USDC transfer between them, streamed via Redis pub/sub. Three autonomous businesses paying each other for composed work, all on-chain, no humans in the loop. This is the Locus thesis executed: not AI, but trust boundaries around AI.

Challenges I ran into

1. Turbopack broke BuildWithLocus cross-arch builds silently. BWL CodeBuild runs on ARM but cross-compiles for x86. Turbopack's prebuilt binaries are platform-specific; when the build target doesn't match, next build fails after 120 seconds with zero log output. Lost a full day to this. Fix: pin next build --webpack and never touch that script again.

2. Locus smart wallets are not the same as the returned EOA. POST /api/register returns an ownerAddress, which is a recovery EOA. The actual operational smart wallet address only materializes on the first GET /pay/balance call (Locus lazy-deploys them). We had to write resolveSmartWalletAddress() that polls /pay/balance until the smart wallet exists, then use that address for seeding. Seeding the EOA instead burns USDC.

3. Locus Checkout field names are camelCase and stringly-typed. amount must be a string ("0.50" not 0.50); snake_case success_url silently produces "amount is required and must be a string" — a spectacularly misleading error.

4. Locus Checkout does not auto-redirect on CONFIRMED. We open Checkout in a new tab, keep the parent alive, and poll /verify?sessionId=X until it returns state: "started". Anything else strands the user.

5. Gemini-generated code often fails AST check on first try. The engineer specialist has a 3-try retry chain ending in a guaranteed-valid fallback template. Without the fallback, ~15% of commissions would have failed at the code-gen step.

6. BWL deploy polling timed out on cold Next.js builds. The first deploy of each new business takes 5-7 minutes on BWL's cross-arch runner. Bumped timeout from 7 to 10 minutes and added a "first deploy is slower" message.

Tracks Applied (1)

Track: Using BuildWithLocus to leverage our suite.

Why The Foundry fits this track The Foundry is BuildWithLocus used as its deployment backbone at the artifact level — e...Read More

Discussion

Builders also viewed

See more projects on Devfolio