Web portals: overview
Warning
Web portals are in development (protocol version 1). The contract may still change, and some features are missing.
A web portal puts a web service that runs in one of your machines on the internet behind a
sign-in gate that AgentSpaces runs for you. People sign up and sign in on the portal’s own
address, https://<name>.agent-app.eu (on region lab: https://<name>.polder-vm.eu); only signed-in requests reach your service (or, if you allow it, anonymous
visitors too), besides the auth service’s own sign-up approval calls, and a
suspended machine resumes only when someone asks for it.
flowchart TD
client["Browser, API client or MCP client"]
edge["AgentSpaces edge"]
auth["Auth service"]
svc["Your service on 127.0.0.1:<port>, in the machine"]
client -- "https://<name>.agent-app.eu/…" --> edge
edge -- "sign-in paths (/_portal/, /oauth/, …)" --> auth
edge -- "token valid: token removed, x-agentspaces-identity added" --> svc
auth -. "sign-up approval" .-> svc
- Sign-up, sign-in, sessions and OAuth are not your service’s job. The auth service does them, on the portal’s address, under paths your service never sees.
- Anonymous requests never reach or resume the machine, unless you turn on
anonymous access. Browsers get a redirect to the sign-in page; API
calls get a
401. A sign-up on a portal whose machine approves sign-ups is the exception: the auth service resumes the machine and asks it (sign-up approval). - A suspended machine resumes for signed-in users only (and for sign-up approval). A signed-in browser that opens a suspended machine’s address sees a “Waking the app” page while the machine resumes (a few seconds), then lands where it was going; after signing in, the same happens without a click. API and MCP clients that are signed in resume it by calling. Anonymous visitors never resume it by visiting. Other services resume it by calling a webhook, a secret address of the portal.
- Every request that reaches your service carries
x-agentspaces-identity: who the user is, checked by the edge. The token itself never reaches you. - Your service can approve each sign-up: the auth service asks it, once, with the new user’s email.
Set one up
In the console, open a project and choose Web portals (organization owners and admins can create and change them; members see them). An agent can also put its own machine behind a portal and brand it, as you: see From the machine.
| Setting | Meaning |
|---|---|
| Name | For you; people signing in don’t see it yet. |
| Machine | The machine whose service the portal puts online. One portal per machine. |
| Guest port | The port your service listens on inside the machine (default 8080). |
| Sign-ups | Invite only (your service invites, see Invitations), The machine approves each sign-up (your service decides, see Sign-ups and approval) or Anyone may sign up; later on the portal’s Sign-in tab. |
The list shows each portal’s address, https://<name>.agent-app.eu, or its primary
custom domain once that has its certificate, its machine, sign-in
methods and extras; a row opens the portal’s own page. The same address is the one under
the page’s heading, behind Open, on the canvas, on the Web tab of the machine’s Manage dialog and in
space portals.
On the canvas the address is the Open site button (a globe) on the machine’s card: a click opens it in a new tab, and a right-click opens its menu:
- Open in new tab, as the click does;
- Open in built-in browser: the machine’s browser, as a panel of the screen;
- Configure: the portal’s own page.
On the portal’s page, its address has a copy
button, and each tab has what it is about, with its own Edit button: Overview
(name, machine, port), Domains (Custom domains), Sign-in,
Branding, Webhooks (Webhooks) and Developer MCP
(Developer MCP). The Overview also sums up the other tabs, each
line a link to its tab. Overview, Sign-in and Branding show a preview of the sign-in page
beside their settings.
The name is generated when you create the portal (quiet-harbor, sometimes with a number:
quiet-harbor-42); you can’t choose or change it yet. A name is never given to another
portal, also after yours is deleted.

A project can have several portals, each for its own machine. The address and the accounts
belong to the portal: moving it to another machine keeps both, and signed-in users and MCP
clients carry on without signing in again. The machine’s own address,
https://<machine-id>.<edge-domain>, redirects to the portal’s address for now.
Deleting a machine deletes the portal it is behind too, with its address, its custom domains and its settings; the dialog that asks names the portal. To keep a portal, move it to another machine first (Overview, Edit).
Pages that are files (a landing page, a front end) can be served by the portal itself, to anyone and while the machine is suspended, from a bucket: see A static site from a bucket.
A portal can also answer at domains of your own, such as app.example.com, with a
certificate AgentSpaces gets and renews: see Custom domains.
Developer MCP
The app’s own MCP server for your developers, at a path behind the portal that takes your project’s AgentSpaces API keys instead of the visitors’ sign-in: see Developer MCP.
Webhooks
A service that calls your app, such as GitLab or a payment provider, gets a webhook: a
secret address of the portal whose POST or PUT resumes a suspended machine and then
reaches your service, without anyone signing in: see Webhooks.
Sign-in methods
The Sign-in tab of a portal’s page chooses who may sign up (above) and how people sign in:
| Method | Choices |
|---|---|
| Anonymous access | Off by default. On: visitors without an account may use your service too (below); those who sign up are approved as before. |
| Email and password | On by default. Off: another way in must be on: a provider, Email me a link, or anonymous access. A portal with anonymous access alone has no sign-in at all: its page offers only Continue without an account. |
| AgentSpaces | On by default, for the members of your organization only. They sign in with their AgentSpaces account (below). |
| Off, on with the AgentSpaces client (nothing to set up; Google’s consent screen names AgentSpaces), or on with your own client (your app’s name on the consent screen). | |
| Microsoft | The same; your own client may be a single-tenant app: give its tenant (id or domain). |
| Email me a link | Off by default. On: the sign-in page mails a one-time link that signs in (or signs up). With email and password off, a passwordless portal. |
| Two-factor | Off, Optional or Required: an authenticator code after the first step (Two-factor sign-in). |
| Allowed email domains | Empty: any. Else only addresses of these domains may sign up (invites excepted). |
The same methods can be set from the command line: space portals sign-in <portal>
(reference) prints them, and with
options changes them; inside the machine behind the portal, space-env web-portal edit
does (From the machine) and space-env web-portal shows them:
space portals sign-in shop --agentspaces on --password off --google off --microsoft off --magic-link off
space-env web-portal edit --two-factor required --signup-domains example.com --signups openThe account is the email address: someone who signs in with Google or Microsoft lands in
the account of the address they verified there, also one made with a password. Only
verified addresses count: Google’s verified email, and for Microsoft a personal account or
a work account whose email domain its organization verified (the xms_edov claim). An
account whose address was never verified (a password account from before sign-ups were
confirmed by mail) is taken over by the first
verified sign-in to it: its password stops working and its sessions end, so nobody keeps an
account under someone else’s address. A new account is approved like a password sign-up.
The auth service stores no address and nothing of the provider’s account.
Your own client
Make an OAuth client in your Google Cloud project (type Web application) or an app registration in Microsoft Entra, and register this redirect URI, the same for every portal in the region; the Sign-in tab and its dialog show it with a copy button:
https://callback.agent-app.eu/_portal/oauth/callbackThen enter its client id and secret in the dialog. The secret goes to the region and is never shown again: the field says it is set; leave it empty to keep it.
For Microsoft, also add the optional claims email and xms_edov to the ID token
(Token configuration in the app registration); without xms_edov, only personal
Microsoft accounts can sign in.
Sign in with AgentSpaces
AgentSpaces sign-in is on by default: the sign-in page has Continue with AgentSpaces. It sends the browser to AgentSpaces, where the person signs in (with their second factor) if they haven’t yet, and back to your app at once if the portal lets them in. Nothing to set up: the portal’s client is made and kept by AgentSpaces. It is for the members of the organization: the owners, admins and members of the organization the portal belongs to. Anyone else sees a page saying they aren’t a member, and stays out. A new account is approved like any other sign-up (below). People outside your organization sign in with a password, a mailed link, Google or Microsoft.
Members signed in with AgentSpaces also get the Spacebar on a development site.
Your service gets the person’s name and email in the identity header on every request, updated at each AgentSpaces sign-in.
For a test or preview environment this is the easy way in: you and your team sign in with the accounts you already have, with no passwords or test users to make. Agents building an app behind a web portal use it for their test environments.
space portals sign-in shop --agentspaces on
space-env web-portal edit --agentspaces onThe account is the person’s AgentSpaces email address, like a Google sign-in: the same
account as a password or Google sign-in with that address. A member’s new account is
approved like any sign-up, and the approval request says "via": "agentspaces"
(Sign-ups and approval), so your service can let members in without a list.
An app for your team only: turn AgentSpaces on, Email and password, Google and Microsoft off, and set sign-ups to Anyone may sign up. Only members can sign in, and nobody else can make an account.
Membership is checked at each sign-in. Someone who leaves the organization keeps an
existing session as long as they keep using it (it ends after 14 days without use, see
Sessions); to cut them off at once, refuse their sub in your service.
Anonymous access
With Anonymous access on, a request without credentials passes to your service
without x-agentspaces-identity: that is how your service tells an anonymous visitor
from a signed-in user. Signed-in users still get their identity. An invalid or expired
token is not treated as anonymous: the browser is sent to sign in again.
Visiting never resumes a suspended machine: crawlers, link previews and prefetching can’t cost you
a resume. A browser gets the activate page instead, with the Activate button beside the
sign-in form; the sign-in page itself offers Continue without an account. Other
anonymous requests to a suspended machine get 503 with Retry-After. Anonymous activations
count towards your organization’s resume rate and are limited per visitor address.
For requests your own pages make (a checkout, a form), load the portal’s wake script: a visitor’s browser solves a short puzzle and its requests then resume the machine (visitors waking the machine).
Branding
The Branding tab of a portal’s page makes the sign-in pages look like your service:
| Setting | Shown as |
|---|---|
| Brand color | Buttons and links. The text on them turns black or white, whichever reads better. |
| Name | Above the sign-in form and in the page title (“Sign in · Name”). Up to 60 characters. |
| Description | Under the name. Up to 280 characters. |
| Logo | Beside the name, at the top of the card. PNG, SVG or WebP, up to 64 KB. |
| Terms of service, Privacy policy | Links under the card, opening in a new tab: https:// (or http://) addresses of your own pages. Empty: no link. From the machine: space-env web-portal edit --terms-url URL --privacy-url URL. |
| Languages | Which languages the pages speak (below). |
| Custom CSS | Loaded after ours, so your rules win. Up to 128 KB. |
All of it shows only on that portal’s address. The pages load nothing from other
hosts: in custom CSS, @import, web fonts and images from URLs are blocked; use data:
URLs. The elements have classes to aim at: brand-header, brand-logo, brand-name,
brand-description. The colors are the CSS variables --primary and
--primary-foreground.
Languages
The sign-in pages and the mails they send (confirmation, sign-in link, password reset) speak English, Dutch, German, French, Spanish, Danish, Portuguese and Swedish. In Branding on a portal’s page, Languages picks which ones the portal offers; all of them to start with, at least one. Default language is the one for a browser that asks for none of them: a Dutch site offering English and Dutch picks Dutch, so a German browser gets Dutch. Automatic (the start) is English, or the portal’s first language without English.
- A visitor gets their browser’s language when the portal offers it (its first choice the portal has, so a browser asking German, then English gets English), else the default language.
- Under the sign-in card, the visitor switches: a menu under the current language’s flag and name. The choice is remembered in that browser. With one language there is no switcher.
- Invitations speak the default language.
- From the machine:
space-env web-portal edit --languages en,nl --default-language nl(From the machine). - Your service learns each user’s language:
localein the identity header and in the approval call, and inspace-env web-portal users. Your brand name and description are your own text and show as you wrote them.
A site whose machine runs a checkout of your organization’s git is a development site: it gets the Spacebar, a bar that names the commit it runs and lets the people trying it report a problem straight into the repository.
Then make your service fit: Your service behind a portal is what it must listen on and what it receives, and the checklist sums it up.
Not available yet
| Missing | Until then |
|---|---|
| Public paths (a landing page) per path | Every path needs a signed-in user, or turn on anonymous access for the whole portal. Calls from other services use a webhook. |
| Choosing the name | The name is generated; you can’t change it. |
| Other providers (GitHub, Apple, your own OpenID provider) | Email and password, AgentSpaces, Google or Microsoft. |
| Signing out members who leave the organization | Refuse their sub in your service. |
| Changing a user’s email address | Invite the new address and disable the old account. |