Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(vault): add always-ask toggle for standard signing keys (#809)

Call Whiteffa2e31e0516
diff --git a/ui/src/components/ui/vault-secret-form.tsx b/ui/src/components/ui/vault-secret-form.tsx
index b6ff4e88d..f2f8b7517 100644
--- a/ui/src/components/ui/vault-secret-form.tsx
+++ b/ui/src/components/ui/vault-secret-form.tsx
@@ -33,6 +33,7 @@ import { Button } from './button';
import { Input } from './input';
import { SegmentedRadio } from './segmented';
import { SigningAddressList } from './signing-address-list';
+import { Switch } from './switch';
import { TagInput } from './tag-input';
import { Textarea } from './textarea';
import { VaultProtectedUnlock } from './vault-protected-unlock';
@@ -157,6 +158,9 @@ export const VaultSecretForm: React.FC<{
const [tagsPending, setTagsPending] = useState(false);
const [hostsPending, setHostsPending] = useState(false);
const [protection, setProtection] = useState<VaultProtection>(requestSpec?.protection ?? defaultProtection);
+ // Standard signing keys sign headlessly; this opt-in writes `policy.always_ask` to force
+ // per-use browser approval instead. Only meaningful for a standard keypair (see onSubmit).
+ const [alwaysAsk, setAlwaysAsk] = useState(false);
const [showValue, setShowValue] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [checkingAvault, setCheckingAvault] = useState(true);
@@ -384,12 +388,13 @@ export const VaultSecretForm: React.FC<{
setSubmitting(true);
setError(null);
try {
- // `policy.always_ask` is intentionally not exposed in the product UI (design:
- // vaults-grant-delivery-refactor.md §1 item 6, §11). It remains a backend policy
- // capability, so any value already stored on a secret is preserved; the form never
- // sets or clears it.
+ // `policy.always_ask` is exposed only for a standard signing key (keypair), where the
+ // agent can otherwise sign headlessly — the toggle forces per-use browser approval for
+ // every signature. Protected keys already always approve and static secrets don't sign,
+ // so the form never sets it for them.
const policy: Record<string, unknown> = {};
if (allowHosts.length) policy.allowed_hosts = allowHosts;
+ if (isKeypair && protection === 'standard' && alwaysAsk) policy.always_ask = true;
if (fetchAuthMode === 'header') {
policy.auth = { type: 'header', name: normalizedFetchAuthName };
} else if (fetchAuthMode === 'query') {
@@ -690,6 +695,25 @@ export const VaultSecretForm: React.FC<{
</div>
);
+ // Always-ask opt-in — only for a standard signing key, which otherwise signs headlessly.
+ // Writing `policy.always_ask` forces per-use browser approval for every signature; protected
+ // keys already always approve, so it isn't shown for them.
+ const signApprovalToggle =
+ isKeypair && protection === 'standard' ? (
+ <div className="flex items-start gap-3 rounded-[10px] border border-border bg-surface-2 px-3 py-3">
+ <div className="flex min-w-0 flex-1 flex-col gap-1">
+ <span className="text-[13px] font-semibold text-foreground">{t('vaults.dialog.alwaysAskSign')}</span>
+ <span className="text-[11.5px] leading-snug text-muted-foreground">{t('vaults.dialog.alwaysAskSignHelp')}</span>
+ </div>
+ <Switch
+ checked={alwaysAsk}
+ onCheckedChange={setAlwaysAsk}
+ disabled={submitting}
+ label={t('vaults.dialog.alwaysAskSign')}
+ />
+ </div>
+ ) : null;
+
// Protected setup/unlock gating step + avault availability notices, shared by both modes.
const gatingNotices = (
<>
@@ -965,6 +989,8 @@ export const VaultSecretForm: React.FC<{
{/* Protection */}
{protectionCards}
+ {signApprovalToggle}
+
{/* Advanced — collapsible proxy policy, shared with provide mode. */}
{advancedSection}
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index e7fb32824..543ce4fbd 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -2347,6 +2347,8 @@
"standardProtection": "Standard",
"protectedHelp": "You approve it in your browser before the agent can use it (Face ID / password). Safe even if this computer is stolen; the agent can't use it on its own.",
"standardHelp": "The agent can use it on its own. Best for API keys and most secrets.",
+ "alwaysAskSign": "Ask me before every signature",
+ "alwaysAskSignHelp": "Standard keys can sign on their own. For a high-value key, turn this on so every signature needs your approval in the browser.",
"protectedCreatePending": "Protected web create is not available in this build yet. Choose Standard only for secrets the agent may need to use on its own.",
"save": "Save",
"createSecret": "Create secret",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 20d2e70e4..2d4d73b06 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -2346,6 +2346,8 @@
"standardProtection": "标准",
"protectedHelp": "用之前要你在浏览器里批准(Face ID / 密码)——AI 不能私自使用。就算电脑被偷也打不开。",
"standardHelp": "AI 可以自己使用。适合 API key 和大多数密钥。",
+ "alwaysAskSign": "每次签名都要我确认",
+ "alwaysAskSignHelp": "标准档密钥默认可以自己签名。贵重密钥可以打开它——每次签名都要你在浏览器里亲自批准。",
"protectedCreatePending": "当前构建尚不支持受保护的 Web 创建。需要 Agent 自动取用的密钥请选标准。",
"save": "保存",
"createSecret": "创建密钥",