Move secrets between users and computers without the model seeing them

A new personal env scope (paradigm user: one user's secret for one bot)
beats every other scope, reaches only that user's runs of that bot, and
is redacted like any secret. Bots take secrets in with request_secret,
which puts a [secret-request:ID] card in the chat: the user types the
value into a masked input there, never into a message, and the bot is
told only the key. Bots show secrets with capture_secret (a task's
computer tool that saves a file or a command's output straight to a
personal env, then redacts it from the rest of the run) and show_secret
(an env by key): both give a [secret:ID] chip whose Reveal and Copy fetch
the value on click, for its own user (personal) or a super admin
(anything else), logged by key. Values never go into messages, page
props, history, Copy chat or logs. Users manage their own secrets on
Settings > Secrets; the Environment page lists everyone's, remove only.
Deleting a bot or user removes its personal secrets, and SecretsNote
tells bots never to ask for or print secrets in chat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-25 16:51:32 +01:00
co-authored by Claude Opus 5.5
parent 83ff79b9c3
commit 69988e08fc
78 changed files with 2472 additions and 52 deletions
+53 -1
View File
@@ -31,7 +31,7 @@ import type { BUN_SQLITE_COBBLE_USERS_JOIN } from "./sql-joins";
import type { ImageInputToBase64FunctionReturn } from "@moduletrace/twui/utils/form/imageInputToBase64";
import type { HarnessKind } from "../dict/harness-dict";
import type { HarnessProviderKind } from "../dict/harness-provider-dict";
import type { EnvParadigm, KnownEnv } from "../dict/env-dict";
import type { EnvParadigm, KnownEnv, SecretRequestStatus } from "../dict/env-dict";
import type { ContainerStatus } from "../dict/computer-dict";
import type { BotFace, BotMessageReactionEmoji } from "../dict/bot-dict";
import type { HarnessCallSettings, TokenUsageSummary } from "../harness/usage/types";
@@ -601,6 +601,50 @@ export type PublicEnv = {
* Somewhere envs can be set: general, or one of the user's workspaces,
* computers or bots.
*/
/**
* A user's personal secret for one bot (an env with paradigm \`user\`), as
* settings pages list it: never its value.
*/
export type PersonalSecret = {
id: number;
key: string;
description: string;
bot_id: number;
bot_name: string;
user_id: number;
user_name: string;
updated_at: number;
};
/**
* A secret a bot asked the user for (\`[secret-request:ID]\`), as its chip
* and card show it. Never holds a value.
*/
export type SecretRequestView = {
id: number;
key: string;
description: string;
reason: string;
status: SecretRequestStatus;
bot_id: number;
bot_name: string;
/**
* The personal secret it saved, once saved.
*/
env_id: number | null;
};
/**
* A secret ref (\`[secret:ID]\`) as its chip shows it before anyone asks
* for the value: the key, and whether this viewer may reveal it.
*/
export type SecretRefView = {
id: number;
key: string;
description: string;
can_reveal: boolean;
};
export type EnvScope = {
paradigm: EnvParadigm;
id: number | null;
@@ -984,6 +1028,10 @@ export type EnvsOverviewPayload = {
scopes: EnvScope[];
envs: PublicEnv[];
known: KnownEnvStatus[];
/**
* Every user's personal secrets, set from the chat.
*/
personal: PersonalSecret[];
};
/**
@@ -1556,6 +1604,10 @@ export type PagePropsType = {
harness_overview?: HarnessOverviewPayload | null;
bot_harness_overview?: BotHarnessOverviewPayload | null;
envs_overview?: EnvsOverviewPayload | null;
/**
* The viewer's own personal secrets (the Secrets settings page).
*/
personal_secrets?: PersonalSecret[] | null;
/**
* What bots keep on disk: the per-folder quota and its usage (the
* General settings page).