# Limitations

:::note
This page is generated from `docs/limitations.md` in the repository. Where the two disagree, the repository wins.
:::

Here is where we put the edges in daylight. What SuperToolkit does not do, and
why. Each entry is a decision or a measurement, not a shrug — and the ones that
are decisions say what they would cost to change.

Read this before trusting the broker with something that matters. You should
leave knowing which failures are loud, which are detectable, and which boundary
you must provide outside the broker.

---

## A client that ignores the proxy

**A client that ignores proxy configuration entirely goes around the broker, and
fails silently.** Whether that can be blocked depends on how the client is run:

- **Blocked:** a fronted MCP server run by `stk mcp serve` with `network: confined`,
  on Linux only. A server that declares `egress:` and no `network:` gets
  `confined` by default. It runs in its own network namespace with only
  loopback, so a direct connection has no route. If the namespace cannot be
  created, the server is not started. See
  [A fronted server's own network](#a-fronted-servers-own-network-blocked-or-only-detected).
- **Detected and stopped, not blocked:** a fronted server with `network: watched`
  (also Linux only). The first direct connection happens; the server is then
  stopped.
- **Only detectable from outside:** everything else. That covers every `stk run`
  child, a fronted server with `network: host`, a fronted server with no
  `egress:` (it defaults to `host`), and every fronted server on macOS, where
  `confined` and `watched` are refused at policy load and `network: host` must
  be said explicitly.

For a client in that last group, the bypass cannot be fixed inside the broker,
and nothing stops or records it. Such a client sends
the worthless placeholder to the provider, gets a plausible 401 back, and the
error reads as a credential problem rather than a routing one. The Phase 0
spikes found two: a Go program that builds its own `http.Transport` without
`ProxyFromEnvironment`, and Node's default `fetch` before `NODE_USE_ENV_PROXY`
existed.

Nothing in a proxy can detect a client that never speaks to it. What can be done
is detect it from outside, which is what `stk doctor --probe` is for:

```
$ stk doctor --probe
  ✓ curl               honoured    the provider received the substituted credential
  ✓ python3 urllib     honoured    the provider received the substituted credential
  ✓ node fetch         honoured    the provider received the substituted credential
  ✗ go net/http        refused-ca  it would not trust the broker's certificate
```

The probe drives a real request through a real broker at a hostname in the
`.invalid` TLD, which RFC 2606 guarantees will never resolve. A client that
honours the proxy resolves nothing — it asks the broker for the host by name. A
client that ignores the proxy must resolve it itself and cannot. A DNS failure
is therefore **proof** of a bypass, not a guess.

**Run the probe before trusting a new client.** A client it reports as
`bypassed` must not be brokered. The command exits non-zero on `bypassed` or
`failed`, and `--json` gives a machine-readable list.

That result gives you a hard stop before a real service is involved. An
`honoured` client can move on; a `bypassed` client needs a different boundary.

### The safe class, by contrast

A client that *rejects the broker's certificate* fails **loudly**: the request
does not happen. That is the right failure. On macOS, Go programs ignore
`SSL_CERT_FILE` and use the system keychain, so `gh` and similar need the CA
trusted there — `stk init` prints the command. Everywhere else `stk run` sets the
trust store and it just works.

---

## Measured, and recorded as facts

Full numbers and the machine they came from: [measurements.md](/measurements/).

- **Brokered mTLS does not work.** An upstream requiring a client certificate
  gets a 502 — loud, immediate, nothing sent. The broker holds no client
  certificate. Tunnel that host instead of brokering it, where its own
  certificate stays intact. Changing this means a client certificate per service
  in the store, which is a feature.
- **Bodies are transparent to at least 8 MB**, hashes matching end to end, with
  the credential still substituted. Nothing buffers a whole body, so the next
  limit is the provider's.
- **Overhead is about 79 µs at the median**, 459 µs at p99, against 56 µs
  direct. A cross-region round trip is 250 to 1,900 times that.

---

## Protocol limits

### WebSocket and other upgrades: refused, not broken

A credential is substituted on an HTTP request, and an upgraded connection
carries no further HTTP requests to substitute into. The broker returns **501**
with an explanation rather than appearing to succeed and then hanging, which is
what it used to do and reads as the provider's fault.

Tunnel the host instead: remove it from `services` and its traffic passes
through unopened. The connection works and carries whatever credential the
client itself holds — the trade this product otherwise exists to avoid.

### Non-HTTP protocols are out of scope

Postgres, MySQL, Redis, Kafka, SMTP, IMAP. A CONNECT proxy cannot inject into a
Postgres handshake; these need a protocol-aware local proxy per protocol, which
is a second product shape rather than a missing afternoon. A tunnelled host
passes them through untouched today, unbrokered.

### GraphQL APIs do not fit the catalogue

Every call is `POST /graphql` and the operation lives in the body, so a method
and a path cannot tell one capability from another. Policy could not name what
it was allowing and the audit ledger could not say what happened — which is
worse than not supporting it. Linear was dropped from the launch catalogue for
exactly this, and a test
(`TestNoTwoCapabilitiesAreIndistinguishableOnTheWire`) now fails any entry with
that shape.

Supporting GraphQL means dispatching on the operation name inside the body,
which is a real design with real ambiguities (aliases, batched operations,
fragments). It is not hard; it is simply not done.

---

## Deliberately out of scope

Each of these is a product-shape decision. None is blocked; none is started.

| Not done | Why not |
|---|---|
| **Inbound webhooks** | Receiving and verifying provider events is half of what an integration platform does, and all of it is a new surface with a different security posture — a public listener instead of an outbound proxy |
| **Connectors as pinned binaries** | `connector-protocol/v1` is already specified. It earns its place when a service needs code we have to ship, which no service in the catalogue does |
| **Identity chaining** | ID-JAG and RFC 8693 against whichever issuer a deployment has. This is the step that makes it a platform rather than a utility, and the drafts are still moving — better to follow the RFC than predict it |
| **vsock transport** | For microsandboxes with no filesystem shared with the host. Needs a guest-side shim, because `curl` cannot speak AF_VSOCK. The net-rule path works today |
| **OAuth 1.0a** | Built for, then dropped. X is the only provider in the catalogue that offers it, recommends OAuth 2.0 instead, and does not support 1.0a for media upload at all — so it could not post an image. Nothing shipped needs it |

---

## The store key is only as good as the platform

**On Linux there is usually no OS keychain, so the key that encrypts your
credentials sits in a file beside the ciphertext.** Anything that can read one
can read the other, and the encryption then protects against a stolen disk
rather than against another process running as the same user.

`stk doctor` says so rather than hiding it:

```
! credential store key  file beside the ciphertext — anything that can read one
                        file can read the other; an OS keychain is not wired on
                        this platform
```

On macOS the key comes from the login keychain and this warning does not
appear. The difference matters most where it is least visible: a production
token on a server is less well protected than the same token on a laptop, which
is the opposite of what most people would assume.

What you can do today:

- `STK_PASSPHRASE` in the broker's environment takes precedence over the file,
  so a key held by your init system — systemd `LoadCredential`, a secrets
  manager, a prompt at start — never touches the disk.
- Run the broker as its own OS user with a `0700` home, which is the posture
  the design assumes anyway.
- Treat a VPS credential as narrower in scope than a laptop one: shorter-lived,
  fewer scopes, and revoked on suspicion rather than on proof.

What would close it properly is wiring a Linux keyring — libsecret or the
kernel keyring — which is a platform integration rather than a fix, and is not
done.

## Operational limits

- **`stk run`'s per-session loopback proxy is not authenticated.** Only the
  fixed proxy of `stk serve --proxy-listen` requires a proxy key. Any local
  process that finds a `stk run` session's port can use the routes that session
  allows, though it still receives no credential.

- **The audit ledger rotates at 8 MB, keeping one generation.** An unbounded
  audit log on a small VPS is an outage. If you need more history, ship
  `audit.log` somewhere before it rotates.
- **One client id per service, in the committed policy file.** SuperToolkit
  ships none: a shared client id would make every installation look like the
  same app to the provider. You register your own.
- **The OAuth redirect must be a loopback URL.** The broker listens for the
  redirect itself, so a callback pointing anywhere else never reaches the
  machine — and one reachable from the network would let anybody on it deliver
  a code there. `127.0.0.1` and `localhost` both work, on any port and path.
  The default is `http://127.0.0.1:7837/callback`; an app that is already
  registered with a different loopback callback names it under
  `oauth2.redirect_uri` rather than being edited to suit us.
- **A credential's rotation is written back before the access token is
  returned.** If that write fails, the connect fails loudly — the alternative is
  a lockout hours later, nowhere near its cause.
- **`stk handover` briefly puts the credential on the sealing machine.** The
  commands say so. The device grant and the web UI do not have that property, so
  prefer them when either is possible.

## Shared refresh ownership

On supported macOS and Linux hosts, token acquisition uses a stable OS-owned file
lock. Process death releases it; elapsed time does not prove an owner died. Cache
invalidation preserves lock files. If ownership or cache persistence is unavailable,
acquisition fails explicitly instead of racing another refresh or returning an
unpersisted access token. No additional refresh retries are introduced.

Stop older broker processes before updating a store to this lock format. Known
live old-format owners are refused, but concurrent old and new broker binaries
sharing one store are not a supported migration. Do not remove a live cache lock
file to bypass a refusal. Managed profiles must pin their broker version and
account for old owned processes during upgrade and recovery.

## The staging deployment

`deploy/staging/` runs the broker as user `stk` on the staging host, for a Salaam agent that
runs under its own uid. It fronts one service, `git-public` (`auth: none`), and Salaam's git is
pointed at it through `~/.gitconfig`. That is configuration, not confinement: the agent runs
commands as an ordinary user with network access, so `/usr/bin/git -c http.proxy= …` or any
other client that ignores the proxy goes straight out, unrecorded. The broker bounds and records
what goes *through* it. Enforcing that nothing goes around it needs egress filtering for the
agent's uid, which staging does not have yet.

Fronted MCP servers can be served directly (`stk mcp serve <server>`), each tool call decided and
audited, and a host outside policy is decided by address (`egress:`) rather than passed through:
staging declares `egress: public-only`, so nothing is tunnelled undecided. Its `fetch` server is
`network: confined`: it runs in its own network namespace with only loopback, so a direct
connection has no route. See the next section for what each mode costs.

## A fronted server's own network: blocked, or only detected

`stk mcp serve` starts the server as the caller, with the proxy in its environment. Whether a
server that ignores the proxy can go around it depends on `network:`:

- **`confined`** (the default for a server with `egress`): the server runs in its own user and
  network namespace with only a loopback interface; a shim relays to the broker over a Unix
  socket. A direct connection has no route: **blocked**. If the namespace cannot be created, the
  server is not started. On Ubuntu 24.04 and later, `kernel.apparmor_restrict_unprivileged_userns=1`
  refuses it unless an AppArmor profile grants `userns` to the stk binary — an operator decision,
  not something stk installs. DNS lookups may still work through a resolver's Unix socket
  (nss-resolve); connections cannot.
- **`watched`**: the server's sockets (and its descendants') are polled every 50 ms from
  `/proc`. A TCP connection, or non-DNS UDP, to anything but the broker is **detected**: recorded
  in the audit as `netwatch:direct` with the address, and the server is stopped; every later call
  fails. It is not prevented — the first connection happens, and one that opens and closes
  between two polls is not seen.
- **`host`**: configured, not confined — the same posture as any `stk run` child.

**Measured: Go clients never proxy loopback.** Go's `ProxyFromEnvironment` skips the proxy for
`localhost` and loopback addresses, so a Go-based server fetching `http://127.0.0.1/…`, or
following a redirect there, goes direct and the broker never sees it. A test keeps this
(`TestMCPServeLoopbackBypassByAGoClientIsCaughtWhenWatched`): watched catches and stops it; only
confined prevents it. Python's httpx (used by `mcp-server-fetch`) does proxy loopback.

## Egress decisions

- **Ports are not rules.** An allowed address is allowed on any port.
- **Only `methods:` opens a tunnel.** An egress without `methods` decides by address and passes
  the tunnel through unopened, so the method and path of an HTTPS request are not seen or
  recorded, only the host and the address. With `methods` the tunnel is opened with the broker's
  CA, which the client must trust; one that does not fails loudly.
- **Approval-gated tools are refused by `stk mcp serve`**, with their rule id: holding a direct
  tool call open for a person is not built. The meta-tools (`stk mcp`) keep approval.
- **The tool-call hint is the server's own claim.** An unannotated tool defaults to approval, so
  is refused; a tool annotated read-only is allowed unless the policy says otherwise. Name each
  tool you allow in `capabilities:`.
- **With a daemon, the decision is the daemon's, but the caller runs the server.** An agent that
  can run commands can run the same server without stk. `stk mcp serve` bounds the server, not
  the agent.
