Skip to content

The agent that grows with you

feat(vault): Desktop, TUI and CLI surfaces for password-manager unlock

Teknium92e0de0ac416
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
index bb5420816f5..1e023118bb3 100644
--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
@@ -12,7 +12,7 @@ import {
import { $gateway } from '@/store/gateway'
import { setMcpSetupRequest } from '@/store/mcp-setup'
import { dispatchNativeNotification } from '@/store/native-notifications'
-import { receiveApprovalRequest, setSecretRequest, setSudoRequest } from '@/store/prompts'
+import { receiveApprovalRequest, setSecretRequest, setSudoRequest, setVaultUnlockRequest } from '@/store/prompts'
import { requestScrollToBottom } from '@/store/thread-scroll'
import type { GatewayEventContext } from './types'
@@ -321,5 +321,31 @@ export function handleInputRequestEvent(ctx: GatewayEventContext): boolean {
return true
}
+ if (event.type === 'vault.unlock.request') {
+ // External password-manager unlock (agent/vault_backends). Blocked on
+ // vault.unlock.respond {request_id, password}; "" keeps it locked.
+ const requestId = typeof payload?.request_id === 'string' ? payload.request_id : ''
+
+ if (requestId) {
+ const backend = typeof payload?.backend === 'string' ? payload.backend : ''
+ const displayName = typeof payload?.display_name === 'string' ? payload.display_name : backend
+
+ setVaultUnlockRequest({ backend, displayName, requestId, sessionId: sessionId ?? null })
+
+ if (sessionId) {
+ updateSessionState(sessionId, state => ({ ...state, needsInput: true }))
+ }
+
+ dispatchNativeNotification({
+ body: translateNow('prompts.vaultUnlockTitle', displayName),
+ kind: 'input',
+ sessionId,
+ title: translateNow('notifications.native.inputTitle')
+ })
+ }
+
+ return true
+ }
+
return false
}
diff --git a/apps/desktop/src/app/settings/vault-settings.test.tsx b/apps/desktop/src/app/settings/vault-settings.test.tsx
index 4f5777bb573..e6586fc5a2f 100644
--- a/apps/desktop/src/app/settings/vault-settings.test.tsx
+++ b/apps/desktop/src/app/settings/vault-settings.test.tsx
@@ -136,4 +136,45 @@ describe('VaultSettings', () => {
await waitFor(() => expect(requestGateway).toHaveBeenCalledWith('vault.remove', { id: 'vault_abc123' }))
})
+
+ it('unlocks a password manager from Settings; the master password leaves only via vault.unlock', async () => {
+ const sources = [
+ { name: 'onepassword', display_name: '1Password', enabled: true, needs_unlock: true, unlocked: false, installed: true },
+ { name: 'bitwarden', display_name: 'Bitwarden', enabled: false, needs_unlock: true, unlocked: false, installed: false }
+ ]
+ requestGateway.mockImplementation(async (method: string) => {
+ if (method === 'vault.list') {
+ // An external item has no delete affordance; its manager is shown as a source badge instead.
+ return { items: [{ ...LOGIN_ITEM, id: 'op:xyz', label: 'GitHub via 1Password', backend: 'onepassword' }] }
+ }
+ if (method === 'vault.sources') {
+ return { sources: sources.map(source => ({ ...source })) }
+ }
+ if (method === 'vault.unlock') {
+ sources[0] = { ...sources[0], unlocked: true }
+
+ return { unlocked: true }
+ }
+
+ return {}
+ })
+ renderVault()
+
+ await waitFor(() => expect(screen.getByText('GitHub via 1Password')).toBeTruthy())
+ expect(screen.queryByRole('button', { name: 'Delete credential' })).toBeNull()
+ // Not-installed manager can't be switched on; the installed one can be unlocked.
+ expect(screen.getByRole('switch', { name: 'Bitwarden' })).toHaveProperty('disabled', true)
+ fireEvent.click(screen.getByRole('button', { name: 'Unlock' }))
+ await waitFor(() => expect(screen.getByText('Unlock 1Password')).toBeTruthy())
+
+ fireEvent.change(screen.getByPlaceholderText('Master password'), { target: { value: 'correct horse' } })
+ fireEvent.click(screen.getByRole('button', { name: 'Unlock' }).closest('form')!.querySelector('button[type=submit]')!)
+
+ await waitFor(() =>
+ expect(requestGateway).toHaveBeenCalledWith('vault.unlock', { name: 'onepassword', password: 'correct horse' })
+ )
+ await waitFor(() => expect(screen.getByText('Unlocked')).toBeTruthy())
+ expect(screen.queryByPlaceholderText('Master password')).toBeNull()
+ expect(screen.getByRole('button', { name: 'Lock' })).toBeTruthy()
+ })
})
diff --git a/apps/desktop/src/app/settings/vault-settings.tsx b/apps/desktop/src/app/settings/vault-settings.tsx
index 30117758119..30eec37dad5 100644
--- a/apps/desktop/src/app/settings/vault-settings.tsx
+++ b/apps/desktop/src/app/settings/vault-settings.tsx
@@ -18,9 +18,10 @@ import { EmptyState } from '@/components/ui/empty-state'
import { Field } from '@/components/ui/field'
import { Input } from '@/components/ui/input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
+import { Switch } from '@/components/ui/switch'
import { useI18n } from '@/i18n'
import { triggerHaptic } from '@/lib/haptics'
-import { Plus, ShieldLock, Trash2 } from '@/lib/icons'
+import { KeyRound, Lock, Plus, ShieldLock, Trash2 } from '@/lib/icons'
import { notify, notifyError } from '@/store/notifications'
import { $gatewayState } from '@/store/session'
@@ -28,6 +29,19 @@ import { CONTROL_TEXT } from './constants'
import { ListRow, Pill, SectionHeading, SettingsContent } from './primitives'
const VAULT_QUERY_KEY = ['vault-items'] as const
+const VAULT_SOURCES_QUERY_KEY = ['vault-sources'] as const
+
+export type VaultSourceName = 'bitwarden' | 'local' | 'onepassword'
+
+/** One login source as reported by `vault.sources` — the backend is authoritative for enabled/unlocked. */
+export interface VaultSource {
+ name: VaultSourceName
+ display_name: string
+ enabled: boolean
+ needs_unlock: boolean
+ unlocked: boolean
+ installed: boolean
+}
export type VaultKind = 'address' | 'login' | 'payment'
const VAULT_KINDS: readonly VaultKind[] = ['login', 'payment', 'address']
@@ -42,6 +56,7 @@ interface VaultItem {
created_at: string
identifier?: null | string
identifier_type?: null | string
+ backend?: VaultSourceName
}
/** Add-dialog prefill from a deep link (`/settings?tab=vault&kind=…`). NEVER secrets. */
@@ -139,6 +154,62 @@ export function VaultSettings() {
const [form, setForm] = useState<VaultForm>(EMPTY_FORM)
const [formError, setFormError] = useState<null | string>(null)
const [pendingDelete, setPendingDelete] = useState<null | VaultItem>(null)
+ const [unlockTarget, setUnlockTarget] = useState<null | VaultSource>(null)
+ const [masterPassword, setMasterPassword] = useState('')
+ const [unlockError, setUnlockError] = useState<null | string>(null)
+
+ const { data: sourcesData } = useQuery({
+ enabled: gatewayState === 'open',
+ queryKey: VAULT_SOURCES_QUERY_KEY,
+ queryFn: async () => {
+ const result = await requestGateway<{ sources: VaultSource[] }>('vault.sources', {})
+
+ return result.sources
+ }
+ })
+
+ const externalSources = useMemo(() => (sourcesData ?? []).filter(s => s.needs_unlock), [sourcesData])
+
+ const invalidateVault = useCallback(() => {
+ void queryClient.invalidateQueries({ queryKey: VAULT_QUERY_KEY })
+ void queryClient.invalidateQueries({ queryKey: VAULT_SOURCES_QUERY_KEY })
+ }, [queryClient])
+
+ const setSourceEnabled = useMutation({
+ mutationFn: ({ name, enabled }: { name: VaultSourceName; enabled: boolean }) =>
+ requestGateway<{ enabled: boolean }>('vault.source.set', { name, enabled }),
+ onSuccess: invalidateVault,
+ onError: err => notifyError(err, v.sources.toggleFailed)
+ })
+
+ const lockSource = useMutation({
+ mutationFn: (name: VaultSourceName) => requestGateway<{ locked: boolean }>('vault.lock', { name }),
+ onSuccess: invalidateVault
+ })
+
+ // The master password lives only in this dialog's state; it is cleared the moment the request
+ // returns (success or failure) and never touches a store or the transcript.
+ const closeUnlock = useCallback(() => {
+ setUnlockTarget(null)
+ setMasterPassword('')
+ setUnlockError(null)
+ }, [])
+
+ const unlockSource = useMutation({
+ mutationFn: ({ name, password }: { name: VaultSourceName; password: string }) =>
+ requestGateway<{ unlocked: boolean }>('vault.unlock', { name, password }),
+ onSuccess: (_result, { name }) => {
+ triggerHaptic('submit')
+ const source = externalSources.find(s => s.name === name)
+ notify({ kind: 'success', message: v.sources.unlocked(source?.display_name ?? name) })
+ closeUnlock()
+ invalidateVault()
+ },
+ onError: err => {
+ setMasterPassword('')
+ setUnlockError(err instanceof Error ? err.message : String(err))
+ }
+ })
const { data, error, isPending } = useQuery({
enabled: gatewayState === 'open',
@@ -266,6 +337,11 @@ export function VaultSettings() {
const kindLabel = useCallback((kind: string) => v.kinds[kind as VaultKind] ?? kind, [v.kinds])
+ const sourceLabel = useCallback(
+ (name: VaultSourceName) => externalSources.find(s => s.name === name)?.display_name ?? name,
+ [externalSources]
+ )
+
const formatCreated = useCallback((iso: string) => {
const parsed = new Date(iso)
@@ -294,16 +370,20 @@ export function VaultSettings() {
{items.map(item => (
<ListRow
action={
- <Button
- aria-label={v.deleteAction}
- className="text-(--ui-text-tertiary) hover:text-destructive"
- onClick={() => setPendingDelete(item)}
- size="icon-sm"
- type="button"
- variant="ghost"
- >
- <Trash2 className="size-3.5" />
- </Button>
+ item.backend && item.backend !== 'local' ? (
+ <Pill tone="muted">{sourceLabel(item.backend)}</Pill>
+ ) : (
+ <Button
+ aria-label={v.deleteAction}
+ className="text-(--ui-text-tertiary) hover:text-destructive"
+ onClick={() => setPendingDelete(item)}
+ size="icon-sm"
+ type="button"
+ variant="ghost"
+ >
+ <Trash2 className="size-3.5" />
+ </Button>
+ )
}
description={
<span className="flex flex-wrap items-center gap-2">
@@ -322,6 +402,109 @@ export function VaultSettings() {
/>
))}
+ {/* Password managers */}
+ <div className="mt-6">
+ <SectionHeading icon={KeyRound} title={v.sources.title} />
+ </div>
+ <p className="mb-2 text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">
+ {v.sources.blurb}
+ </p>
+ {externalSources.map(source => (
+ <ListRow
+ action={
+ <span className="flex items-center justify-end gap-2">
+ {source.enabled &&
+ (source.unlocked ? (
+ <Button
+ className="gap-1.5"
+ disabled={lockSource.isPending}
+ onClick={() => lockSource.mutate(source.name)}
+ size="sm"
+ type="button"
+ variant="ghost"
+ >
+ <Lock className="size-3.5" />
+ {v.sources.lock}
+ </Button>
+ ) : (
+ <Button className="gap-1.5" onClick={() => setUnlockTarget(source)} size="sm" type="button" variant="outline">
+ <KeyRound className="size-3.5" />
+ {v.sources.unlock}
+ </Button>
+ ))}
+ <Switch
+ aria-label={source.display_name}
+ checked={source.enabled}
+ disabled={setSourceEnabled.isPending || (!source.installed && !source.enabled)}
+ onCheckedChange={enabled => {
+ triggerHaptic('selection')
+ setSourceEnabled.mutate({ name: source.name, enabled })
+ }}
+ />
+ </span>
+ }
+ description={
+ !source.installed
+ ? v.sources.notInstalled(source.display_name)
+ : source.enabled
+ ? source.unlocked
+ ? v.sources.unlockedDesc
+ : v.sources.lockedDesc
+ : v.sources.disabledDesc
+ }
+ key={source.name}
+ title={
+ <span className="flex items-center gap-2">
+ <span>{source.display_name}</span>
+ {source.enabled && (
+ <Pill tone={source.unlocked ? 'primary' : 'muted'}>
+ {source.unlocked ? v.sources.statusUnlocked : v.sources.statusLocked}
+ </Pill>
+ )}
+ </span>
+ }
+ />
+ ))}
+
+ {/* Unlock dialog */}
+ <Dialog onOpenChange={open => !open && closeUnlock()} open={unlockTarget !== null}>
+ <DialogContent className="max-w-md">
+ <DialogHeader>
+ <DialogTitle icon={KeyRound}>{v.sources.unlockTitle(unlockTarget?.display_name ?? '')}</DialogTitle>
+ <DialogDescription>{v.sources.unlockDescription}</DialogDescription>
+ </DialogHeader>
+ <form
+ className="grid gap-3"
+ onSubmit={e => {
+ e.preventDefault()
+
+ if (unlockTarget && masterPassword) {
+ unlockSource.mutate({ name: unlockTarget.name, password: masterPassword })
+ }
+ }}
+ >
+ <Input
+ autoComplete="current-password"
+ autoFocus
+ disabled={unlockSource.isPending}
+ onChange={e => setMasterPassword(e.target.value)}
+ placeholder={v.sources.masterPasswordPlaceholder}
+ type="password"
+ value={masterPassword}
+ />
+ {unlockError && <p className="text-xs text-destructive">{unlockError}</p>}
+ <DialogFooter>
+ <Button onClick={closeUnlock} type="button" variant="ghost">
+ {t.common.cancel}
+ </Button>
+ <Button disabled={unlockSource.isPending || !masterPassword} type="submit">
+ {unlockSource.isPending ? v.sources.unlocking : v.sources.unlock}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+
{/* Add dialog */}
<Dialog onOpenChange={open => !open && closeAdd()} open={addOpen}>
<DialogContent className="max-w-lg">
diff --git a/apps/desktop/src/components/prompt-overlays.tsx b/apps/desktop/src/components/prompt-overlays.tsx
index 68f5047cfc9..bd773423dd0 100644
--- a/apps/desktop/src/components/prompt-overlays.tsx
+++ b/apps/desktop/src/components/prompt-overlays.tsx
@@ -17,10 +17,17 @@ import { Input } from '@/components/ui/input'
import { useI18n } from '@/i18n'
import { isMissingPendingPromptRequest } from '@/lib/gateway-rpc'
import { triggerHaptic } from '@/lib/haptics'
-import { KeyRound, Loader2, Lock } from '@/lib/icons'
+import { KeyRound, Loader2, Lock, ShieldLock } from '@/lib/icons'
import { $gateway } from '@/store/gateway'
import { notifyError } from '@/store/notifications'
-import { clearSecretRequest, clearSudoRequest, sessionSecretRequest, sessionSudoRequest } from '@/store/prompts'
+import {
+ clearSecretRequest,
+ clearSudoRequest,
+ clearVaultUnlockRequest,
+ sessionSecretRequest,
+ sessionSudoRequest,
+ sessionVaultUnlockRequest
+} from '@/store/prompts'
// Renders the modal mid-turn prompts the gateway raises and waits on: sudo
// password and skill secret capture. Dangerous-command / execute_code approval
@@ -239,6 +246,102 @@ function SecretDialog({ sessionId }: { sessionId: string | null }) {
)
}
+/** Masked master-password card for an external password manager (1Password / Bitwarden).
+ * Mirrors SecretDialog's contract: closing without submitting answers "" (keep locked); a late
+ * answer after expiry is tolerated by the backend. The value only lives in this component. */
+function VaultUnlockDialog({ sessionId }: { sessionId: string | null }) {
+ const { t } = useI18n()
+ const copy = t.prompts
+ const $request = useMemo(() => sessionVaultUnlockRequest(sessionId), [sessionId])
+ const request = useStore($request)
+ const gateway = useStore($gateway)
+ const [value, setValue] = useState('')
+ const [submitting, setSubmitting] = useState(false)
+
+ useEffect(() => {
+ setValue('')
+ setSubmitting(false)
+ }, [request?.requestId])
+
+ const send = useCallback(
+ async (password: string) => {
+ if (!request) {
+ return
+ }
+
+ if (!gateway) {
+ notifyError(new Error(copy.gatewayDisconnected), copy.vaultUnlockSendFailed)
+
+ return
+ }
+
+ setSubmitting(true)
+
+ try {
+ await gateway.request<{ status?: string }>('vault.unlock.respond', {
+ request_id: request.requestId,
+ password
+ })
+ triggerHaptic('submit')
+ clearVaultUnlockRequest(request.sessionId, request.requestId)
+ } catch (error) {
+ if (isMissingPendingPromptRequest(error, 'password')) {
+ clearVaultUnlockRequest(request.sessionId, request.requestId)
+
+ return
+ }
+
+ notifyError(error, copy.vaultUnlockSendFailed)
+ setSubmitting(false)
+ } finally {
+ setValue('')
+ }
+ },
+ [copy.gatewayDisconnected, copy.vaultUnlockSendFailed, gateway, request]
+ )
+
+ if (!request) {
+ return null
+ }
+
+ return (
+ <Dialog onOpenChange={open => !open && !submitting && void send('')} open>
+ <DialogContent showCloseButton={false}>
+ <DialogHeader>
+ <DialogTitle icon={ShieldLock}>{copy.vaultUnlockTitle(request.displayName)}</DialogTitle>
+ <DialogDescription>{copy.vaultUnlockDesc(request.displayName)}</DialogDescription>
+ </DialogHeader>
+
+ <form
+ className="grid gap-3"
+ onSubmit={event => {
+ event.preventDefault()
+ void send(value)
+ }}
+ >
+ <Input
+ autoComplete="current-password"
+ autoFocus
+ disabled={submitting}
+ onChange={event => setValue(event.target.value)}
+ placeholder={copy.vaultUnlockPlaceholder}
+ type="password"
+ value={value}
+ />
+ <DialogFooter>
+ <Button disabled={submitting} onClick={() => void send('')} type="button" variant="ghost">
+ {copy.vaultUnlockKeepLocked}
+ </Button>
+ <Button disabled={submitting || !value} type="submit">
+ {submitting ? <Loader2 className="size-3.5 animate-spin" /> : copy.vaultUnlockConfirm}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ )
+}
+
/** Mid-turn prompt surfaces for ONE session. Mounted by both the primary chat
* and each tile with its own session id, so a background/tiled session's
* blocking prompt renders instead of silently stalling. */
@@ -248,6 +351,7 @@ export function PromptOverlays({ sessionId }: { sessionId: string | null }) {
<PendingApprovalFallback />
<SudoDialog sessionId={sessionId} />
<SecretDialog sessionId={sessionId} />
+ <VaultUnlockDialog sessionId={sessionId} />
</>
)
}
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index bcdcaae0c4f..d7d61657f6e 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -430,7 +430,27 @@ export const ar = defineLocale({
deleteAction: 'حذف بيانات الاعتماد',
deleteTitle: 'حذف بيانات الاعتماد؟',
deleteDescription: label => `سيُزال "${label}" من الخزنة المشفّرة. لا يمكن التراجع عن هذا.`,
- deleteConfirm: 'حذف'
+ deleteConfirm: 'حذف',
+ sources: {
+ title: 'مديرو كلمات المرور',
+ blurb:
+ 'اسمح للوكيل بتسجيل الدخول باستخدام بيانات الدخول المحفوظة في مدير كلمات المرور. تفتح القفل مرة واحدة في كل جلسة بكلمة المرور الرئيسية؛ يُحتفظ فقط برمز الجلسة في الذاكرة، ولا يرى الوكيل كلمة المرور الرئيسية أو أي كلمة مرور أبدًا.',
+ toggleFailed: 'تعذر تحديث مدير كلمات المرور',
+ notInstalled: name => `لم يتم العثور على واجهة ${name} CLI على هذا الجهاز. ثبّتها ثم فعّل هذا الخيار.`,
+ disabledDesc: 'متوقف. فعّله ليستخدم الوكيل بيانات الدخول من هذا المدير.',
+ lockedDesc: 'مقفل. افتح القفل الآن، أو سيطلب الوكيل ذلك عند أول حاجة إلى بيانات دخول.',
+ unlockedDesc: 'مفتوح لهذه الجلسة. يُقفل تلقائيًا بعد 30 دقيقة من الخمول أو عند إغلاق Hermes.',
+ statusLocked: 'مقفل',
+ statusUnlocked: 'مفتوح',
+ unlock: 'فتح القفل',
+ unlocking: 'جارٍ فتح القفل…',
+ lock: 'قفل',
+ unlocked: name => `تم فتح قفل ${name} لهذه الجلسة.`,
+ unlockTitle: name => `فتح قفل ${name}`,
+ unlockDescription:
+ 'أدخل كلمة المرور الرئيسية. تُسلَّم إلى مدير كلمات المرور على هذا الجهاز ثم تُهمل — لا تُخزَّن ولا تُسجَّل ولا تُعرض على الوكيل أبدًا.',
+ masterPasswordPlaceholder: 'كلمة المرور الرئيسية'
+ }
},
plugins: {
title: 'إضافات سطح المكتب',
@@ -3010,7 +3030,14 @@ export const ar = defineLocale({
sudoPlaceholder: 'كلمة المرور',
secretTitle: 'مطلوب سر',
secretDesc: 'أدخل القيمة المطلوبة لمتابعة المهمة.',
- secretPlaceholder: 'القيمة السرية'
+ secretPlaceholder: 'القيمة السرية',
+ vaultUnlockSendFailed: 'تعذر إرسال كلمة المرور الرئيسية',
+ vaultUnlockTitle: name => `فتح قفل ${name}`,
+ vaultUnlockDesc: name =>
+ `يريد الوكيل تسجيل الدخول إلى موقع ببيانات دخول محفوظة في ${name}. أدخل كلمة المرور الرئيسية لفتح القفل لهذه الجلسة — تُسلَّم مباشرة إلى ${name} على هذا الجهاز ولا تُخزَّن ولا تُعرض على الوكيل.`,
+ vaultUnlockPlaceholder: 'كلمة المرور الرئيسية',
+ vaultUnlockKeepLocked: 'إبقاؤه مقفلًا',
+ vaultUnlockConfirm: 'فتح القفل'
},
desktop: {
audioReadFailed: 'فشلت قراءة الصوت',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 2d67f1a6566..968b9dc29ee 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -555,7 +555,27 @@ export const en: Translations = {
deleteAction: 'Delete credential',
deleteTitle: 'Delete credential?',
deleteDescription: label => `"${label}" will be removed from the encrypted vault. This cannot be undone.`,
- deleteConfirm: 'Delete'
+ deleteConfirm: 'Delete',
+ sources: {
+ title: 'Password managers',
+ blurb:
+ 'Let the agent sign in with logins from your password manager. You unlock it once per session with your master password; only a session token is kept in memory, and the agent never sees it or any password.',
+ toggleFailed: 'Could not update password manager',
+ notInstalled: name => `${name} CLI not found on this machine. Install it, then turn this on.`,
+ disabledDesc: 'Off. Turn on to let the agent use logins from this manager.',
+ lockedDesc: 'Locked. Unlock now, or the agent will ask you the first time it needs a login.',
+ unlockedDesc: 'Unlocked for this session. Locks automatically after 30 minutes idle or when Hermes closes.',
+ statusLocked: 'Locked',
+ statusUnlocked: 'Unlocked',
+ unlock: 'Unlock',
+ unlocking: 'Unlocking…',
+ lock: 'Lock',
+ unlocked: name => `${name} unlocked for this session.`,
+ unlockTitle: name => `Unlock ${name}`,
+ unlockDescription:
+ 'Enter your master password. It is handed to the password manager on this machine and discarded — it is never stored, logged, or shown to the agent.',
+ masterPasswordPlaceholder: 'Master password'
+ }
},
notifications: {
title: 'Notifications',
@@ -3866,7 +3886,14 @@ export const en: Translations = {
sudoPlaceholder: 'sudo password',
secretTitle: 'Secret required',
secretDesc: 'Hermes needs a credential to continue.',
- secretPlaceholder: 'secret value'
+ secretPlaceholder: 'secret value',
+ vaultUnlockSendFailed: 'Could not send master password',
+ vaultUnlockTitle: name => `Unlock ${name}`,
+ vaultUnlockDesc: name =>
+ `The agent wants to sign into a site with a login saved in ${name}. Enter your master password to unlock it for this session — it goes straight to ${name} on this machine and is never stored or shown to the agent.`,
+ vaultUnlockPlaceholder: 'Master password',
+ vaultUnlockKeepLocked: 'Keep locked',
+ vaultUnlockConfirm: 'Unlock'
},
desktop: {
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 3fa0978c69f..7c52cb0cc0e 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -376,7 +376,27 @@ export const ja = defineLocale({
deleteAction: '資格情報を削除',
deleteTitle: '資格情報を削除しますか?',
deleteDescription: label => `「${label}」は暗号化ボールトから削除されます。元に戻せません。`,
- deleteConfirm: '削除'
+ deleteConfirm: '削除',
+ sources: {
+ title: 'パスワードマネージャー',
+ blurb:
+ 'パスワードマネージャーに保存したログインでエージェントがサインインできるようにします。セッションごとに一度マスターパスワードでロック解除し、メモリにはセッショントークンだけが保持されます。エージェントがマスターパスワードやパスワードを見ることはありません。',
+ toggleFailed: 'パスワードマネージャーの設定を更新できませんでした',
+ notInstalled: name => `${name} CLI がこのマシンに見つかりません。インストールしてから有効にしてください。`,
+ disabledDesc: 'オフ。有効にすると、このマネージャーのログインをエージェントが使えるようになります。',
+ lockedDesc: 'ロック中。今ロック解除するか、エージェントが最初にログインを必要としたときに尋ねられます。',
+ unlockedDesc: 'このセッションでロック解除済み。30分間操作がないか Hermes を閉じると自動的にロックされます。',
+ statusLocked: 'ロック中',
+ statusUnlocked: 'ロック解除済み',
+ unlock: 'ロック解除',
+ unlocking: 'ロック解除中…',
+ lock: 'ロック',
+ unlocked: name => `${name} をこのセッションでロック解除しました。`,
+ unlockTitle: name => `${name} のロックを解除`,
+ unlockDescription:
+ 'マスターパスワードを入力してください。このマシン上のパスワードマネージャーに渡された後に破棄され、保存・記録されることも、エージェントに表示されることもありません。',
+ masterPasswordPlaceholder: 'マスターパスワード'
+ }
},
notifications: {
title: '通知',
@@ -3410,7 +3430,14 @@ export const ja = defineLocale({
sudoPlaceholder: 'sudo パスワード',
secretTitle: 'シークレットが必要です',
secretDesc: 'Hermes は続行するための認証情報が必要です。',
- secretPlaceholder: 'シークレット値'
+ secretPlaceholder: 'シークレット値',
+ vaultUnlockSendFailed: 'マスターパスワードを送信できませんでした',
+ vaultUnlockTitle: name => `${name} のロックを解除`,
+ vaultUnlockDesc: name =>
+ `エージェントが ${name} に保存されたログインでサイトにサインインしようとしています。このセッションでロック解除するにはマスターパスワードを入力してください。パスワードはこのマシン上の ${name} に直接渡され、保存されることもエージェントに表示されることもありません。`,
+ vaultUnlockPlaceholder: 'マスターパスワード',
+ vaultUnlockKeepLocked: 'ロックしたまま',
+ vaultUnlockConfirm: 'ロック解除'
},
desktop: {
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index bc7cef74278..e533e93d42e 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -490,6 +490,24 @@ export interface Translations {
deleteTitle: string
deleteDescription: (label: string) => string
deleteConfirm: string
+ sources: {
+ title: string
+ blurb: string
+ toggleFailed: string
+ notInstalled: (name: string) => string
+ disabledDesc: string
+ lockedDesc: string
+ unlockedDesc: string
+ statusLocked: string
+ statusUnlocked: string
+ unlock: string
+ unlocking: string
+ lock: string
+ unlocked: (name: string) => string
+ unlockTitle: (name: string) => string
+ unlockDescription: string
+ masterPasswordPlaceholder: string
+ }
}
notifications: {
title: string
@@ -3357,6 +3375,12 @@ export interface Translations {
secretTitle: string
secretDesc: string
secretPlaceholder: string
+ vaultUnlockSendFailed: string
+ vaultUnlockTitle: (name: string) => string
+ vaultUnlockDesc: (name: string) => string
+ vaultUnlockPlaceholder: string
+ vaultUnlockKeepLocked: string
+ vaultUnlockConfirm: string
}
desktop: {
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index e8a1885f20c..01d2e0cbe7d 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -365,7 +365,26 @@ export const zhHant = defineLocale({
deleteAction: '刪除憑證',
deleteTitle: '刪除憑證?',
deleteDescription: label => `「${label}」將從加密保險庫中移除。此操作無法復原。`,
- deleteConfirm: '刪除'
+ deleteConfirm: '刪除',
+ sources: {
+ title: '密碼管理器',
+ blurb:
+ '允許代理使用密碼管理器中儲存的登入資訊登入網站。每個工作階段只需用主密碼解鎖一次,記憶體中僅保留工作階段權杖,代理永遠看不到主密碼或任何密碼。',
+ toggleFailed: '無法更新密碼管理器',
+ notInstalled: name => `此電腦上找不到 ${name} CLI。請先安裝,再開啟此功能。`,
+ disabledDesc: '已關閉。開啟後代理即可使用此管理器中的登入資訊。',
+ lockedDesc: '已鎖定。可立即解鎖,否則代理在首次需要登入資訊時會詢問你。',
+ unlockedDesc: '本工作階段已解鎖。閒置 30 分鐘或關閉 Hermes 後會自動鎖定。',
+ statusLocked: '已鎖定',
+ statusUnlocked: '已解鎖',
+ unlock: '解鎖',
+ unlocking: '解鎖中…',
+ lock: '鎖定',
+ unlocked: name => `${name} 已在本工作階段解鎖。`,
+ unlockTitle: name => `解鎖 ${name}`,
+ unlockDescription: '輸入主密碼。它會交給本機的密碼管理器後立即捨棄,不會被儲存、記錄或顯示給代理。',
+ masterPasswordPlaceholder: '主密碼'
+ }
},
notifications: {
title: '通知',
@@ -3268,7 +3287,14 @@ export const zhHant = defineLocale({
sudoPlaceholder: 'sudo 密碼',
secretTitle: '需要密鑰',
secretDesc: 'Hermes 需要一個憑證才能繼續。',
- secretPlaceholder: '密鑰值'
+ secretPlaceholder: '密鑰值',
+ vaultUnlockSendFailed: '無法傳送主密碼',
+ vaultUnlockTitle: name => `解鎖 ${name}`,
+ vaultUnlockDesc: name =>
+ `代理想使用儲存在 ${name} 中的登入資訊登入網站。輸入主密碼以在本工作階段解鎖——它會直接交給本機的 ${name},不會被儲存或顯示給代理。`,
+ vaultUnlockPlaceholder: '主密碼',
+ vaultUnlockKeepLocked: '保持鎖定',
+ vaultUnlockConfirm: '解鎖'
},
desktop: {
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 173f2ded973..b9ad56afacc 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -471,7 +471,26 @@ export const zh: Translations = {
deleteAction: '删除凭据',
deleteTitle: '删除凭据?',
deleteDescription: label => `“${label}”将从加密保险库中移除。此操作无法撤销。`,
- deleteConfirm: '删除'
+ deleteConfirm: '删除',
+ sources: {
+ title: '密码管理器',
+ blurb:
+ '允许智能体使用密码管理器中保存的登录信息登录网站。每个会话只需用主密码解锁一次,内存中仅保留会话令牌,智能体永远看不到主密码或任何密码。',
+ toggleFailed: '无法更新密码管理器',
+ notInstalled: name => `此电脑上未找到 ${name} CLI。请先安装,然后再开启。`,
+ disabledDesc: '已关闭。开启后智能体可使用此管理器中的登录信息。',
+ lockedDesc: '已锁定。可立即解锁,否则智能体在首次需要登录信息时会询问你。',
+ unlockedDesc: '本会话已解锁。闲置 30 分钟或关闭 Hermes 后会自动锁定。',
+ statusLocked: '已锁定',
+ statusUnlocked: '已解锁',
+ unlock: '解锁',
+ unlocking: '解锁中…',
+ lock: '锁定',
+ unlocked: name => `${name} 已在本会话中解锁。`,
+ unlockTitle: name => `解锁 ${name}`,
+ unlockDescription: '输入主密码。它会交给本机的密码管理器后立即丢弃,不会被存储、记录或展示给智能体。',
+ masterPasswordPlaceholder: '主密码'
+ }
},
plugins: {
title: '桌面插件',
@@ -3985,7 +4004,14 @@ export const zh: Translations = {
sudoPlaceholder: 'sudo 密码',
secretTitle: '需要密钥',
secretDesc: 'Hermes 需要一个凭据才能继续。',
- secretPlaceholder: '密钥值'
+ secretPlaceholder: '密钥值',
+ vaultUnlockSendFailed: '无法发送主密码',
+ vaultUnlockTitle: name => `解锁 ${name}`,
+ vaultUnlockDesc: name =>
+ `智能体想使用保存在 ${name} 中的登录信息登录网站。输入主密码以在本会话中解锁——它会直接交给本机的 ${name},不会被存储或展示给智能体。`,
+ vaultUnlockPlaceholder: '主密码',
+ vaultUnlockKeepLocked: '保持锁定',
+ vaultUnlockConfirm: '解锁'
},
desktop: {
diff --git a/apps/desktop/src/lib/chat-messages/types.ts b/apps/desktop/src/lib/chat-messages/types.ts
index ef2a21f5146..df5046467ab 100644
--- a/apps/desktop/src/lib/chat-messages/types.ts
+++ b/apps/desktop/src/lib/chat-messages/types.ts
@@ -117,6 +117,9 @@ export type GatewayEventPayload = {
// secret.request (skill credential capture)
env_var?: string
prompt?: string
+ // vault.unlock.request (external password-manager unlock)
+ backend?: string
+ display_name?: string
// terminal.read.request / preview.read.request (GUI agent reading the
// in-app terminal pane or the browser/preview pane)
start?: number
diff --git a/apps/desktop/src/lib/gateway-events.ts b/apps/desktop/src/lib/gateway-events.ts
index 7c994a71ce9..a5905c5e6b4 100644
--- a/apps/desktop/src/lib/gateway-events.ts
+++ b/apps/desktop/src/lib/gateway-events.ts
@@ -41,7 +41,8 @@ export const UNSCOPED_STREAM_EVENT_TYPES = new Set([
'tool.complete',
'tool.generating',
'tool.progress',
- 'tool.start'
+ 'tool.start',
+ 'vault.unlock.request'
])
const UNSCOPED_STREAM_END_EVENT_TYPES = new Set(['error', 'message.complete'])
diff --git a/apps/desktop/src/store/prompts.ts b/apps/desktop/src/store/prompts.ts
index 13637fc797a..13eed8df39c 100644
--- a/apps/desktop/src/store/prompts.ts
+++ b/apps/desktop/src/store/prompts.ts
@@ -106,9 +106,18 @@ export interface SecretRequest extends KeyedPrompt {
requestId: string
}
+// External password-manager unlock (agent/vault_backends). Resolved via
+// vault.unlock.respond {request_id, password}; "" keeps the manager locked.
+export interface VaultUnlockRequest extends KeyedPrompt {
+ backend: string
+ displayName: string
+ requestId: string
+}
+
const approval = keyedPromptStore<ApprovalRequest>()
const sudo = keyedPromptStore<SudoRequest>()
const secret = keyedPromptStore<SecretRequest>()
+const vaultUnlock = keyedPromptStore<VaultUnlockRequest>()
// Inline approval anchors, keyed by session: a tile's inline bar mounting must
// not suppress the PRIMARY session's floating fallback (and vice versa).
@@ -216,14 +225,20 @@ export const $secretRequest = secret.$active
export const setSecretRequest = secret.set
export const clearSecretRequest = secret.clear
+export const $vaultUnlockRequest = vaultUnlock.$active
+export const setVaultUnlockRequest = vaultUnlock.set
+export const clearVaultUnlockRequest = vaultUnlock.clear
+export const sessionVaultUnlockRequest = (sessionId: string | null) =>
+ computed(vaultUnlock.$all, all => all[keyFor(sessionId)] ?? null)
+
// True when the active session is blocked on the user (clarify question or an
// approval / sudo / secret prompt). Mirrors the pet's `awaitingInput` concept
// (agent/pet/state.py): the turn is paused on you, not working — so callers can
// suppress "thinking" indicators and the Esc-to-interrupt shortcut while you
// decide, instead of treating the wait as an in-flight turn.
export const $activeSessionAwaitingInput = computed(
- [$clarifyRequest, $approvalRequest, $sudoRequest, $secretRequest],
- (clarify, approval, sudo, secret) => Boolean(clarify || approval || sudo || secret)
+ [$clarifyRequest, $approvalRequest, $sudoRequest, $secretRequest, $vaultUnlockRequest],
+ (clarify, approval, sudo, secret, vault) => Boolean(clarify || approval || sudo || secret || vault)
)
/** True when `sessionId` is parked on a blocking prompt that typing cannot
@@ -235,28 +250,33 @@ export const $activeSessionAwaitingInput = computed(
export const hasBlockingPromptRequest = (sessionId: string | null | undefined): boolean => {
const key = keyFor(sessionId)
- return Boolean(approval.$all.get()[key] || sudo.$all.get()[key] || secret.$all.get()[key])
+ return Boolean(
+ approval.$all.get()[key] || sudo.$all.get()[key] || secret.$all.get()[key] || vaultUnlock.$all.get()[key]
+ )
}
/** Reactive twin of `hasBlockingPromptRequest`, for the composer's busy-action
* affordance (the primary button must advertise queue, not steer, while the
* turn is parked on a prompt Enter can't answer). */
export const sessionBlockingPrompt = (sessionId: string | null) =>
- computed([approval.$all, sudo.$all, secret.$all], (approvals, sudos, secrets) => {
+ computed([approval.$all, sudo.$all, secret.$all, vaultUnlock.$all], (approvals, sudos, secrets, vaults) => {
const key = keyFor(sessionId)
- return Boolean(approvals[key] || sudos[key] || secrets[key])
+ return Boolean(approvals[key] || sudos[key] || secrets[key] || vaults[key])
})
/** Per-session `awaitingInput` — the tile composer's counterpart of
* `$activeSessionAwaitingInput` (same sources, fixed session instead of the
* active one). */
export function sessionAwaitingInput(sessionId: string | null) {
- return computed([$clarifyRequests, approval.$all, sudo.$all, secret.$all], (clarify, approvals, sudos, secrets) => {
- const key = keyFor(sessionId)
+ return computed(
+ [$clarifyRequests, approval.$all, sudo.$all, secret.$all, vaultUnlock.$all],
+ (clarify, approvals, sudos, secrets, vaults) => {
+ const key = keyFor(sessionId)
- return Boolean(clarify[key] || approvals[key] || sudos[key] || secrets[key])
- })
+ return Boolean(clarify[key] || approvals[key] || sudos[key] || secrets[key] || vaults[key])
+ }
+ )
}
// Drop in-flight prompts for `sessionId` (a turn ended) across all three kinds —
@@ -266,6 +286,7 @@ export function clearAllPrompts(sessionId?: string | null): void {
approval.reset()
sudo.reset()
secret.reset()
+ vaultUnlock.reset()
$approvalInlineAnchors.set({})
return
@@ -274,4 +295,5 @@ export function clearAllPrompts(sessionId?: string | null): void {
approval.clear(sessionId)
sudo.clear(sessionId)
secret.clear(sessionId)
+ vaultUnlock.clear(sessionId)
}
diff --git a/hermes_cli/vault.py b/hermes_cli/vault.py
index 9deaa7b0d44..a4e6d15e105 100644
--- a/hermes_cli/vault.py
+++ b/hermes_cli/vault.py
@@ -105,33 +105,66 @@ def _cmd_add(args) -> None:
def _cmd_list(args) -> None:
- from agent.vault_store import get_vault_store
+ """Local items always; external managers only for the lifetime of this CLI process (a
+ `hermes vault list` unlock does not carry into a chat session — unlock there when asked)."""
+ from agent.vault_backends import enabled_backends
c = _console()
- items = get_vault_store().list_items()
- if not items:
+ rows, locked = [], []
+ for backend in enabled_backends():
+ if backend.needs_unlock and not backend.is_unlocked():
+ locked.append(backend.display_name)
+ continue
+ rows.extend((backend.display_name, meta) for meta in backend.list_items())
+ if not rows and not locked:
c.print("[dim]Vault is empty. Add an item with `hermes vault add`.[/]")
return
- from rich.table import Table
-
- table = Table(title=f"Vault items ({len(items)})")
- table.add_column("Handle", style="bold")
- table.add_column("Kind")
- table.add_column("Label")
- table.add_column("Identifier")
- table.add_column("Origin")
- table.add_column("Created")
- for meta in items:
- table.add_row(
- meta.id,
- meta.kind,
- meta.label,
- meta.identifier or "-",
- meta.origin or "-",
- meta.created_at[:19],
- )
- c.print(table)
- c.print("[dim]Passwords are never shown; the agent fills them server-side from the handle.[/]")
+ if rows:
+ from rich.table import Table
+
+ table = Table(title=f"Vault items ({len(rows)})")
+ for col in ("Handle", "Source", "Kind", "Label", "Identifier", "Origin"):
+ table.add_column(col, style="bold" if col == "Handle" else None)
+ for source, meta in rows:
+ table.add_row(meta.id, source, meta.kind, meta.label, meta.identifier or "-", meta.origin or "-")
+ c.print(table)
+ c.print("[dim]Passwords are never shown; the agent fills them server-side from the handle.[/]")
+ for name in locked:
+ c.print(f"[yellow]{name}[/] is enabled but locked — the agent will ask you to unlock it when it needs a login.")
+
+
+def _cmd_sources(args) -> None:
+ """Show/enable/disable the external password managers (`vault.<name>.enabled`)."""
+ import shutil
+
+ from agent.secret_sources.onepassword import find_op
+ from agent.vault_backends import enabled_backends
+ from agent.vault_backends.bitwarden import BitwardenLoginBackend
+ from agent.vault_backends.onepassword import OnePasswordLoginBackend
+ from hermes_cli.config import load_config, save_config
+
+ c = _console()
+ classes = {cls.name: cls for cls in (OnePasswordLoginBackend, BitwardenLoginBackend)}
+ if args.enable or args.disable:
+ name = args.enable or args.disable
+ if name not in classes:
+ c.print(f"[red]Unknown password manager {name!r}[/] (expected one of {', '.join(classes)})")
+ return
+ cfg = load_config()
+ cfg.setdefault("vault", {}).setdefault(name, {})["enabled"] = bool(args.enable)
+ save_config(cfg)
+ state = "enabled" if args.enable else "disabled"
+ c.print(f"[green]{classes[name].display_name} {state}[/] for browser logins.")
+ if args.enable and name == "bitwarden":
+ c.print("[dim]Run `bw login` once in a terminal first; Hermes only ever unlocks, never logs in.[/]")
+ return
+ enabled = {b.name for b in enabled_backends()}
+ installed = {"onepassword": find_op() is not None, "bitwarden": shutil.which("bw") is not None}
+ for name, cls in classes.items():
+ status = "[green]on[/]" if name in enabled else "[dim]off[/]"
+ cli = "" if installed[name] else " [yellow](CLI not found)[/]"
+ c.print(f" {cls.display_name:<10} {status}{cli}")
+ c.print("[dim]Toggle with `hermes vault sources --enable onepassword` / `--disable bitwarden`.[/]")
def _cmd_rm(args) -> None:
@@ -165,6 +198,12 @@ def register_cli(subparser) -> None:
p_rm.add_argument("handle", help="Item handle (see `hermes vault list`)")
p_rm.set_defaults(_vault_handler=_cmd_rm)
+ p_src = subs.add_parser("sources", help="Show or toggle password managers (1Password, Bitwarden) as login sources")
+ group = p_src.add_mutually_exclusive_group()
+ group.add_argument("--enable", metavar="NAME", help="Enable a manager: onepassword | bitwarden")
+ group.add_argument("--disable", metavar="NAME", help="Disable a manager")
+ p_src.set_defaults(_vault_handler=_cmd_sources)
+
def vault_command(args) -> None:
handler = getattr(args, "_vault_handler", None)
diff --git a/ui-tui/src/app/createGatewayEventHandler.ts b/ui-tui/src/app/createGatewayEventHandler.ts
index b0a4059d6d6..cf2d23bdf01 100644
--- a/ui-tui/src/app/createGatewayEventHandler.ts
+++ b/ui-tui/src/app/createGatewayEventHandler.ts
@@ -1318,6 +1318,26 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev:
return
+ case 'vault.unlock.request':
+ patchOverlayState({
+ vaultUnlock: {
+ backend: ev.payload.backend,
+ displayName: ev.payload.display_name,
+ requestId: ev.payload.request_id
+ }
+ })
+ setStatus(`unlock ${ev.payload.display_name}`)
+ ringPromptBell()
+
+ return
+
+ case 'vault.unlock.expire':
+ patchOverlayState(prev =>
+ prev.vaultUnlock?.requestId === ev.payload.request_id ? { ...prev, vaultUnlock: null } : prev
+ )
+
+ return
+
case 'background.complete':
dropBgTask(ev.payload.task_id)
sys(`[bg ${ev.payload.task_id}] ${ev.payload.text}`)
diff --git a/ui-tui/src/app/interfaces.ts b/ui-tui/src/app/interfaces.ts
index 1aecedd70b8..55459932f70 100644
--- a/ui-tui/src/app/interfaces.ts
+++ b/ui-tui/src/app/interfaces.ts
@@ -25,6 +25,7 @@ import type {
Msg,
PanelSection,
SecretReq,
+ VaultUnlockReq,
SectionVisibility,
SessionInfo,
SlashCatalog,
@@ -297,6 +298,7 @@ export interface OverlayState {
petPicker: boolean
pluginsHub: boolean
secret: null | SecretReq
+ vaultUnlock: null | VaultUnlockReq
sessions: boolean
skillsHub: boolean
subscription: SubscriptionOverlayState | null
@@ -567,6 +569,7 @@ export interface AppLayoutActions {
answerClarifyQuestion: (qid: string, answer: string) => void
answerSecret: (value: string) => void
answerSudo: (pw: string) => void
+ answerVaultUnlock: (password: string) => void
clearSelection: () => void
activateLiveSession: (id: string) => void
closeLiveSession: (id: string) => Promise<null | SessionCloseResponse>
@@ -641,6 +644,7 @@ export interface AppOverlaysProps {
onResumeSelect: (sessionId: string) => void
onSecretSubmit: (value: string) => void
onSudoSubmit: (pw: string) => void
+ onVaultUnlockSubmit: (password: string) => void
pagerPageSize: number
}
diff --git a/ui-tui/src/app/overlayStore.ts b/ui-tui/src/app/overlayStore.ts
index 92d52656545..48258a0c0ec 100644
--- a/ui-tui/src/app/overlayStore.ts
+++ b/ui-tui/src/app/overlayStore.ts
@@ -18,6 +18,7 @@ const buildOverlayState = (): OverlayState => ({
petPicker: false,
pluginsHub: false,
secret: null,
+ vaultUnlock: null,
sessions: false,
skillsHub: false,
subscription: null,
diff --git a/ui-tui/src/app/useInputHandlers.ts b/ui-tui/src/app/useInputHandlers.ts
index a5f258c1829..27c8694b9d8 100644
--- a/ui-tui/src/app/useInputHandlers.ts
+++ b/ui-tui/src/app/useInputHandlers.ts
@@ -143,7 +143,7 @@ export function applyVoiceRecordResponse(
}
export function dismissSensitivePrompt(
- overlay: Pick<OverlayState, 'secret' | 'sudo'>,
+ overlay: Pick<OverlayState, 'secret' | 'sudo' | 'vaultUnlock'>,
rpc: GatewayRpc,
sys: (text: string) => void
) {
@@ -164,6 +164,15 @@ export function dismissSensitivePrompt(
return rpc<SecretRespondResponse>('secret.respond', { request_id: requestId, value: '' })
}
+
+ if (overlay.vaultUnlock) {
+ const requestId = overlay.vaultUnlock.requestId
+
+ patchOverlayState({ vaultUnlock: null })
+ sys(`${overlay.vaultUnlock.displayName} stays locked`)
+
+ return rpc<SecretRespondResponse>('vault.unlock.respond', { password: '', request_id: requestId })
+ }
}
const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value))
@@ -224,7 +233,7 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult {
.then(r => r && (patchOverlayState({ approval: null }), patchTurnState({ outcome: 'denied' })))
}
- if (overlay.sudo || overlay.secret) {
+ if (overlay.sudo || overlay.secret || overlay.vaultUnlock) {
return dismissSensitivePrompt(overlay, gateway.rpc, actions.sys)
}
@@ -481,7 +490,7 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult {
return
}
- if (isCtrl(key, ch, 'c') || (key.escape && (overlay.secret || overlay.sudo))) {
+ if (isCtrl(key, ch, 'c') || (key.escape && (overlay.secret || overlay.sudo || overlay.vaultUnlock))) {
cancelOverlayFromCtrlC()
} else if (key.escape && overlay.sessions) {
patchOverlayState({ sessions: false })
diff --git a/ui-tui/src/app/useMainApp.ts b/ui-tui/src/app/useMainApp.ts
index 59c81427f45..b5b9e4de4f6 100644
--- a/ui-tui/src/app/useMainApp.ts
+++ b/ui-tui/src/app/useMainApp.ts
@@ -646,7 +646,7 @@ export function useMainApp(gw: GatewayClient) {
// Format: `<marker> <session name> · <model> · <cwd>` — name/cwd omitted when absent.
const model = ui.info?.model?.replace(/^.*\//, '') ?? ''
- const marker = overlay.approval || overlay.sudo || overlay.secret || overlay.clarify ? '⚠' : ui.busy ? '⏳' : '✓'
+ const marker = overlay.approval || overlay.sudo || overlay.secret || overlay.vaultUnlock || overlay.clarify ? '⚠' : ui.busy ? '⏳' : '✓'
const tabCwd = ui.info?.cwd
@@ -1065,6 +1065,26 @@ export function useMainApp(gw: GatewayClient) {
[overlay.secret, respondWith]
)
+ const answerVaultUnlock = useCallback(
+ (password: string) => {
+ if (!overlay.vaultUnlock) {
+ return
+ }
+
+ const requestId = overlay.vaultUnlock.requestId
+
+ if (!password) {
+ patchOverlayState({ vaultUnlock: null })
+ }
+
+ return respondWith('vault.unlock.respond', { password, request_id: requestId }, () => {
+ patchOverlayState({ vaultUnlock: null })
+ patchUiState({ status: 'running…' })
+ })
+ },
+ [overlay.vaultUnlock, respondWith]
+ )
+
const onModelSelect = useCallback((value: string) => {
patchOverlayState({ modelPicker: false })
slashRef.current(`/model ${value}`)
@@ -1175,6 +1195,7 @@ export function useMainApp(gw: GatewayClient) {
answerClarifyQuestion,
answerSecret,
answerSudo,
+ answerVaultUnlock,
clearSelection,
newLiveSession: () => session.newLiveSession(),
newPromptSession,
@@ -1198,6 +1219,7 @@ export function useMainApp(gw: GatewayClient) {
answerClarifyQuestion,
answerSecret,
answerSudo,
+ answerVaultUnlock,
clearSelection,
closeLiveSession,
newPromptSession,
diff --git a/ui-tui/src/components/appLayout.tsx b/ui-tui/src/components/appLayout.tsx
index 09fbb075a27..cad8caf42a2 100644
--- a/ui-tui/src/components/appLayout.tsx
+++ b/ui-tui/src/components/appLayout.tsx
@@ -577,6 +577,7 @@ export const AppLayout = memo(function AppLayout({
onClarifyQuestionAnswer={actions.answerClarifyQuestion}
onSecretSubmit={actions.answerSecret}
onSudoSubmit={actions.answerSudo}
+ onVaultUnlockSubmit={actions.answerVaultUnlock}
/>
</PerfPane>
diff --git a/ui-tui/src/components/appOverlays.tsx b/ui-tui/src/components/appOverlays.tsx
index f96be36ba4d..ff305cff715 100644
--- a/ui-tui/src/components/appOverlays.tsx
+++ b/ui-tui/src/components/appOverlays.tsx
@@ -61,10 +61,17 @@ export function PromptZone({
onClarifyAnswer,
onClarifyQuestionAnswer,
onSecretSubmit,
- onSudoSubmit
+ onSudoSubmit,
+ onVaultUnlockSubmit
}: Pick<
AppOverlaysProps,
- 'cols' | 'onApprovalChoice' | 'onClarifyAnswer' | 'onClarifyQuestionAnswer' | 'onSecretSubmit' | 'onSudoSubmit'
+ | 'cols'
+ | 'onApprovalChoice'
+ | 'onClarifyAnswer'
+ | 'onClarifyQuestionAnswer'
+ | 'onSecretSubmit'
+ | 'onSudoSubmit'
+ | 'onVaultUnlockSubmit'
>) {
const overlay = useStore($overlayState)
const theme = useStore($uiTheme)
@@ -164,6 +171,21 @@ export function PromptZone({
)
}
+ if (overlay.vaultUnlock) {
+ return (
+ <PromptCell cols={cols} id="vault-unlock">
+ <MaskedPrompt
+ cols={cols}
+ icon="🔐"
+ label={`Unlock ${overlay.vaultUnlock.displayName} for this session`}
+ onSubmit={onVaultUnlockSubmit}
+ sub="master password · hidden · goes to the manager CLI only · Esc keeps it locked"
+ t={theme}
+ />
+ </PromptCell>
+ )
+ }
+
return null
}
diff --git a/ui-tui/src/gatewayTypes.ts b/ui-tui/src/gatewayTypes.ts
index 4b0b0be85cd..7f6ed894a4e 100644
--- a/ui-tui/src/gatewayTypes.ts
+++ b/ui-tui/src/gatewayTypes.ts
@@ -767,7 +767,8 @@ export type GatewayEvent =
}
| { payload: { request_id: string }; session_id?: string; type: 'sudo.request' }
| { payload: { env_var: string; prompt: string; request_id: string }; session_id?: string; type: 'secret.request' }
- | { payload: { request_id: string }; session_id?: string; type: 'secret.expire' | 'sudo.expire' }
+ | { payload: { request_id: string }; session_id?: string; type: 'secret.expire' | 'sudo.expire' | 'vault.unlock.expire' }
+ | { payload: { backend: string; display_name: string; request_id: string }; session_id?: string; type: 'vault.unlock.request' }
| { payload: { task_id: string; text: string }; session_id?: string; type: 'background.complete' }
| { payload: { question?: string; task_id: string; text: string }; session_id?: string; type: 'btw.complete' }
| { payload?: { text?: string }; session_id?: string; type: 'review.summary' }
diff --git a/ui-tui/src/types.ts b/ui-tui/src/types.ts
index e9a425b9150..e75fffe0ec2 100644
--- a/ui-tui/src/types.ts
+++ b/ui-tui/src/types.ts
@@ -243,6 +243,13 @@ export interface SecretReq {
requestId: string
}
+/** External password-manager unlock (1Password / Bitwarden) — masked master-password prompt. */
+export interface VaultUnlockReq {
+ backend: string
+ displayName: string
+ requestId: string
+}
+
export interface PanelData {
sections: PanelSection[]
title: string
diff --git a/website/docs/user-guide/features/credential-vault.md b/website/docs/user-guide/features/credential-vault.md
index eaa168f22a1..0c63325e65b 100644
--- a/website/docs/user-guide/features/credential-vault.md
+++ b/website/docs/user-guide/features/credential-vault.md
@@ -1,7 +1,8 @@
# Credential Vault (Password-Blind Autofill)
-Store site logins in a locally encrypted vault and let the agent log into
-websites **without ever seeing the password**. The login identifier
+Let the agent log into websites **without ever seeing the password**, using
+logins from a locally encrypted vault or from your password manager
+(1Password, Bitwarden). The login identifier
(email/username/phone) is ordinary metadata the agent can see and type
itself; only the password is vault-secret — it is resolved server-side and
injected directly into the page.
@@ -54,6 +55,62 @@ Item kinds: `login`, `payment`, and `address` are all stored (`payment` and
`address` payloads remain fully secret); Phase 1 browser fill supports
`login` items only.
+## Password managers (1Password, Bitwarden)
+
+You don't have to copy logins into the Hermes vault. Enable a password
+manager and its website logins become fillable handles alongside the local
+ones (`op:…` for 1Password, `bw:…` for Bitwarden). The password is fetched
+from the manager's CLI at fill time only and follows the same server-side
+injection, origin binding, and redaction as a local item.
+
+```bash
+hermes vault sources # status of each manager
+hermes vault sources --enable onepassword # needs the `op` CLI on PATH
+hermes vault sources --enable bitwarden # needs the `bw` CLI; run `bw login` once first
+```
+
+or **Desktop → Settings → Credential Vault → Password managers** (toggle,
+Unlock, Lock).
+
+### Unlocking is per session
+
+A manager starts **locked**. The first time the agent needs one of its
+logins it asks you to unlock: a masked master-password prompt appears in
+the CLI, TUI, or Desktop chat (or you can unlock ahead of time from
+Settings). Hermes hands the master password to `op signin` / `bw unlock` on
+stdin, never as a command-line argument, and keeps only the resulting
+session token in memory. The token expires after 30 minutes idle, when you
+press **Lock**, or when the session ends. The agent never sees the master
+password, the token, or any password.
+
+`browser_vault_list` reports a locked manager under `locked`, and
+`browser_vault_unlock(backend)` triggers the prompt explicitly.
+
+### Headless sessions never prompt
+
+Cron jobs, webhooks, the API server, and `hermes chat -q` have nobody to
+answer a prompt, so a locked manager is reported as
+`unavailable_in_this_session` and fills refuse — the same posture command
+approvals take there. Unlock from an interactive session or the Desktop app
+first (the token is per process, so a running gateway that you unlock from
+a chat keeps serving its own cron jobs), or give 1Password a service-account
+token (`OP_SERVICE_ACCOUNT_TOKEN`) to skip the prompt entirely. The local
+vault needs no unlock and keeps working everywhere.
+
+```yaml
+vault:
+ onepassword:
+ enabled: true
+ account: "" # `op --account` shorthand; empty = default
+ service_account_token_env: OP_SERVICE_ACCOUNT_TOKEN
+ bitwarden:
+ enabled: true
+```
+
+Bitwarden here means the **Password Manager** (`bw`) — website logins — not
+the Secrets Manager (`bws`) that the [secrets](../secrets/bitwarden) feature
+uses for API keys.
+
## Desktop app
Desktop users can manage the vault without a terminal: open
@@ -81,9 +138,10 @@ agent's error message points at both `hermes vault add` and this panel.
```
User: log into example.com and check my dashboard
Agent: browser_navigate("https://example.com/login")
-Agent: browser_vault_list() → [{handle: "vault_…", label: "Example", identifier: "[email protected]", origin: "https://example.com"}]
+Agent: browser_vault_list() → {items: [{handle: "op:…", backend: "onepassword", label: "Example", identifier: "[email protected]", origin: "https://example.com"}]}
+ (or, if 1Password is still locked: {items: [], locked: [{backend: "onepassword", unlock: "browser_vault_unlock"}]} → the agent calls browser_vault_unlock and you get a masked prompt)
Agent: fill_input(<username field>, "[email protected]")
-Agent: browser_vault_fill("vault_…") → {"success": true, "filled_fields": 1, "kind": "login", "origin": "https://example.com"}
+Agent: browser_vault_fill("op:…") → {"success": true, "filled_fields": 1, "backend": "onepassword", "kind": "login", "origin": "https://example.com"}
Agent: browser_click(<submit>)
```
@@ -109,11 +167,15 @@ Agent: browser_click(<submit>)
password*, are never filled.
- **Encrypted at rest:** vault file and key are created `0600` in your
Hermes home; nothing is sent to any server.
+- **Master password never stored:** for 1Password/Bitwarden the master
+ password goes to the manager CLI on stdin and is dropped; only the
+ session token is held, in memory, with an idle timeout. Headless sessions
+ can't prompt and see the manager as locked.
## Notes
-- No configuration is needed; the tools activate automatically once the
- vault has an item.
+- No configuration is needed for the local vault; the tools activate
+ automatically once it has an item or a password manager is enabled.
- The fill targets the single best current-password field (autocomplete
token beats type heuristics; ties break in DOM order).
- Design ported from Merit-Systems/OpenInstinct's opaque-handle vault