ADR 0012: Unified Login and Per-Person Credentials
Status: accepted, 2026-11-19 (P87; the owner's decisions in the unified login research, section 8). Slice S1 of the design; decisions 8 (slice S3) and 9 (slice S2) amended it on th
Status: accepted, 2026-11-19 (P87; the owner's decisions in the unified login research, section 8). Slice S1 of the design; decisions 8 (slice S3) and 9 (slice S2) amended it on the same day, and decision 10 (slice S4, built the same day) replaces decision 1. Decision 11 (slice S5, 2026-11-20) replaces what decisions 1, 6, 9 and 10 keep per person. Decision 12 (slice S6, 2026-11-20) replaces Orquelo's own browser and its live view (decision 9) with the agent-browser CLI.
Context
People ask the agent to log in to third-party CLIs and sites on their behalf, mostly from Feishu on a phone. Later runs then act as them. The Host has no way to keep a login's state across the wait or to keep a person's credentials apart from everyone else's. It also cannot take a code or a token from the person without it reaching the chat, the session and the model. The steps differ for every service, but the owner decided that no Host or plugin code may know a service (decision 7).
Decision
- Login skills.
SkillCard.Credential(plugin.CredentialSpec) comes from acredentialblock in a skill's front matter:service,title(a message key of the skill's plugin),home_env,env(variable → secret name),browser_profileandexpires_after. The Host validates the block and runs nothing from it. A service defined by two visible skills makes both invalid, and they are left out of the skill list.home_envandenvmay not name the Host's own variables (plugin.ReservedEnv). - Login state (
internal/host/login). The Host keeps two tables.loginshas a 30-minute deadline, and a person has at most 3 open logins; a new open for the same person and service cancels the earlier one.credentialsholds one row per person and service, with the stateactive,expiredorlogged_out. Each person's files for a service are kept instate/credentials/<person>/<service>/. Secrets go into the encrypted secret store. A person is the Host's user, so linked accounts share credentials. - Login tools. The Host adds
credential_open,sign_in_show,sign_in_askandcredential_closeto a runtime's tool list only when a valid login skill is visible to it. Likeask_user, each one acts for the run's trusted principal. In a group conversation each refuses withlogin.direct_onlyand records nothing. A tool plugin's nested calls never see them. - The
sign_inquestion.plugin.QuestionSignIncarries aplugin.SignInViewinQuestion.SignInandQuestionView.SignIn. It is either a live view, which eachsign_in_showupdates in place with a new version and the login's end settles ascompleted,failed,expiredorclosed, or a secret entry. Only the requester may answer it: a delegated approver and an admin may not. An answer never comes from chat text. It comes from a channel's own secret input (a card's password field, a masked prompt) throughTransportHost.Answer. The interaction records[secret], and the value is kept encrypted under the login. The model receives only the referencesecret:<login>/<n>. A login accepts at most 5 answers. - Secret references. A tool resolves a reference at call time through the optional
plugin.SecretResolver(host/resolve_secretfor process plugins), for examplelocalenv'sbashwithsecret_env. A reference is valid only while its login is open, and only for the same person and run. Every value resolved in a run is replaced by[secret]in that run's later tool results, before the ledger records them. - Credentials in calls. The new instance option
credentials: [service, …]gives that instanceCallContext.Credentials(plugin.Credential): for each listed service the person has active, the directory, thehome_envvariables set to it, and theenvvariables filled from the secret store. While a login is open, every tool call of its run also gets the login's directory. Credentials are added only to the call made to the instance that receives them, never to the context that guards, context providers or observers see.plugin.Env.CredentialRootnames the root, which file tools must refuse. - Commands. The trigger decisions
login,loginsandlogout(the chat trigger's/login <service>,/loginsand/logout <service>) are handled by the Host on every connection./loginstarts the service's login skill. The other two list and revoke the sender's own credentials. In groups all three are refused withlogin.direct_only. Operators useorquelo login list|revoke. Revoking deletes the row, the directory and the secrets, and every open, close, use and revocation is logged without the material. - MCP OAuth (S3, amends ADR 0004). A person's token for a remote MCP server is their credential
mcp:<server>of the instance; the broker keeps it throughlogin.OAuthStore, so it is listed, revoked and marked logged out like any login.{prefix}__sign_inshows asign_incard of kindlinkin the requester's direct chat, through the Host'sSignInLink, which manifest adapters use. A login completes when the person's credential of its service and source becomes active after it opened, as the OAuth callback makes it. In a group the tool is refused withlogin.direct_only, instead of asking in the requester's direct chat. - Connect page and browser (S2). The Host serves
/connect/{token}on the ADR 0004 listener. A link is random, kept only as a hash, entered once within 10 minutes, and only with the 6-digit code shown on the person's sign-in card; five wrong codes kill it. This is the owner's choice of 2026-11-19, instead of a channel login; it proves access to the person's direct chat. Its page session lasts as long as the login. It hosts the password of asign_in_ask(inputpassword), which answers the entry as the requester, and the live view ofsign_in_show(kindlive_view). Without a public URL both reportlogin.needs_public_url.plugin.CredentialgainsProfile, the browser profile inside the person's directory when the skill setsbrowser_profile, andLogin. A tool plugin may implementplugin.LiveViewer(LiveFrame,LiveInput; builtin plugins only for now) to show and drive a login's page. The builtinbrowserplugin offers generic page tools on Chrome, Chromium or Edge through its own small DevTools client;browser_filltakes asecret:reference.
- One login plugin (S4, the owner's decisions of 2026-11-19). The per-service login skills give way to one skill-only
loginplugin. Itsloginskill lists the services it knows in acredentialsfront-matter list, in place of decision 1's singlecredentialblock;per_site: truemakes one service per site,web:<site>, andcredential_openrefuses a site that is not public (login.not_public). A service opens only when an instance lists it incredentials, the operator's one list (login.not_enabled);webthere covers every site./login <words>starts theloginskill with the person's words, and the model drives every login by that skill, the owner's choice over a relay without the model. What a service needs beyond the generic steps is a note in that skill. A CLI is pointed at the person's folder by its own variables, not by a per-personHOME, which cost lark-cli its macOS keychain.
- One person (S5, the owner's decisions of 2026-11-20). Logins serve the agent's tools and data, CLIs and websites alike, and for now one person. A login lands where the CLI or the site keeps it anyway: in the CLI's own configuration in the Host user's home, and in the browser's one persistent profile. The Host stores nothing for it and adds nothing to later calls. This removes the per-person folders and the credential root,
CallContext.Credentialsand thecredentialsinstance option (decision 6), the browser profile per credential (decision 9), and the skill's credentials and per-site services (decisions 1 and 10). MCP sign-ins keep their tokens per person (decision 8). Only admins log in, and only in a direct chat (login.admins_only), since a login acts for everyone who uses the bot. The login skill is marked bymetadata.orquelo.login, and the model finds each service's login itself; a note in that skill is added only where it cannot. The browser runs headless and opens a window on the Host's screen on request, for picture checks and sliders. Several people need a sandbox per person (design, section 8).
- The browser is a CLI (S6, the owner's decisions of 2026-11-20). Orquelo does not build its own browser. Websites are reached through Vercel's agent-browser CLI, driven through the shell like any CLI, with its own usage guide (
agent-browser skills get core); theagent-browserplugin brings the CLI, which installs with it, and adds one skill for using it here. Every task uses one session and one persistent profile, which the plugin gives the shell (ADR 0001, decisions 8 and 9), so a site's login lands in that profile. A code fromsign_in_askis typed throughsecret_env, as for any CLI. A QR screenshot reaches the card through localenv'sread, which names an image's artifact. A picture check relaunches the same profile in a window on the Host's screen (--headed). The builtinbrowserplugin,LiveViewerand the connect page's live view are removed; a person away from the Host logs in with a QR code or a code. Every shell result is marked untrusted, since web pages now reach the model through it.
Consequences
- ◆New optional fields in
Question,QuestionView,SkillCard,CallContextandEnv, three decision actions, one optional host method, and two store tables. Old plugins ignore all of them. Process plugins gainhost/resolve_secret. - ◆A shell running as the Host's OS user can still read the credential files. Keeping them from the model fully needs a sandbox, which is out of scope.
- ◆Web pages reach the model as shell output, marked untrusted like every shell result (decision 12). The agent-browser CLI is a prerequisite of the Host, outside Orquelo's code and releases.