You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 058a530
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(authz): align Runner, account, and MCP access checks (#1328)
* fix(authz): enforce runner, account, and MCP ownership boundaries
* fix(authz): keep market MCPs and predictable install IDs working
Cloning a shared role from a project the caller cannot write dropped
its market MCPs. Market entries carry no project settings, so install
them from the catalog in the target project instead.
Install IDs for market, custom and cloned MCPs are predictable. Any
signed-in user could create a personal MCP under such an ID and make
every later install or clone into that project fail with 409. When the
ID is held outside the destination, use an alternate ID keyed with the
session secret, so retries still find the same row.
Treat SSO as configured only when both the app token and login URL are
set, the same condition the login page uses, so an install with only
the app token keeps its browser setup step. Explain why a login listed
in AGENTFLOW_PLATFORM_ADMINS cannot self-register, and document it.
Co-Authored-By: Claude Code <noreply@anthropic.com>
* test(authz): cover import rollback and unshared role clones over HTTP
Co-Authored-By: Claude Code <noreply@anthropic.com>
* fix(mcp): keep alternate install IDs stable when the first one is taken
When the predictable install ID and its keyed alternate were both held by another user, every clone or custom install fell back to a random ID. A project then got a new copy of the cloned MCP on each clone, and a repeated custom install created a row instead of returning 409.
Try a fixed sequence of keyed alternates, and prefer a row the destination already holds under any candidate over a free one.
Co-Authored-By: Claude Code <noreply@anthropic.com>
---------
Co-authored-by: roberttwang <u_dc6754cd1ee5@users.noreply.local>
Co-authored-by: Claude Code <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo
6
6
7
7
### Platform
8
8
9
+
- Authorization boundaries for Runners, accounts and MCP servers are stricter. Runner re-registration renews a machine only for its current owner; a platform bootstrap token registers a new machine instead of adopting a user's. Browser setup and self-registration are limited to password installations, and login names listed in `AGENTFLOW_PLATFORM_ADMINS` must be created with the operator account command. Personal MCP writes are bound to the signed-in user. An MCP import is saved as a whole or not at all, so a payload with a forbidden entry or a repeated ID now fails, and a platform administrator can no longer import other users' personal MCPs. Cloning a role copies MCP servers only from projects the caller can write; market MCPs are installed from the catalog instead.
9
10
-**Upgrade action for personal execution machines.** Existing project conversations bound to a personal machine require a project grant before the next message can run. The machine owner can grant access in **Settings → Execution machines → Shared projects**, then resume the conversation on the same machine. [Upgrade instructions](docs/deployment.md#upgrading-existing-project-conversations)
10
11
-**Breaking:** the `local` sandbox type is removed and native sandboxes only carry environment variables. A native sandbox runs on whichever machine executes the work (a user's execution machine, a cloud runner or the platform host) with that machine's own toolchains; environment install scripts, `$PREFIX` and install PATH entries are gone, and settings such as `JAVA_HOME` go into the sandbox's environment variables. SOPs and conversation workspaces can use Docker or native sandboxes; the default sandbox is `generic-docker`, and `AGENTFLOW_LOCAL_SANDBOX` is removed. A local row that was not migrated reads as native; a run frozen with a local sandbox asks to be started again with a native one.
11
12
- Native SOP checkouts use a private repository cache on each execution machine. The platform or Runner refreshes the bare repository with the checkout's Git credentials and copies Git objects into the worktree. This reuses the network fetch and leaves each worktree and checkpoint independent. Docker sandboxes keep direct clones. Conversation workspaces start empty and the agent clones using the current speaker's credentials. Runner 0.12.0 supports cached SOP checkouts.
Pushing a `vX.Y.Z` tag on `main` runs the `release` workflow once the `platform` workflow has passed on that commit. The tagged `compose.yaml` must already pin `loopforge:X.Y.Z`. It publishes `ghcr.io/<owner>/loopforge` as `X.Y.Z`, `X.Y`, `latest` and `sha-<commit>`, smoke-tests the pushed digest with `./start.sh`, and creates the GitHub Release. Forks publish under their own owner; set the GHCR package visibility/access for your team before distributing the image. Images are pulled only when missing by default; use an immutable tag/digest, or set `LOOPFORGE_PULL_POLICY=always` when updating a mutable tag. Existing `.env` values take precedence; change the saved image or URL there when updating an installation. Compose waits for the API's health check with a bounded timeout before installing schema extensions and seeds.
88
88
89
-
Open the platform and create the first account in the browser; it receives platform administration. Until that account exists the login page only offers this setup step.
89
+
On a password-only installation, open the platform and create the first account in the browser. If no administrator is configured, the login page offers this setup step and grants the account platform administration.
90
90
91
91
During initial setup, restrict the cloud security group or firewall to the operator's IP. Do not expose the first-account setup page to arbitrary Internet clients before the administrator account has been created.
92
92
@@ -97,6 +97,8 @@ Enterprise authentication gateways can sign users in by header with `AGENTFLOW_T
97
97
- Set `AGENTFLOW_IDENTITY_HEADER_SECRET` to a random value, and have the gateway send it in `X-AgentFlow-Gateway-Secret`. The gateway must overwrite, never pass through, the client's `Staffname`, `Staffid`, `x-staff-name` and `X-AgentFlow-Gateway-Secret` headers.
98
98
- Without a secret, any request carrying `X-Forwarded-For`, `Forwarded` or `X-Real-IP` is treated as a forwarded client, and its identity headers are ignored. This only protects proxies that add one of those headers: a same-host proxy that passes client headers through without adding them (for example nginx `proxy_pass` without `proxy_set_header X-Forwarded-For`), and any other process on the host, can still sign in as any user. Set the secret whenever header sign-in is on; the platform logs a warning at startup when it is missing.
99
99
100
+
Browser self-registration is available on password-only installations. SSO counts as configured only when both `AGENTFLOW_SSO_APP_TOKEN` and `AGENTFLOW_SSO_LOGIN_URL` are set. For gateway or SSO sign-in, provision administrators by setting `AGENTFLOW_PLATFORM_ADMINS` to their authenticated login names or by using the operator account command below. On a password installation that sets `AGENTFLOW_PLATFORM_ADMINS`, the browser offers no first-account setup and the listed login names cannot self-register; create those accounts with the operator account command.
101
+
100
102
### Project credentials
101
103
102
104
The installer and `./start.sh pull` configure `AGENTFLOW_PROJECT_CREDENTIAL_KEY` in `.env` when the setting is missing or blank. They preserve an existing nonempty setting. For a custom deployment, set it in the platform environment to a Base64-encoded 32-byte random key, which you can generate with `openssl rand -base64 32`. Share the same key across instances and keep it with database backups. After replacing the key, enter every value again on each existing credential to keep its bindings. Leaving values blank requires the previous ciphertext to be readable with the configured key.
@@ -217,7 +219,7 @@ The retention cleanup runs hourly in each process that runs the Bot workers and
217
219
218
220
## Accounts
219
221
220
-
The first account created in the browser becomes the platform administrator. After that, anyone who can reach the login page may sign up as a regular user while `AGENTFLOW_ALLOW_SIGNUP` is `true` (the default). Registered users can create requirements and run SOPs on your workers, so set `AGENTFLOW_ALLOW_SIGNUP=false` for any installation reachable from untrusted networks and create accounts explicitly instead.
222
+
On a password-only installation, the first browser account becomes the platform administrator when there is no existing password account or configured administrator. Regular users can sign up while `AGENTFLOW_ALLOW_SIGNUP` is `true` (the default). Registered users can create requirements and run SOPs on your workers, so set `AGENTFLOW_ALLOW_SIGNUP=false` for any installation reachable from untrusted networks and provision accounts explicitly.
221
223
222
224
Platform administrators create accounts under **Platform administration → Member accounts** (平台管理 → 成员账号): enter a login name and an initial password, optionally grant administration, and hand the password to the teammate. The same page lists every account and resets the password of a password account; accounts that sign in through GitHub or a gateway cannot be given a password there. New accounts join the welcome project, like self sign-ups.
0 commit comments