Blog

Is it safe to let an app your AI built reach the internet?

An internal tool rarely needs the whole internet, and open outbound access is how a bad dependency or an honest mistake sends your data somewhere else. What "default-deny" means in plain terms, what an allow-list looks like, and where the limits are.

Most conversations about app security are about who can get in. Sign-in, invitations, roles. That is the front door, and it matters.

There is a second door that gets less attention: what the app itself can reach. When an app runs on a server, it can usually connect to any address on the internet. Nobody decided that. It is just the default on most hosting, and for a tool your coding agent wrote in an afternoon, it is worth a second look.

This article explains that second door for people who don't configure networks for a living. We make Spryloom, and part of this article describes how we handle it, so read that part knowing who wrote it. The ideas apply wherever you run your app.

What "reaching the internet" means

Your app does two kinds of talking. People's browsers talk to it: that is inbound. And the app talks to other places: that is outbound. A tracker that posts to Slack, an expense tool that asks an AI model to read a receipt, a dashboard that pulls numbers from a spreadsheet. Each of those is the app opening a connection to somebody else's server.

Most internal tools need very little of this. A request log or a checklist reads and writes its own database, and that's all. Some need one or two outside services. Almost none need the whole internet.

What open outbound access lets go wrong

When an app can reach anywhere, three things can go wrong, and none of them need anyone to break in.

At run time

A dependency turns hostile

A taken-over package runs with your app's access.

  • Reads your database and API keys
  • Sends them to any server, quietly
At build time

An install script runs

Before the app even starts.

  • Reaches whatever the build machine can
By accident

The agent adds a service

A logging service, an analytics snippet, a pasted webhook.

  • Data leaves, and nobody approved it

Your agent's app depends on dozens or hundreds of open-source packages, written by people you will never meet. Most are fine. Every so often one is taken over or published with bad intent. Packages can also run scripts while they are being installed, on whatever machine builds the app. And agents add things "to help debug". Nothing malicious has to happen for the data to leave.

A fourth is about other people: an app that can reach anything can be used to send spam or mine cryptocurrency, which hosts spend a lot of effort catching after the fact.

The alternative: deny by default

The fix is old and simple. Instead of "the app may reach anything unless we block it", the rule is "the app may reach nothing unless we allow it". That's default-deny. The app gets a short list of places it may connect to, and every other connection is refused.

Two details make the difference between a real rule and a polite one:

  1. It is enforced outside the app. A rule the app's own code enforces can be switched off by the app's own code, including by a hostile dependency. The rule has to live on the machine the app runs on, where nothing inside the app can touch it.
  2. The list is visible. If the people using the app can see where their data may go, before they type anything into it, the list does its job twice: it stops surprises and it tells people what to expect.
Your app + packages its database the list slack.com some-server a webhook
The app reaches its own database. Anything else has to be on its list, and the list is checked outside the app.

How Spryloom does it

On Spryloom, every app runs in its own small virtual machine, and by default it reaches its own Postgres database and nothing else. No web, no mail servers, no other app, none of Spryloom's own systems. The rule is enforced by the host the app runs on, so nothing the app does, and nothing a package does, can switch it off. Other apps are further away still: each app is on a private network of its own, with no route between them.

When an app does need an outside service, your agent names it in the app's spryloom.yaml:

egress:
  - slack.com
  - api.openai.com
  1. The app's list. Everything else is refused.
  2. Slack's bot API, not a webhook.
  3. OpenAI, for AI processing.

Each host has to come from a fixed list: OpenAI, Anthropic, Google's Gemini API, Stripe, Slack, GitHub, Linear, Notion, Airtable, HubSpot, and Google Sheets through a service account. A host that isn't on the list is refused when you publish. If you need one that isn't there, write to hello@spryloom.com and say what it's for.

The declared hosts are listed on the app's label page, at /~label, in plain words such as "Sends data to OpenAI for AI processing", so a coworker can read where their data may go before typing anything in.

The key for each service goes in a secret, never in the code, the built image or a log line. Publish again after setting one. If the app tries to reach something it didn't declare, the refusal says what to do:

office-requests
spry secrets office-requests set SLACK_BOT_TOKEN=xoxb-...
# publish again so the app gets it
spry publish
# later, the app calls a host it didn't declare
403 Spryloom: this app does not declare api.stripe.com in egress.
Add it to spryloom.yaml and publish again.

Why webhooks are refused

Slack's incoming webhooks and Discord's webhooks look like the easy way to post a message. We refuse their hosts for one reason: anyone can create a webhook address, in an account they control. An app allowed to post to webhooks is an app that can post your team's data to a stranger's channel, and the address alone doesn't tell you whose channel it is.

For Slack, the app uses the bot API at slack.com instead, with a bot token someone at your company installs. The token belongs to your workspace, and you can revoke it there.

slack.comhooks.slack.comdiscord.com

The bot API is allowed. Webhook hosts are refused.

The other limits

  • HTTPS only, to names. Port 443, to the hosts declared. An address made of numbers instead of a name is refused.
  • Redirects count. If a service redirects to another host, that host has to be declared too.
  • 500 MB a day per app, sent and received. The owner is emailed at 80% and at the limit, and new connections are refused until midnight UTC. Posting messages and asking a model short questions is small traffic. Copying a whole database out to an allowed service is the kind of traffic the limit is there to stop.
  • At most 20 connections open at once per app.

Builds in their own sandbox

The install scripts from earlier run when your app is built, not when it runs. On Spryloom, the build happens in a sandbox of its own, on a network with no route out except to the npm and Yarn package registries, which it needs to download packages. The machine the build ran on is destroyed afterwards. An install script that goes looking for something to send has nowhere to send it, and once the app is running, the same packages are held to the app's own list.

What it doesn't do

We would rather you hear the limits from us.

  • One port is open, the one databases use. That is how an app reaches its own database and Spryloom's gateway. The rule is by port, not by address, so code written specifically to use that port could reach a server on it somewhere else. A package that phones home over the web the usual way gets nowhere. Somebody who deliberately writes an app to send data out through that one port can. It doesn't let one app reach another app's data, and it doesn't let a stranger reach yours.
  • An allowed service is allowed whoever's account it is. If an app declares slack.com and is given a bot token for a different Slack workspace, its messages go there. Spryloom can check where a connection goes, not whose account is on the other end. Keep the keys your app uses in accounts your company controls.
  • It doesn't judge what the app sends. If your app is written to send every record to an AI model, it will, as long as that model's API is declared. The list says where data may go. Deciding what goes there is still the app's job, and yours.
  • The list is short. Services where each company has its own address, such as a Jira or Zendesk site, and services that need a person to click "Allow", such as Gmail or Google Drive, aren't on it.

The question to ask, wherever you host

You don't need Spryloom to apply any of this. For any tool your agent built, ask which outside services it actually needs, and whether your host lets you say so and enforces it from outside the app. If the answer is "everything" or "I don't know", that is the door to look at next.

For the other door, who can open the app at all, see who should be able to open the app your agent built.

Start here

In Claude Code, add the plugin once:

/plugin marketplace add spryloom/claude-plugin
/plugin install spryloom@spryloom

The agent writes the egress list when the app needs an outside service, and tells you the spry secrets command for its key. Without the plugin, from the app's folder:

npx -y spryloom publish

Spryloom publishes apps and pages built with a coding agent behind sign-in, for the people you invite. This article was written by the people building it.

Get started free