Skip to content
saran-007Public

About

Touch ID-gated 1Password CLI (op) bridge for remote VMs, containers, AI coding agents, and secondary machines over Tailscale or SSH.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

touchop icon

touchop

Touch ID-gated 1Password CLI (op) bridge for remote VMs, containers, AI coding agents, and secondary machines.

CI PyPI Release MIT License Python 3.9+ Zero Dependencies

For AI agents: hand your coding agent AGENT-READY.md (or install the skill with npx skills add saran-007/touchop).

touchop remote terminal triggering Mac Touch ID prompt


Why touchop?

On a local Mac or Linux desktop, op read and op run talk to the 1Password Desktop app and prompt for Touch ID (or PolKit biometrics). On a remote Linux VM (Fly.io Sprites, EC2, Hetzner, Docker, WSL) or a headless secondary Mac running AI coding agents (Claude Code, Codex, Cursor, OpenClaw), there is no local biometric sensor.

Usually you have to put a long-lived 1Password Service Account token on the remote disk. touchop gives you another option:

  • Your 1Password credentials never touch the remote machine.
  • The remote machine installs a drop-in op shim on $PATH that works seamlessly across any runtime (Node.js, Python, Go, Rust, Ruby, Bash, Docker, Claude Code, Codex, OpenClaw).
  • When a remote process runs op read, op inject, or op run --env-file=.env.tpl -- npm run dev, touchop forwards only the read request over Tailscale (or an SSH reverse tunnel) to your Mac's Aqua GUI LaunchAgent.
  • 1Password Desktop prompts for Touch ID on your Mac (showing the custom touchop icon and app name via a lightweight headless touchop.app bundle), and only the requested secret returns to the remote process in memory.

Unofficial community project. Not affiliated with or endorsed by 1Password or Tailscale.


Comparison

Approach Mac Touch ID Gate 1Password Creds on Remote Disk Works for op read / op run Works When Laptop Asleep Best Fit
touchop Yes None Yes (with log masking) No (unless fallback SA set) Personal dev VMs, Fly Sprites, remote AI coding agents
1Password Service Account No Long-lived token Yes Yes CI/CD, unattended servers, scoped team dev vaults
1Password Connect Server No Connect token + self-hosted server Yes Yes Production services, Kubernetes, team infra
1Password SSH Agent (ForwardAgent) Yes None SSH & Git signing only No git push, commit signing, remote SSH hops
Plaintext .env files No Plaintext secrets on disk N/A Yes Never recommended for real credentials

You can also combine approaches: touchop automatically delegates to the native op binary whenever OP_SERVICE_ACCOUNT_TOKEN or OP_CONNECT_TOKEN is set in the environment.


Architecture

touchop architecture diagram


Key Features

  • Zero external dependencies: Pure Python 3.9+ standard library (brew, uv, pipx, pip, or single-command scripts/install.sh).
  • Works across runtimes & platforms: Drop-in op shim works anywhere a process calls op (Node, Python, Go, Rust, Makefiles, Fly.io Sprites, EC2, Docker containers, WSL, secondary Macs).
  • Native macOS Touch ID branding: init-host builds a headless ~/Applications/touchop.app bundle (LSUIElement=true) with AppIcon.icns, so 1Password's biometric prompt shows "Allow touchop to get CLI access" with the touchop icon instead of a generic bare executable icon.
  • op run with secret masking: Resolves op:// references via your Mac, injects them strictly into child process memory on the remote machine, and redacts secret values from child stdout/stderr (<concealed by touchop>) unless --no-masking is passed.
  • Read-only by default: Hard allowlist of read/query op subcommands (read, item get/list, vault list/get, document get/list, inject, whoami, account list/get, --version). Mutations (item delete, item create, item edit, vault delete, run on host, etc.) are rejected with HTTP 403.
  • Vault allowlists (--allow-vault): Restrict remote machines to specific vaults (for example Engineering-Dev or Sandbox-Secrets) so remote agents can never even request items from Personal or Prod Admin.
  • Optional per-request macOS dialog (--require-confirm): Because 1Password Desktop caches CLI biometric unlocks for ~10 minutes by default, --require-confirm adds an explicit native macOS dialog showing the requesting host and exact op command before every call.
  • Multi-host failover: Pass multiple --url values on a client to automatically fail over if your primary Mac is asleep.
  • Seamless native fallback: Setting OP_SERVICE_ACCOUNT_TOKEN, OP_CONNECT_TOKEN, OP_SESSION_*, or TOUCHOP_DISABLE=1 automatically delegates straight to the machine's native op binary.

Quickstart

1. Install touchop (on both host and client)

Homebrew (macOS / Linux):

brew install saran-007/tap/touchop

Python (uv / pipx / pip):

uv tool install touchop
# or: pipx install touchop
# or: pip install touchop

Zero-dependency install (no Homebrew, pip, or venv needed):

git clone https://github.com/saran-007/touchop.git
cd touchop && ./scripts/install.sh

2. Initialize your biometric host (Mac or Linux Desktop)

Make sure 1Password Desktop has Settings > Developer > Integrate with 1Password CLI enabled.

touchop init-host \
  --allow-ip 100.64.0.42 \
  --allow-vault "Engineering-Dev" \
  --allow-vault "Sandbox-Secrets" \
  --account acme.1password.com

This will:

  • Auto-detect your Tailscale IPv4 address (or fall back to 127.0.0.1 for SSH tunnel mode).
  • Generate a 256-bit bearer token at ~/.config/touchop/token (chmod 600).
  • Write ~/.config/touchop/host.json (chmod 600).
  • Install and start a macOS Aqua LaunchAgent (dev.touchop.bridge, wrapped in a headless ~/Applications/touchop.app bundle with AppIcon.icns so Touch ID prompts show the touchop name and icon) or a Linux systemd --user service so the bridge runs inside your GUI session and can trigger biometrics.

Want an explicit click confirmation on your Mac for every remote secret read? Add --require-confirm.

3. Initialize a remote client (Fly.io Sprite, Linux VM, Docker, or secondary Mac)

Copy ~/.config/touchop/token securely from your host to the remote machine (for example via scp or stdin pipe), then run:

touchop init-client \
  --url http://<HOST_TAILSCALE_IP>:18765 \
  --token-file /path/to/copied/token

Add more clients anytime from your host:

touchop allow-ip 100.64.0.30
touchop doctor

Usage on Remote Machines

# Read a single secret (triggers Touch ID on your Mac)
op read "op://Engineering-Dev/Postgres/password"

# Run a Node or Python app with secrets injected in memory only (masked in logs)
op run --env-file=.env.tpl -- npm run dev
op run --env-file=.env.tpl -- uv run python app.py

# Inject secrets into a local config file on the remote machine
op inject -i config.tpl.yml -o config.yml

# Bypass the bridge when using a headless Service Account in CI or unattended runs
OP_SERVICE_ACCOUNT_TOKEN=ops_... op read "op://Engineering-Dev/Postgres/password"

Transport Options

Tailscale (Recommended)

touchop init-host automatically binds strictly to your Tailscale IP (100.x.y.z:18765). Traffic is WireGuard-encrypted end-to-end by Tailscale, never exposed to LAN or public Wi-Fi. You can additionally pin allowed Tailscale node names via --allow-node <node-name> (checked with tailscale whois).

SSH Reverse Tunnel (No Tailscale required)

Bind the host strictly to localhost:

touchop init-host --bind 127.0.0.1 --allow-ip 127.0.0.1

Forward port 18765 when connecting via SSH:

ssh -R 127.0.0.1:18765:127.0.0.1:18765 user@remote-host

Initialize the client with --url http://127.0.0.1:18765.

Multi-Host Failover

Pass --url multiple times during init-client (or list one URL per line in ~/.config/touchop/urls):

touchop init-client \
  --url http://100.64.0.10:18765 \
  --url http://100.64.0.11:18765 \
  --token-file /path/to/token

If the primary host is asleep or unreachable, touchop fails over automatically to the next URL. Explicit policy/auth errors (401/403) do not fail over.


Security & Threat Model

See SECURITY.md for the full threat model, hardening controls, audit log format, and what touchop does and does not protect against.


FAQ

Can I trigger Mac Touch ID for 1Password CLI (op) from a remote Linux VM, Fly.io Sprite, or Docker container?

Yes. Install touchop on your Mac (touchop init-host) and on your remote Linux box or container (touchop init-client). When any process or agent runs op read, op run, or op inject remotely, touchop forwards the read-only request over Tailscale (or an SSH -R reverse tunnel) to your Mac's Aqua GUI session, triggering 1Password Touch ID locally.

How do I let Claude Code, Codex, Cursor, or OpenClaw use op run without a Service Account token on disk?

Run touchop init-client on the remote box so ~/.local/bin/op sits ahead of /usr/bin/op on PATH. Your coding agent can run op run --env-file=.env.tpl -- npm run dev or op run --env-file=.env.tpl -- uv run python app.py with zero 1Password credentials stored on the remote disk, and touchop automatically masks resolved secret values in stdout and stderr (<concealed by touchop>).

Does touchop work without Tailscale?

Yes. Run touchop init-host --bind 127.0.0.1 --allow-ip 127.0.0.1 on your Mac, connect to your remote host with ssh -R 127.0.0.1:18765:127.0.0.1:18765 user@remote, and configure the client with --url http://127.0.0.1:18765.

What happens if I already use OP_SERVICE_ACCOUNT_TOKEN in CI or scripts?

touchop detects OP_SERVICE_ACCOUNT_TOKEN, OP_CONNECT_TOKEN, OP_SESSION_*, or TOUCHOP_DISABLE=1 and immediately delegates to the machine's native op binary without touching the bridge.


Agent Integration

  • One-shot agent setup: point any AI coding agent at AGENT-READY.md (https://raw.githubusercontent.com/saran-007/touchop/main/AGENT-READY.md) or llms.txt.
  • Agent Skill (SKILL.md): install directly into Claude Code, Codex, Cursor, Antigravity, or OpenClaw:
    npx skills add saran-007/touchop
  • Machine-readable diagnostics: run touchop doctor --json for structured health checks.

Contributing & Development

See CONTRIBUTING.md. Run the zero-dependency test suite locally with:

python3 -W error::ResourceWarning -m unittest discover -s tests -v

License

MIT

About

Touch ID-gated 1Password CLI (op) bridge for remote VMs, containers, AI coding agents, and secondary machines over Tailscale or SSH.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages