flowingkhaosSign inBrowse the marketplace
New here? flowingkhaos is a build-in-public workshop. This is its weekly column.What this site is

Connect AI to Business Data Without Handing Over Your Passwords

Connect AI to Business Data Without Handing Over Your Passwords

Learn to connect AI to business data without passwords: one database you own, one API key tied to the data owner's account, checked on every request.

Connect AI to Business Data: One Door, Not Your Passwords

To connect AI to business data, give the agent one door, not your passwords: one database you own, and one API key checked on every request, with that key tied to the account that owns the data. That last part matters more than it sounds. A key that belongs to the wrong account does not throw an error. It just makes every owner-filtered answer come back empty.

Let’s get one thing straight: an agent holding your password is not an integration. It’s a liability with a chat box. It can do anything you can do, in every app you log into, and you cannot see where its access ends.

Most of what you will read on this starts from the other end. OpenAI’s own guide on how to connect AI usage to business value notes that “usage and spend tell part of the story,” and I agree. Counting how often a team opens ChatGPT tells you nothing about whether the agent ever touched a real invoice. The rest of the story starts with a duller question: where does your data live, and who holds the key to it?

My answer, for my own business, is one place. Every client, quote, invoice and booking I have sits in one database I own, and agents reach it through one door with one key. The clevrstart guide to a single source of truth covers putting your business data in one place. In my words: each piece of information kept once, and every tool reading it from there instead of keeping its own copy.

This column is the door I built, what it lets agents do today, and the one mistake that made every answer come back empty. Everything below comes from my own records. Where I did not measure something, I say so.

Why the Password Trap Is Worse Than It Looks

Here is the trap. You want an agent to send a quote or check a booking, so you hand it the login you use. It works on day one. Then you have an agent with your full access in every app, and no line between what it may read and what it may change.

I hit the quieter version of this problem first. Once my data sat in one database, agents could read it, but they could not act. Every route in my apps checked a browser session cookie, the small file your browser keeps after you log in. An agent has no browser and no cookie. So the choice was to give it a session, which is your password with extra steps, or to build it a door.

Large companies often build on the apps their people already log into. OpenAI’s guide AI in the Enterprise reports one team working on top of Gmail, where its automation platform pulls customer data into replies and actions such as updating accounts or opening support tickets. That works for a company with a security team watching every login. For a business of one, an agent that works through the same screens and the same login you do has nothing checking it at the edge, because there is no edge.

I went the other way. In the work behind this whole cluster of pages, the agent never held a password and never held a browser session. It held one key. That key reaches only the actions I wrapped for it, and every request carries it.

Is a key safer than a password? Only if it is checked every time and tied to one owner. Those two rules are the rest of this column.

One Database You Own: 483 Tables and Counting

A door needs a room behind it. Mine is one Postgres database I own. On 2026-08-06 I moved every client, quote, invoice, booking and article of my business into it.

I counted it on 2026-10-14. These are tables, not rows: a table is one list of one kind of thing, like clients or invoices, and a row is one item in that list. Business records and site content hold 483 tables. The content engine holds 47. The agents service holds 11. Bookings hold 6. Since 2026-08-18, one users table serves every app, so there is one list of who is allowed in.

Why does that matter to an agent? My own manual puts the reason in one line: one database “gives agents cross-service reads (plain SQL).” An agent can ask which quotes have no invoice yet with one query, because quotes and invoices sit side by side. With several apps, the same question means several logins and exports, glued together by hand. My column Why I put my whole business in one database explains the longer story of that move.

The big vendors are pointing at the same idea, at a different scale. OpenAI’s help page on using the Data plugin in ChatGPT Work and Codex lists the sources it connects to, like Snowflake, Databricks and Google BigQuery, and tells you to “tell Data which definition or source to use.” That is the same rule as mine in enterprise words: one set of definitions, read from one place.

The catch is the list itself. Those are data warehouses, large stores that a company fills from its other apps. If you run a small business, you probably do not have one, and you do not need one. You need your clients, quotes, invoices and bookings in one database you own, so that one query sees all of them.

One Door, Three Routes: SQL, Keyed HTTP, Then MCP

If you build one door, give it three routes, and keep them in this order. The order is the point.

The three doors, lightest first
  1. Rung 1SQL for readsPlain queries across every section, once the data sits in one database.
  2. Rung 2HTTP with keyThe default door for deterministic actions, checked on every request.
  3. Rung 3MCP lastOnly where the model must choose. Do not build it first.
Door Use it for The rule from my manual
SQL Reads across every section Once the data sits in one database, an agent reads across every section with plain queries
HTTP with an x-api-key header Deterministic actions “This is the default door.” The key resolves through the same session check every route already calls
MCP Calls where the model must choose “Only where the model must choose.” Deferred until curl usage shows which calls need it. “Do not build it first.”

The second route is the default door. A deterministic action is one with a fixed result, like “create this quote for this client.” The agent sends a normal web request with the key in a header, and my code checks the key the same way it checks a logged-in person. That meant “zero route changes” in my apps.

Most explainers draw it the other way round. Outlook India’s MCP Servers Explained draws “AI agent → MCP server → Local database” and calls MCP “an open standard introduced by Anthropic.” The diagram is fine. In my setup it is the third door, not the first. Coursera even teaches the pattern as a full course, Build AI Agents with Enterprise Databases, built on Cloud SQL, AlloyDB and Spanner. That is enterprise infrastructure, and it is not where I would start a one-person business.

The rule under all three routes: “A capability is a function, not a route.” Each action is a plain function. The route around it is a thin wrapper that reads the request, checks who sent it, and calls the function. Kommunicate’s guide to OpenAI function calling argues the same point from the model’s side: “the model itself never touches your database, your APIs, or your business logic.” The model asks. Your code acts.

Am I being too strict about MCP? Maybe. I’d still build the plain route first.

The Mistake That Made Every Answer Come Back Empty

I’ll be the first to admit my mistake was embarrassingly simple. I minted the key for the wrong account, and nothing complained. The queries just came back empty.

Here is what happened, from my records.

What I saw What caused it The fix
Every query filtered by owner came back empty, with no error A key minted for the “first user” picked a random old guest account Mint the key for the data owner’s id
A key stopped working after the login merge A key minted before 2026-08-18 for an old text id became dead Mint a new key for the current id

The reads that broke were the ones filtered by owner: show me the quotes that belong to this user. The key said “this user” was a guest account that owned nothing. So the agent asked a correct question, got a correct answer for the wrong person, and that answer was an empty list. No crash. No warning.

Digital Applied’s guide to stopping your AI agent from showing the wrong data describes this exact kind of failure: “no error, no crash,” just an empty screen. Some guides put the owner check inside the database itself, and I should be honest about where mine sits. My rule is “scope every read by user” in the wrapper, not inside the database. One door means one place to check, but it is still my code doing the checking. You can weigh which layer you trust.

Streamkap’s piece on why AI agents keep getting the wrong answer reports that most enterprise agent failures come from “missing business context and stale data,” and that “the fix is infrastructure, not prompts.” Streamkap sells a product that keeps data fresh, so read it with that in mind. On the main point, my record agrees. No prompt would have fixed a key minted for the wrong account.

Guardrails from the Enterprise World, Translated to a Business of One

The best list of guardrails I read came from Oracle. Its post Your AI Agent wants your data, part 2 sets out the rules in plain order: a least-privilege account (one that can do only what the task needs), “reviewed views,” “Cap and shape every result,” “Fail quietly,” a “sanitized, read-only copy,” approvals “for anything that changes data,” and “Query the log.” I agree with every one of them.

The problem is who the list is written for. It assumes a database administrator, someone whose job is to set up those accounts and views and to read those logs. You probably do not have one. You are the administrator, the salesperson and the person who answers the phone.

So I translate the list into rules a business of one can keep:

Oracle’s guardrail My matching rule
A sanitized, read-only copy, and approvals for changes Production data is not queried directly by the agent. It goes through the door, or a human runs the command
Fail quietly, and keep inputs in check The wrappers validate inputs and scope every read by user

Notice what is not in my column. Oracle says to keep and read a query log. My record has no claim about a query log, so I make none.

Where is the enterprise side heading? Sapirex’s piece on securely connecting AI agents to enterprise databases with managed MCP reports that Managed MCP Endpoints launched on AWS and Azure in May 2026, offering a governed and secure bridge between AI agents and internal enterprise systems. For a large company, that makes sense. For a business of five, I would not buy that layer first. My door needs no managed cloud service: one database, one key, and wrappers that check it.

Why Not Buy More Tools First, and What the Cluster Ran Through the Door

The usual answer to “how do I get AI into my business” is another subscription. I think that is backwards. Every new tool keeps its own copy of your clients, so every new tool is one more place the agent cannot see. My short version: fix where the data lives before you pay for anything that reads it.

Here is what runs through my door today. Every page and every column in the “Centralize your business data” cluster, this one included, was produced by an agent through the door, from 2026-10-14 to 2026-10-16. The agent started and answered editorial desk runs at /api/editorial/assignments. It read keyword rows at /api/keywords. It read the cluster map at /api/clusters. It made page pictures at /api/generate-images.

It did all of that with one key, the same kos-dashboard key that has served every surface since the login merge on 2026-08-18: the Business app, the content engine and bookings. The agent read that key from a local file on my machine. The file is never printed. My rule is simple: never paste or print a credential, not even masked. A masked key in a chat log is still a key in a chat log.

The large vendors see the same direction. OpenAI’s post on its Dell partnership for Codex reports that Codex agents now “gather context across tools, prepare reports, route product feedback, qualify leads, write follow-ups, and coordinate work across business systems,” and that “more than 4 million developers now use Codex every week.” Agents touching business systems is clearly where this goes. But the route in that post runs through hybrid and on-premises enterprise setups. A solo owner’s route is shorter: one database and one door.

What I’d Do This Week, and Where This Stops

If you want an agent working on your real business data, here is the order I would follow, taken from what I built:

  1. Put your data in one database you own. Clients, quotes, invoices and bookings, side by side, so one query sees all of them.
  2. Mint one key, for the account that owns the data. Then test it with a query you know should return something. An empty answer is the warning sign.
  3. Wrap each action as a plain function. The wrapper validates the input, scopes every read by user, then calls the function.
  4. Keep credentials out of chats. Never paste a key or a password into a conversation, and never print one, not even masked.
  5. Keep the agent off production. It goes through the door, or a human runs the command.
  6. Hold MCP back. Add it only when your plain requests show which calls need the model to choose.

If you build this yourself, two pages on this site come next. The workshop step Provision Neon, R2 and Better Auth lists its three services in its title, and the Fixes page comes after that.

Now the limits, plainly. I measured no time saved. I measured no money saved. I have no client result to show you, only my own business. I have no count of how many small businesses run this pattern, and I will not guess one. And no vendor in this column is the answer; they are context.

Am I being too strict? Maybe. I don’t know your setup. But I know that one database, one door and one key, minted for the right account, is the version I would build again.

Sources

Questions, answered

How do I connect AI to my business data without handing over passwords?
Give the agent one database you own and one API key tied to the account that owns the data, checked on every request. The agent holds a key, not your password or browser session, so its access stops at the actions you wrapped.
Why did my AI agent's database queries come back empty?
I minted the API key for the wrong account: a guest that owned no data. Owner-filtered queries returned empty lists with no error, because the key said 'this user' was an account with nothing. The fix was minting the key for the data owner's id.
Should I use MCP to connect AI agents to my database?
Hold MCP back until last. Build SQL reads and HTTP with an API key first, and add MCP only when your plain requests show which calls actually need the model to choose.
How many routes should the agent's data door have?
Three, in order: SQL for reads across every section once the data sits in one database, HTTP with an x-api-key header for deterministic actions, and MCP last, only where the model must choose.
Is one API key safe for an AI agent?
Only if it is checked every time and tied to one owner. A key minted for the wrong account does not throw an error. Every owner-filtered answer just comes back empty.

Keep reading

The column · weekly · free

The next piece, the morning it is published.

One written column a week. The email service holds the list.

The columns, fixes and workshops continue in the community: SEO, AI, and making money with code.

Join on Whop

Luke Sidney writes and builds everything here, alone, in the open. lukesidney.me